File: Commitment.java

package info (click to toggle)
checker-framework-java 3.2.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 22,840 kB
  • sloc: java: 145,910; xml: 839; sh: 518; makefile: 401; perl: 26
file content (75 lines) | stat: -rw-r--r-- 2,258 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import org.checkerframework.checker.initialization.qual.Initialized;
import org.checkerframework.checker.initialization.qual.UnderInitialization;
import org.checkerframework.checker.initialization.qual.UnknownInitialization;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;

public class Commitment {

    @NonNull String t;

    // :: error: (initialization.invalid.field.type)
    @NonNull @UnderInitialization String a;
    // :: error: (initialization.invalid.field.type)
    @Initialized String b;
    @UnknownInitialization @Nullable String c;

    // :: error: (initialization.invalid.constructor.return.type)
    public @UnderInitialization Commitment(int i) {
        a = "";
        t = "";
        b = "";
    }

    // :: error: (initialization.invalid.constructor.return.type)
    public @Initialized Commitment(int i, int j) {
        a = "";
        t = "";
        b = "";
    }

    // :: error: (initialization.invalid.constructor.return.type)
    public @Initialized @NonNull Commitment(boolean i) {
        a = "";
        t = "";
        b = "";
    }

    // :: error: (initialization.invalid.constructor.return.type)
    public @Nullable Commitment(char i) {
        a = "";
        t = "";
        b = "";
    }

    // :: error: (initialization.fields.uninitialized)
    public Commitment() {
        // :: error: (dereference.of.nullable)
        t.toLowerCase();

        t = "";

        @UnderInitialization @NonNull Commitment c = this;

        @UnknownInitialization @NonNull Commitment c1 = this;

        // :: error: (assignment.type.incompatible)
        @Initialized @NonNull Commitment c2 = this;
    }

    // :: error: (initialization.fields.uninitialized)
    public Commitment(@UnknownInitialization Commitment arg) {
        t = "";

        // :: error: (argument.type.incompatible)
        @UnderInitialization Commitment t = new Commitment(this, 1);

        // :: error: (assignment.type.incompatible)
        @Initialized Commitment t1 = new Commitment(this);

        @UnderInitialization Commitment t2 = new Commitment(this);
    }

    // :: error: (initialization.fields.uninitialized)
    public Commitment(Commitment arg, int i) {}
}