1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
package flowexpression;
import testlib.flowexpression.qual.FlowExp;
class ViewPointAdaptMethods {
Object param1;
void method1(Object param1, @FlowExp("#1") Object param2) {
@FlowExp("param1") Object local = param2;
@FlowExp("this.param1")
// :: error: (assignment.type.incompatible)
Object local2 = param2;
@FlowExp("#1") Object local3 = param2;
}
Object field;
void callMethod1(@FlowExp("this.field") Object param, @FlowExp("#1") Object param2) {
method1(field, param);
// :: error: (argument.type.incompatible)
method1(field, param2);
}
@FlowExp("#2") Object method2(@FlowExp("#2") Object param1, Object param2, boolean flag) {
if (flag) {
return param1;
} else if (param1 == param2) {
@FlowExp("#2")
// :: error: (assignment.type.incompatible)
Object o = new Object();
return o;
} else {
@FlowExp("param2")
// :: error: (assignment.type.incompatible)
Object o = new Object();
return o;
}
}
}
|