File: Arrays.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 (27 lines) | stat: -rw-r--r-- 803 bytes parent folder | download | duplicates (3)
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
class Arrays {
    public static final String[] RELATIONSHIP_LABELS = {
        "SJJ", "SJU", "SUJ", "SUU", "DJJ", "DJU", "DUJ", "DUU", "JM", "UM", "MJ", "MU"
    };

    public static final int[] ia = {1, -2, 3};

    // Note that "-1.0" is _NOT_ a double literal! It's a unary minus,
    // that needs to be handled correctly.
    public static final double[] elts_plus_minus_one_float = {-1.0, 1.0, +1.0, 1.0 / 2.0};

    String[] vis = new String[] {"a", "b"};

    @SuppressWarnings("nullness") // Don't want to depend on @Nullable
    void m() {
        class VarInfo {}
        VarInfo v1 = null;
        VarInfo v2 = null;
        VarInfo[] vis = null;

        if (v2 == null) {
            vis = new VarInfo[] {v1};
        } else {
            vis = new VarInfo[] {v1, v2};
        }
    }
}