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
|
package flowexpression;
import testlib.flowexpression.qual.FlowExp;
public class ArrayCreationParsing {
@FlowExp("new int[2]") Object value1;
@FlowExp("new int[2][2]") Object value2;
@FlowExp("new String[2]") Object value3;
@FlowExp("new String[] {\"a\", \"b\"}")
Object value4;
int i;
@FlowExp("new int[i]") Object value5;
@FlowExp("new int[this.i]") Object value6;
@FlowExp("new int[getI()]") Object value7;
@FlowExp("new int[] {i, this.i, getI()}") Object value8;
int getI() {
return i;
}
void method(@FlowExp("new java.lang.String[2]") Object param) {
value3 = param;
// :: error: (assignment.type.incompatible)
value1 = param;
}
}
|