|
Lines 49-55
public NullReferenceTest(String name) {
Link Here
|
| 49 |
// Only the highest compliance level is run; add the VM argument |
49 |
// Only the highest compliance level is run; add the VM argument |
| 50 |
// -Dcompliance=1.4 (for example) to lower it if needed |
50 |
// -Dcompliance=1.4 (for example) to lower it if needed |
| 51 |
static { |
51 |
static { |
| 52 |
// TESTS_NAMES = new String[] { "testBug247564i" }; |
52 |
// TESTS_NAMES = new String[] { "testBug247564j" }; |
| 53 |
// TESTS_NUMBERS = new int[] { 561 }; |
53 |
// TESTS_NUMBERS = new int[] { 561 }; |
| 54 |
// TESTS_RANGE = new int[] { 1, 2049 }; |
54 |
// TESTS_RANGE = new int[] { 1, 2049 }; |
| 55 |
} |
55 |
} |
|
Lines 16373-16376
public void testBug247564i_5() {
Link Here
|
| 16373 |
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError |
16373 |
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError |
| 16374 |
); |
16374 |
); |
| 16375 |
} |
16375 |
} |
|
|
16376 |
// null analysis -- simple case for field for inner class |
| 16377 |
// regression? |
| 16378 |
public void testBug247564j() { |
| 16379 |
this.runNegativeTest( |
| 16380 |
new String[] { |
| 16381 |
"Z.java", |
| 16382 |
"public class Z {\n" + |
| 16383 |
" final int field1 = 0;\n" + |
| 16384 |
" {\n" + |
| 16385 |
" class ZInner {\n" + |
| 16386 |
" final int fieldz1;\n" + |
| 16387 |
" final int fieldz2 = 0;\n" + |
| 16388 |
" }\n" + |
| 16389 |
" }\n" + |
| 16390 |
"}\n"}, |
| 16391 |
"----------\n" + |
| 16392 |
"1. WARNING in Z.java (at line 4)\n" + |
| 16393 |
" class ZInner {\n" + |
| 16394 |
" ^^^^^^\n" + |
| 16395 |
"The type ZInner is never used locally\n" + |
| 16396 |
"----------\n" + |
| 16397 |
"2. ERROR in Z.java (at line 4)\n" + |
| 16398 |
" class ZInner {\n" + |
| 16399 |
" ^^^^^^\n" + |
| 16400 |
"The blank final field fieldz1 may not have been initialized\n" + |
| 16401 |
"----------\n" + |
| 16402 |
"3. WARNING in Z.java (at line 5)\n" + |
| 16403 |
" final int fieldz1;\n" + |
| 16404 |
" ^^^^^^^\n" + |
| 16405 |
"The value of the field ZInner.fieldz1 is not used\n" + |
| 16406 |
"----------\n" + |
| 16407 |
"4. WARNING in Z.java (at line 6)\n" + |
| 16408 |
" final int fieldz2 = 0;\n" + |
| 16409 |
" ^^^^^^^\n" + |
| 16410 |
"The value of the field ZInner.fieldz2 is not used\n" + |
| 16411 |
"----------\n" |
| 16412 |
); |
| 16413 |
} |
| 16376 |
} |
16414 |
} |