File: ArrayCreationParsing.java

package info (click to toggle)
checker-framework-java 3.2.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,104 kB
  • sloc: java: 145,916; xml: 839; sh: 518; makefile: 404; perl: 26
file content (34 lines) | stat: -rw-r--r-- 736 bytes parent folder | download | duplicates (2)
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;
    }
}