File: ViewPointAdaptMethods.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 (39 lines) | stat: -rw-r--r-- 1,137 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
package flowexpression;

import testlib.flowexpression.qual.FlowExp;

class ViewPointAdaptMethods {
    Object param1;

    void method1(Object param1, @FlowExp("#1") Object param2) {
        @FlowExp("param1") Object local = param2;
        @FlowExp("this.param1")
        // :: error: (assignment.type.incompatible)
        Object local2 = param2;
        @FlowExp("#1") Object local3 = param2;
    }

    Object field;

    void callMethod1(@FlowExp("this.field") Object param, @FlowExp("#1") Object param2) {
        method1(field, param);
        // :: error: (argument.type.incompatible)
        method1(field, param2);
    }

    @FlowExp("#2") Object method2(@FlowExp("#2") Object param1, Object param2, boolean flag) {
        if (flag) {
            return param1;
        } else if (param1 == param2) {
            @FlowExp("#2")
            // :: error: (assignment.type.incompatible)
            Object o = new Object();
            return o;
        } else {
            @FlowExp("param2")
            // :: error: (assignment.type.incompatible)
            Object o = new Object();
            return o;
        }
    }
}