forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathErrorOrders.java
More file actions
63 lines (50 loc) · 1.54 KB
/
ErrorOrders.java
File metadata and controls
63 lines (50 loc) · 1.54 KB
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
package index;
import org.checkerframework.checker.index.qual.GTENegativeOne;
import org.checkerframework.checker.index.qual.IndexFor;
import org.checkerframework.checker.index.qual.SameLenBottom;
import org.checkerframework.checker.index.qual.UpperBoundBottom;
import org.checkerframework.common.value.qual.BottomVal;
/** This class tests that errors are issued in order of position. */
public class ErrorOrders {
void test2(int i, int[] a) {
a[i] = 2;
}
int test4(
@GTENegativeOne @UpperBoundBottom int p1,
@UpperBoundBottom @GTENegativeOne int p2,
int @BottomVal [] p3,
int @SameLenBottom [] p4,
@BottomVal int p5) {
@IndexFor("p2") int z = 0;
@IndexFor("This isn't an expression") int x = z;
return x;
}
void useTest4(int p1, int p2, int[] p3, int[] p4, int p5) {
test4(p1, test4(p1, p2, p3, p4, p5), p3, p4, p5);
}
class InnerClass {
@IndexFor("This isn't an expression") int x = 0;
void test2(int i, int[] a) {
a[i] = 2;
}
}
}
class InSameCompilationUnit {
@IndexFor("This isn't an expression") int x = 0;
void test2(int i, int[] a) {
a[i] = 2;
}
int test4(
@GTENegativeOne @UpperBoundBottom int p1,
@UpperBoundBottom @GTENegativeOne int p2,
int @BottomVal [] p3,
int @SameLenBottom [] p4,
@BottomVal int p5) {
@IndexFor("p2") int z = 0;
@IndexFor("This isn't an expression") int x = z;
return x;
}
void useTest4(int p1, int p2, int[] p3, int[] p4, int p5) {
test4(p1, test4(p1, p2, p3, p4, p5), p3, p4, p5);
}
}