|
| 1 | +public class My { |
| 2 | + public static int val() { return 3; } |
| 3 | + |
| 4 | + public static int p1; |
| 5 | + public static int p2 = 1; |
| 6 | + public static int p3; |
| 7 | + static { p3 = 2; } |
| 8 | + public static int p4 = val(); |
| 9 | + public static Integer p5 = new Integer(5); |
| 10 | + |
| 11 | + public static final int pf1 = 1; |
| 12 | + public static final int pf2; |
| 13 | + static { pf2 = 2; } |
| 14 | + public static final int pf3 = val(); |
| 15 | + public static final Integer pf4 = new Integer(4); |
| 16 | + |
| 17 | + private static int pr1; |
| 18 | + private static int pr2 = 1; |
| 19 | + private static int pr3; |
| 20 | + static { pr3 = 2; } |
| 21 | + private static int pr4 = val(); |
| 22 | + private static Integer pr5 = new Integer(5); |
| 23 | + |
| 24 | + private static final int prf1 = 1; |
| 25 | + private static final int prf2; |
| 26 | + static { prf2 = 2; } |
| 27 | + private static final int prf3 = val(); |
| 28 | + private static final Integer prf4 = new Integer(4); |
| 29 | + |
| 30 | + // for inner classes, the missing cases of the above fields do not compile |
| 31 | + public class PInner { |
| 32 | + public static final int pf1 = 1; |
| 33 | + |
| 34 | + private static final int prf1 = 1; |
| 35 | + } |
| 36 | + |
| 37 | + public static class PSInner { |
| 38 | + public static int p1; |
| 39 | + public static int p2 = 1; |
| 40 | + public static int p3; |
| 41 | + static { p3 = 2; } |
| 42 | + public static int p4 = val(); |
| 43 | + public static Integer p5 = new Integer(5); |
| 44 | + |
| 45 | + public static final int pf1 = 1; |
| 46 | + public static final int pf2; |
| 47 | + static { pf2 = 2; } |
| 48 | + public static final int pf3 = val(); |
| 49 | + public static final Integer pf4 = new Integer(4); |
| 50 | + |
| 51 | + private static int pr1; |
| 52 | + private static int pr2 = 1; |
| 53 | + private static int pr3; |
| 54 | + static { pr3 = 2; } |
| 55 | + private static int pr4 = val(); |
| 56 | + private static Integer pr5 = new Integer(5); |
| 57 | + |
| 58 | + private static final int prf1 = 1; |
| 59 | + private static final int prf2; |
| 60 | + static { prf2 = 2; } |
| 61 | + private static final int prf3 = val(); |
| 62 | + private static final Integer prf4 = new Integer(4); |
| 63 | + } |
| 64 | + |
| 65 | + private class PrInner { |
| 66 | + public static final int pf1 = 1; |
| 67 | + |
| 68 | + private static final int prf1 = 1; |
| 69 | + } |
| 70 | + |
| 71 | + private static class PrSInner { |
| 72 | + public static int p1; |
| 73 | + public static int p2 = 1; |
| 74 | + public static int p3; |
| 75 | + static { p3 = 2; } |
| 76 | + public static int p4 = val(); |
| 77 | + public static Integer p5 = new Integer(5); |
| 78 | + |
| 79 | + public static final int pf1 = 1; |
| 80 | + public static final int pf2; |
| 81 | + static { pf2 = 2; } |
| 82 | + public static final int pf3 = val(); |
| 83 | + public static final Integer pf4 = new Integer(4); |
| 84 | + |
| 85 | + private static int pr1; |
| 86 | + private static int pr2 = 1; |
| 87 | + private static int pr3; |
| 88 | + static { pr3 = 2; } |
| 89 | + private static int pr4 = val(); |
| 90 | + private static Integer pr5 = new Integer(5); |
| 91 | + |
| 92 | + private static final int prf1 = 1; |
| 93 | + private static final int prf2; |
| 94 | + static { prf2 = 2; } |
| 95 | + private static final int prf3 = val(); |
| 96 | + private static final Integer prf4 = new Integer(4); |
| 97 | + } |
| 98 | + |
| 99 | + public int field; |
| 100 | + public My(int i) { |
| 101 | + String s = "bla"; |
| 102 | + field = i; |
| 103 | + if (p1 != 0) |
| 104 | + field = 108; // this line can only be covered with nondet-static |
| 105 | + if (p2 != 1) |
| 106 | + field = 108; // this line can only be covered with nondet-static |
| 107 | + if (p3 != 2) |
| 108 | + field = 108; // this line can only be covered with nondet-static |
| 109 | + if (p4 != 3) |
| 110 | + field = 108; // this line can only be covered with nondet-static |
| 111 | + if (!p5.equals(5)) |
| 112 | + field = 108; // this line can only be covered with nondet-static |
| 113 | + |
| 114 | + if (pf1 != 1) |
| 115 | + field = 108; // this line cannot be covered even with nondet-static |
| 116 | + if (pf2 != 2) |
| 117 | + field = 108; // this line cannot be covered even with nondet-static |
| 118 | + if (pf3 != 3) |
| 119 | + field = 108; // this line cannot be covered even with nondet-static |
| 120 | + if (!pf4.equals(4)) |
| 121 | + field = 108; // this line cannot be covered even with nondet-static |
| 122 | + |
| 123 | + if (pr1 != 0) |
| 124 | + field = 108; // this line can only be covered with nondet-static |
| 125 | + if (pr2 != 1) |
| 126 | + field = 108; // this line can only be covered with nondet-static |
| 127 | + if (pr3 != 2) |
| 128 | + field = 108; // this line can only be covered with nondet-static |
| 129 | + if (pr4 != 3) |
| 130 | + field = 108; // this line can only be covered with nondet-static |
| 131 | + if (!pr5.equals(5)) |
| 132 | + field = 108; // this line can only be covered with nondet-static |
| 133 | + |
| 134 | + if (prf1 != 1) |
| 135 | + field = 108; // this line cannot be covered even with nondet-static |
| 136 | + if (prf2 != 2) |
| 137 | + field = 108; // this line cannot be covered even with nondet-static |
| 138 | + if (prf3 != 3) |
| 139 | + field = 108; // this line cannot be covered even with nondet-static |
| 140 | + if (!prf4.equals(4)) |
| 141 | + field = 108; // this line cannot be covered even with nondet-static |
| 142 | + |
| 143 | + if (PInner.pf1 != 1) |
| 144 | + field = 108; // this line cannot be covered even with nondet-static |
| 145 | + |
| 146 | + if (PInner.prf1 != 1) |
| 147 | + field = 108; // this line cannot be covered even with nondet-static |
| 148 | + |
| 149 | + if (PSInner.p1 != 0) |
| 150 | + field = 108; // this line can only be covered with nondet-static |
| 151 | + if (PSInner.p2 != 1) |
| 152 | + field = 108; // this line can only be covered with nondet-static |
| 153 | + if (PSInner.p3 != 2) |
| 154 | + field = 108; // this line can only be covered with nondet-static |
| 155 | + if (PSInner.p4 != 3) |
| 156 | + field = 108; // this line can only be covered with nondet-static |
| 157 | + if (!PSInner.p5.equals(5)) |
| 158 | + field = 108; // this line can only be covered with nondet-static |
| 159 | + |
| 160 | + if (PSInner.pf1 != 1) |
| 161 | + field = 108; // this line cannot be covered even with nondet-static |
| 162 | + if (PSInner.pf2 != 2) |
| 163 | + field = 108; // this line cannot be covered even with nondet-static |
| 164 | + if (PSInner.pf3 != 3) |
| 165 | + field = 108; // this line cannot be covered even with nondet-static |
| 166 | + if (!PSInner.pf4.equals(4)) |
| 167 | + field = 108; // this line cannot be covered even with nondet-static |
| 168 | + |
| 169 | + if (PSInner.pr1 != 0) |
| 170 | + field = 108; // this line can only be covered with nondet-static |
| 171 | + if (PSInner.pr2 != 1) |
| 172 | + field = 108; // this line can only be covered with nondet-static |
| 173 | + if (PSInner.pr3 != 2) |
| 174 | + field = 108; // this line can only be covered with nondet-static |
| 175 | + if (PSInner.pr4 != 3) |
| 176 | + field = 108; // this line can only be covered with nondet-static |
| 177 | + if (!PSInner.pr5.equals(5)) |
| 178 | + field = 108; // this line can only be covered with nondet-static |
| 179 | + |
| 180 | + if (PSInner.prf1 != 1) |
| 181 | + field = 108; // this line cannot be covered even with nondet-static |
| 182 | + if (PSInner.prf2 != 2) |
| 183 | + field = 108; // this line cannot be covered even with nondet-static |
| 184 | + if (PSInner.prf3 != 3) |
| 185 | + field = 108; // this line cannot be covered even with nondet-static |
| 186 | + if (!PSInner.prf4.equals(4)) |
| 187 | + field = 108; // this line cannot be covered even with nondet-static |
| 188 | + |
| 189 | + if (PrInner.pf1 != 1) |
| 190 | + field = 108; // this line cannot be covered even with nondet-static |
| 191 | + |
| 192 | + if (PrInner.prf1 != 1) |
| 193 | + field = 108; // this line cannot be covered even with nondet-static |
| 194 | + |
| 195 | + if (PrSInner.p1 != 0) |
| 196 | + field = 108; // this line can only be covered with nondet-static |
| 197 | + if (PrSInner.p2 != 1) |
| 198 | + field = 108; // this line can only be covered with nondet-static |
| 199 | + if (PrSInner.p3 != 2) |
| 200 | + field = 108; // this line can only be covered with nondet-static |
| 201 | + if (PrSInner.p4 != 3) |
| 202 | + field = 108; // this line can only be covered with nondet-static |
| 203 | + if (!PrSInner.p5.equals(5)) |
| 204 | + field = 108; // this line can only be covered with nondet-static |
| 205 | + |
| 206 | + if (PrSInner.pf1 != 1) |
| 207 | + field = 108; // this line cannot be covered even with nondet-static |
| 208 | + if (PrSInner.pf2 != 2) |
| 209 | + field = 108; // this line cannot be covered even with nondet-static |
| 210 | + if (PrSInner.pf3 != 3) |
| 211 | + field = 108; // this line cannot be covered even with nondet-static |
| 212 | + if (!PrSInner.pf4.equals(4)) |
| 213 | + field = 108; // this line cannot be covered even with nondet-static |
| 214 | + |
| 215 | + if (PrSInner.pr1 != 0) |
| 216 | + field = 108; // this line can only be covered with nondet-static |
| 217 | + if (PrSInner.pr2 != 1) |
| 218 | + field = 108; // this line can only be covered with nondet-static |
| 219 | + if (PrSInner.pr3 != 2) |
| 220 | + field = 108; // this line can only be covered with nondet-static |
| 221 | + if (PrSInner.pr4 != 3) |
| 222 | + field = 108; // this line can only be covered with nondet-static |
| 223 | + if (!PrSInner.pr5.equals(5)) |
| 224 | + field = 108; // this line can only be covered with nondet-static |
| 225 | + |
| 226 | + if (PrSInner.prf1 != 1) |
| 227 | + field = 108; // this line cannot be covered even with nondet-static |
| 228 | + if (PrSInner.prf2 != 2) |
| 229 | + field = 108; // this line cannot be covered even with nondet-static |
| 230 | + if (PrSInner.prf3 != 3) |
| 231 | + field = 108; // this line cannot be covered even with nondet-static |
| 232 | + if (!PSInner.prf4.equals(4)) |
| 233 | + field = 108; // this line cannot be covered even with nondet-static |
| 234 | + |
| 235 | + if (s != "bla") |
| 236 | + field = 108; // this line cannot be covered even with nondet-static |
| 237 | + } |
| 238 | +} |
0 commit comments