View | Details | Raw Unified | Return to bug 192875 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/core/JavaCore.java (-1 / +1 lines)
Lines 2338-2344 Link Here
2338
	 *
2338
	 *
2339
	 *     - option id:         "org.eclipse.jdt.core.compiler.problem.potentialNullReference"
2339
	 *     - option id:         "org.eclipse.jdt.core.compiler.problem.potentialNullReference"
2340
	 *     - possible values:   { "error", "warning", "ignore" }
2340
	 *     - possible values:   { "error", "warning", "ignore" }
2341
	 *     - default:           "ignore"
2341
	 *     - default:           "warning"
2342
	 *
2342
	 *
2343
	 * COMPILER / Reporting Redundant Null Check
2343
	 * COMPILER / Reporting Redundant Null Check
2344
	 *    When enabled, the compiler will issue an error or a warning whenever a
2344
	 *    When enabled, the compiler will issue an error or a warning whenever a
(-)compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java (-1 / +1 lines)
Lines 239-245 Link Here
239
		| UnusedLocalVariable
239
		| UnusedLocalVariable
240
		| UnusedPrivateMember
240
		| UnusedPrivateMember
241
		| UnusedLabel
241
		| UnusedLabel
242
		/*| NullReference -- keep JavaCore#getDefaultOptions comment in sync */;
242
		| NullReference;
243
243
244
	// By default only lines and source attributes are generated.
244
	// By default only lines and source attributes are generated.
245
	public int produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES;
245
	public int produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES;
(-)src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java (-3 / +22 lines)
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;

Return to bug 192875