Lines 52-58
Link Here
|
52 |
// Static initializer to specify tests subset using TESTS_* static variables |
52 |
// Static initializer to specify tests subset using TESTS_* static variables |
53 |
// All specified tests which do not belong to the class are skipped... |
53 |
// All specified tests which do not belong to the class are skipped... |
54 |
static { |
54 |
static { |
55 |
// TESTS_NAMES = new String[] { "test_illegal_annotation_007" }; |
55 |
// TESTS_NAMES = new String[] { "test_assignment_expression_1" }; |
56 |
// TESTS_NUMBERS = new int[] { 561 }; |
56 |
// TESTS_NUMBERS = new int[] { 561 }; |
57 |
// TESTS_RANGE = new int[] { 1, 2049 }; |
57 |
// TESTS_RANGE = new int[] { 1, 2049 }; |
58 |
} |
58 |
} |
Lines 2474-2479
Link Here
|
2474 |
"Type mismatch: required \'@NonNull String\' but the provided value can be null\n" + |
2474 |
"Type mismatch: required \'@NonNull String\' but the provided value can be null\n" + |
2475 |
"----------\n"); |
2475 |
"----------\n"); |
2476 |
} |
2476 |
} |
|
|
2477 |
public void test_assignment_expression_1() { |
2478 |
Map customOptions = getCompilerOptions(); |
2479 |
// customOptions.put(CompilerOptions.OPTION_ReportPotentialNullSpecViolation, JavaCore.ERROR); |
2480 |
customOptions.put(JavaCore.COMPILER_NONNULL_IS_DEFAULT, JavaCore.ENABLED); |
2481 |
customOptions.put(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK, JavaCore.ERROR); |
2482 |
runConformTestWithLibs( |
2483 |
new String[] { |
2484 |
"X.java", |
2485 |
"import org.eclipse.jdt.annotation.*;\n" + |
2486 |
"public class X {\n" + |
2487 |
" @Nullable Object foo() {\n" + |
2488 |
" Object o = null;\n" + |
2489 |
" boolean keepLooking = true;\n" + |
2490 |
" while(keepLooking) {\n" + |
2491 |
" if ((o=getO()) != null) {\n" + |
2492 |
" return o;\n" + |
2493 |
" }\n" + |
2494 |
" }\n" + |
2495 |
" return null;\n" + |
2496 |
" }\n" + |
2497 |
"\n" + |
2498 |
" private @Nullable Object getO() {\n" + |
2499 |
" return new Object();\n" + |
2500 |
" }\n" + |
2501 |
"}\n", |
2502 |
|
2503 |
}, |
2504 |
customOptions, |
2505 |
""); |
2506 |
} |
2477 |
// a nonnull variable is dereferenced method of a nested type |
2507 |
// a nonnull variable is dereferenced method of a nested type |
2478 |
public void test_nesting_1() { |
2508 |
public void test_nesting_1() { |
2479 |
Map customOptions = getCompilerOptions(); |
2509 |
Map customOptions = getCompilerOptions(); |