Lines 11-16
Link Here
|
11 |
package org.eclipse.jdt.core.tests.compiler.regression; |
11 |
package org.eclipse.jdt.core.tests.compiler.regression; |
12 |
|
12 |
|
13 |
import java.util.Map; |
13 |
import java.util.Map; |
|
|
14 |
|
14 |
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; |
15 |
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; |
15 |
import junit.framework.Test; |
16 |
import junit.framework.Test; |
16 |
|
17 |
|
Lines 75-81
Link Here
|
75 |
"Null pointer access: The variable o can only be null at this location\n" + |
76 |
"Null pointer access: The variable o can only be null at this location\n" + |
76 |
"----------\n"); |
77 |
"----------\n"); |
77 |
} |
78 |
} |
78 |
|
79 |
|
79 |
// null analysis -- simple case for field |
80 |
// null analysis -- simple case for field |
80 |
// the current design leaves fields out of the analysis altogether |
81 |
// the current design leaves fields out of the analysis altogether |
81 |
public void test0002_simple_field() { |
82 |
public void test0002_simple_field() { |
Lines 8625-8634
Link Here
|
8625 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=170704 |
8626 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=170704 |
8626 |
// adding distinct options to control null checks in more detail |
8627 |
// adding distinct options to control null checks in more detail |
8627 |
// default for null options is Ignore |
8628 |
// default for null options is Ignore |
|
|
8629 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=192875 |
8630 |
// changed default for null access to warning |
8628 |
public void test1050_options_all_default() { |
8631 |
public void test1050_options_all_default() { |
8629 |
try { |
8632 |
try { |
8630 |
setNullRelatedOptions = false; |
8633 |
setNullRelatedOptions = false; |
8631 |
this.runConformTest( |
8634 |
runTest( |
8632 |
new String[] { |
8635 |
new String[] { |
8633 |
"X.java", |
8636 |
"X.java", |
8634 |
"public class X {\n" + |
8637 |
"public class X {\n" + |
Lines 8641-8647
Link Here
|
8641 |
" o.toString();\n" + |
8644 |
" o.toString();\n" + |
8642 |
" p.toString();\n" + |
8645 |
" p.toString();\n" + |
8643 |
" }\n" + |
8646 |
" }\n" + |
8644 |
"}\n"}); |
8647 |
"}\n" |
|
|
8648 |
} /* testFiles */, |
8649 |
false /* expectingCompilerErrors */, |
8650 |
"----------\n" + |
8651 |
"1. WARNING in X.java (at line 8)\n" + |
8652 |
" o.toString();\n" + |
8653 |
" ^\n" + |
8654 |
"Null pointer access: The variable o can only be null at this location\n" + |
8655 |
"----------\n" /* expectedCompilerLog */, |
8656 |
"" /* expectedOutputString */, |
8657 |
false /* forceExecution */, |
8658 |
null /* classLib */, |
8659 |
true /* shouldFlushOutputDirectory */, |
8660 |
null /* vmArguments */, |
8661 |
null /* customOptions */, |
8662 |
null /* clientRequestor */, |
8663 |
false /* skipJavac */); |
8645 |
} |
8664 |
} |
8646 |
finally { |
8665 |
finally { |
8647 |
setNullRelatedOptions = true; |
8666 |
setNullRelatedOptions = true; |