File: ArrayCreationParsing.java

package info (click to toggle)
checker-framework-java 3.0.1%2Bds2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 22,736 kB
  • sloc: java: 145,286; xml: 785; sh: 456; makefile: 401; perl: 26
file content (35 lines) | stat: -rw-r--r-- 740 bytes parent folder | download
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
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;
    }
}