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

Collapse All | Expand All

(-)src/org/eclipse/jdt/internal/compiler/tool/Options.java (-1 / +1 lines)
Lines 168-173 Link Here
168
						|| token.equals("forbidden")//$NON-NLS-1$
168
						|| token.equals("forbidden")//$NON-NLS-1$
169
						|| token.equals("hashCode")//$NON-NLS-1$
169
						|| token.equals("hashCode")//$NON-NLS-1$
170
						|| token.equals("hiding")//$NON-NLS-1$
170
						|| token.equals("hiding")//$NON-NLS-1$
171
						|| token.equals("includeAssertNull")//$NON-NLS-1$
171
						|| token.equals("incomplete-switch")//$NON-NLS-1$
172
						|| token.equals("incomplete-switch")//$NON-NLS-1$
172
						|| token.equals("indirectStatic")//$NON-NLS-1$
173
						|| token.equals("indirectStatic")//$NON-NLS-1$
173
						|| token.equals("interfaceNonInherited")//$NON-NLS-1$
174
						|| token.equals("interfaceNonInherited")//$NON-NLS-1$
Lines 195-201 Link Here
195
						|| token.equals("staticReceiver")//$NON-NLS-1$
196
						|| token.equals("staticReceiver")//$NON-NLS-1$
196
						|| token.equals("super")//$NON-NLS-1$
197
						|| token.equals("super")//$NON-NLS-1$
197
						|| token.equals("suppress")//$NON-NLS-1$
198
						|| token.equals("suppress")//$NON-NLS-1$
198
						|| token.equals("suppressAssertNull")//$NON-NLS-1$
199
						|| token.equals("syncOverride")//$NON-NLS-1$
199
						|| token.equals("syncOverride")//$NON-NLS-1$
200
						|| token.equals("synthetic-access")//$NON-NLS-1$
200
						|| token.equals("synthetic-access")//$NON-NLS-1$
201
						|| token.equals("syntheticAccess")//$NON-NLS-1$
201
						|| token.equals("syntheticAccess")//$NON-NLS-1$
(-)batch/org/eclipse/jdt/internal/compiler/batch/Main.java (-7 / +7 lines)
Lines 3333-3339 Link Here
3333
			} else if (token.equals("intfRedundant") /*|| token.equals("redundantSuperinterface")*/) { //$NON-NLS-1$
3333
			} else if (token.equals("intfRedundant") /*|| token.equals("redundantSuperinterface")*/) { //$NON-NLS-1$
3334
				setSeverity(CompilerOptions.OPTION_ReportRedundantSuperinterface, severity, isEnabling);
3334
				setSeverity(CompilerOptions.OPTION_ReportRedundantSuperinterface, severity, isEnabling);
3335
				return;
3335
				return;
3336
			}
3336
			} else if (token.equals("includeAssertNull")) { //$NON-NLS-1$
3337
				this.options.put(
3338
						CompilerOptions.OPTION_IncludeNullInfoFromAsserts,
3339
						isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
3340
				return;
3341
			} 
3337
			break;
3342
			break;
3338
		case 'j' :
3343
		case 'j' :
3339
			if (token.equals("javadoc")) {//$NON-NLS-1$
3344
			if (token.equals("javadoc")) {//$NON-NLS-1$
Lines 3456-3467 Link Here
3456
			} else if (token.equals("super")) { //$NON-NLS-1$
3461
			} else if (token.equals("super")) { //$NON-NLS-1$
3457
				setSeverity(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, severity, isEnabling);
3462
				setSeverity(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, severity, isEnabling);
3458
				return;
3463
				return;
3459
			} else if (token.equals("suppressAssertNull")) { //$NON-NLS-1$
3464
			}
3460
				this.options.put(
3461
						CompilerOptions.OPTION_SuppressNullInfoFromAsserts,
3462
						isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
3463
				return;
3464
			} 
3465
			break;
3465
			break;
3466
		case 't' :
3466
		case 't' :
3467
			if (token.startsWith("tasks")) { //$NON-NLS-1$
3467
			if (token.startsWith("tasks")) { //$NON-NLS-1$
(-)batch/org/eclipse/jdt/internal/compiler/batch/messages.properties (-2 / +3 lines)
Lines 288-293 Link Here
288
\      hashCode              missing hashCode() method when overriding equals()\n\
288
\      hashCode              missing hashCode() method when overriding equals()\n\
289
\      hiding               macro for fieldHiding, localHiding, typeHiding and\n\
289
\      hiding               macro for fieldHiding, localHiding, typeHiding and\n\
290
\                           maskedCatchBlock\n\
290
\                           maskedCatchBlock\n\
291
\	   includeAssertNull    raise null warnings for variables\n\
292
\							that got tainted in an assert expression\n\
291
\      incomplete-switch    same as enumSwitch\n\
293
\      incomplete-switch    same as enumSwitch\n\
292
\      indirectStatic       indirect reference to static member\n\
294
\      indirectStatic       indirect reference to static member\n\
293
\      intfAnnotation     + annotation type used as super interface\n\
295
\      intfAnnotation     + annotation type used as super interface\n\
Lines 313-320 Link Here
313
\      suppress           + enable @SuppressWarnings\n\
315
\      suppress           + enable @SuppressWarnings\n\
314
\                           When used with -err:, it can also silent optional\n\
316
\                           When used with -err:, it can also silent optional\n\
315
\                           errors and warnings\n\
317
\                           errors and warnings\n\
316
\	   suppressAssertNull   suppress null warnings for variables\n\
318
317
\							that got tainted in an assert expression\n\
318
\      syncOverride         missing synchronized in synchr. method override\n\
319
\      syncOverride         missing synchronized in synchr. method override\n\
319
\      syntheticAccess      synthetic access for innerclass\n\
320
\      syntheticAccess      synthetic access for innerclass\n\
320
\      tasks(<tags separated by |>) tasks identified by tags inside comments\n\
321
\      tasks(<tags separated by |>) tasks identified by tags inside comments\n\
(-)compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java (-2 / +2 lines)
Lines 84-92 Link Here
84
		// expression downstream
84
		// expression downstream
85
	} else {
85
	} else {
86
		CompilerOptions compilerOptions = currentScope.compilerOptions();
86
		CompilerOptions compilerOptions = currentScope.compilerOptions();
87
		if (compilerOptions.suppressNullInfoFromAsserts) {
87
		if (!compilerOptions.includeNullInfoFromAsserts) {
88
			// keep just the initializations info, don't include assert's null info
88
			// keep just the initializations info, don't include assert's null info
89
			return flowInfo.mergedWith(assertInfo.nullInfoLessUnconditionalCopy());
89
			return flowInfo.addInitializationsFrom(assertInfo.nullInfoLessUnconditionalCopy());
90
		}
90
		}
91
		return flowInfo.mergedWith(assertInfo.nullInfoLessUnconditionalCopy()).
91
		return flowInfo.mergedWith(assertInfo.nullInfoLessUnconditionalCopy()).
92
			addInitializationsFrom(assertWhenTrueInfo.discardInitializationInfo());
92
			addInitializationsFrom(assertWhenTrueInfo.discardInitializationInfo());
(-)compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java (+3 lines)
Lines 1466-1471 Link Here
1466
				throw new AssertionFailedException("COVERAGE 28"); //$NON-NLS-1$
1466
				throw new AssertionFailedException("COVERAGE 28"); //$NON-NLS-1$
1467
			}
1467
			}
1468
		}
1468
		}
1469
		combineNullStatusChangeInAssertInfo(otherInits);
1469
		return this;
1470
		return this;
1470
	}
1471
	}
1471
	if ((this.tagBits & UNREACHABLE) != 0) {
1472
	if ((this.tagBits & UNREACHABLE) != 0) {
Lines 1474-1479 Link Here
1474
				throw new AssertionFailedException("COVERAGE 29"); //$NON-NLS-1$
1475
				throw new AssertionFailedException("COVERAGE 29"); //$NON-NLS-1$
1475
			}
1476
			}
1476
		}
1477
		}
1478
		otherInits.combineNullStatusChangeInAssertInfo(this);
1477
		return (UnconditionalFlowInfo) otherInits.copy(); // make sure otherInits won't be affected
1479
		return (UnconditionalFlowInfo) otherInits.copy(); // make sure otherInits won't be affected
1478
	}
1480
	}
1479
1481
Lines 1761-1766 Link Here
1761
	copy.potentialInits = this.potentialInits;
1763
	copy.potentialInits = this.potentialInits;
1762
	copy.tagBits = this.tagBits & ~NULL_FLAG_MASK;
1764
	copy.tagBits = this.tagBits & ~NULL_FLAG_MASK;
1763
	copy.maxFieldCount = this.maxFieldCount;
1765
	copy.maxFieldCount = this.maxFieldCount;
1766
	copy.nullStatusChangedInAssert = this.nullStatusChangedInAssert;
1764
	if (this.extra != null) {
1767
	if (this.extra != null) {
1765
		int length;
1768
		int length;
1766
		copy.extra = new long[extraLength][];
1769
		copy.extra = new long[extraLength][];
(-)compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java (-9 / +9 lines)
Lines 131-137 Link Here
131
	public static final String OPTION_ReportDeadCodeInTrivialIfStatement =  "org.eclipse.jdt.core.compiler.problem.deadCodeInTrivialIfStatement"; //$NON-NLS-1$
131
	public static final String OPTION_ReportDeadCodeInTrivialIfStatement =  "org.eclipse.jdt.core.compiler.problem.deadCodeInTrivialIfStatement"; //$NON-NLS-1$
132
	public static final String OPTION_ReportTasks = "org.eclipse.jdt.core.compiler.problem.tasks"; //$NON-NLS-1$
132
	public static final String OPTION_ReportTasks = "org.eclipse.jdt.core.compiler.problem.tasks"; //$NON-NLS-1$
133
	public static final String OPTION_ReportUnusedObjectAllocation = "org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation";  //$NON-NLS-1$
133
	public static final String OPTION_ReportUnusedObjectAllocation = "org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation";  //$NON-NLS-1$
134
	public static final String OPTION_SuppressNullInfoFromAsserts = "org.eclipse.jdt.core.compiler.problem.suppressNullInfoFromAsserts";  //$NON-NLS-1$
134
	public static final String OPTION_IncludeNullInfoFromAsserts = "org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts";  //$NON-NLS-1$
135
	// Backward compatibility
135
	// Backward compatibility
136
	public static final String OPTION_ReportInvalidAnnotation = "org.eclipse.jdt.core.compiler.problem.invalidAnnotation"; //$NON-NLS-1$
136
	public static final String OPTION_ReportInvalidAnnotation = "org.eclipse.jdt.core.compiler.problem.invalidAnnotation"; //$NON-NLS-1$
137
	public static final String OPTION_ReportMissingAnnotation = "org.eclipse.jdt.core.compiler.problem.missingAnnotation"; //$NON-NLS-1$
137
	public static final String OPTION_ReportMissingAnnotation = "org.eclipse.jdt.core.compiler.problem.missingAnnotation"; //$NON-NLS-1$
Lines 352-359 Link Here
352
	public boolean generateClassFiles;
352
	public boolean generateClassFiles;
353
	/** Indicate if method bodies should be ignored */
353
	/** Indicate if method bodies should be ignored */
354
	public boolean ignoreMethodBodies;
354
	public boolean ignoreMethodBodies;
355
	/** Suppress null related warnings for variables tainted inside an assert statement (java 1.5 and above)*/
355
	/** Raise null related warnings for variables tainted inside an assert statement (java 1.5 and above)*/
356
	public boolean suppressNullInfoFromAsserts;
356
	public boolean includeNullInfoFromAsserts;
357
357
358
	// keep in sync with warningTokenToIrritant and warningTokenFromIrritant
358
	// keep in sync with warningTokenToIrritant and warningTokenFromIrritant
359
	public final static String[] warningTokens = {
359
	public final static String[] warningTokens = {
Lines 916-922 Link Here
916
		optionsMap.put(OPTION_ReportDeadCodeInTrivialIfStatement, this.reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED);
916
		optionsMap.put(OPTION_ReportDeadCodeInTrivialIfStatement, this.reportDeadCodeInTrivialIfStatement ? ENABLED : DISABLED);
917
		optionsMap.put(OPTION_ReportTasks, getSeverityString(Tasks));
917
		optionsMap.put(OPTION_ReportTasks, getSeverityString(Tasks));
918
		optionsMap.put(OPTION_ReportUnusedObjectAllocation, getSeverityString(UnusedObjectAllocation));
918
		optionsMap.put(OPTION_ReportUnusedObjectAllocation, getSeverityString(UnusedObjectAllocation));
919
		optionsMap.put(OPTION_SuppressNullInfoFromAsserts, this.suppressNullInfoFromAsserts ? ENABLED : DISABLED);
919
		optionsMap.put(OPTION_IncludeNullInfoFromAsserts, this.includeNullInfoFromAsserts ? ENABLED : DISABLED);
920
		return optionsMap;
920
		return optionsMap;
921
	}
921
	}
922
922
Lines 1063-1069 Link Here
1063
		this.ignoreMethodBodies = false;
1063
		this.ignoreMethodBodies = false;
1064
		
1064
		
1065
		// allow null info from asserts to be considered downstream by default
1065
		// allow null info from asserts to be considered downstream by default
1066
		this.suppressNullInfoFromAsserts = false;
1066
		this.includeNullInfoFromAsserts = false;
1067
	}
1067
	}
1068
1068
1069
	public void set(Map optionsMap) {
1069
	public void set(Map optionsMap) {
Lines 1270-1280 Link Here
1270
				this.reportMissingOverrideAnnotationForInterfaceMethodImplementation = false;
1270
				this.reportMissingOverrideAnnotationForInterfaceMethodImplementation = false;
1271
			}
1271
			}
1272
		}
1272
		}
1273
		if ((optionValue = optionsMap.get(OPTION_SuppressNullInfoFromAsserts)) != null) {
1273
		if ((optionValue = optionsMap.get(OPTION_IncludeNullInfoFromAsserts)) != null) {
1274
			if (ENABLED.equals(optionValue)) {
1274
			if (ENABLED.equals(optionValue)) {
1275
				this.suppressNullInfoFromAsserts = true;
1275
				this.includeNullInfoFromAsserts = true;
1276
			} else if (DISABLED.equals(optionValue)) {
1276
			} else if (DISABLED.equals(optionValue)) {
1277
				this.suppressNullInfoFromAsserts = false;
1277
				this.includeNullInfoFromAsserts = false;
1278
			}
1278
			}
1279
		}
1279
		}
1280
		if ((optionValue = optionsMap.get(OPTION_ReportMethodWithConstructorName)) != null) updateSeverity(MethodWithConstructorName, optionValue);
1280
		if ((optionValue = optionsMap.get(OPTION_ReportMethodWithConstructorName)) != null) updateSeverity(MethodWithConstructorName, optionValue);
Lines 1519-1525 Link Here
1519
		buf.append("\n\t- missing @Override annotation for interface method implementation: ").append(this.reportMissingOverrideAnnotationForInterfaceMethodImplementation ? ENABLED : DISABLED); //$NON-NLS-1$
1519
		buf.append("\n\t- missing @Override annotation for interface method implementation: ").append(this.reportMissingOverrideAnnotationForInterfaceMethodImplementation ? ENABLED : DISABLED); //$NON-NLS-1$
1520
		buf.append("\n\t- missing @Deprecated annotation: ").append(getSeverityString(MissingDeprecatedAnnotation)); //$NON-NLS-1$
1520
		buf.append("\n\t- missing @Deprecated annotation: ").append(getSeverityString(MissingDeprecatedAnnotation)); //$NON-NLS-1$
1521
		buf.append("\n\t- incomplete enum switch: ").append(getSeverityString(IncompleteEnumSwitch)); //$NON-NLS-1$
1521
		buf.append("\n\t- incomplete enum switch: ").append(getSeverityString(IncompleteEnumSwitch)); //$NON-NLS-1$
1522
		buf.append("\n\t- suppress null related warnings for variables tainted in assert statements: ").append(this.suppressNullInfoFromAsserts ? ENABLED : DISABLED); //$NON-NLS-1$
1522
		buf.append("\n\t- raise null related warnings for variables tainted in assert statements: ").append(this.includeNullInfoFromAsserts ? ENABLED : DISABLED); //$NON-NLS-1$
1523
		buf.append("\n\t- suppress warnings: ").append(this.suppressWarnings ? ENABLED : DISABLED); //$NON-NLS-1$
1523
		buf.append("\n\t- suppress warnings: ").append(this.suppressWarnings ? ENABLED : DISABLED); //$NON-NLS-1$
1524
		buf.append("\n\t- suppress optional errors: ").append(this.suppressOptionalErrors ? ENABLED : DISABLED); //$NON-NLS-1$
1524
		buf.append("\n\t- suppress optional errors: ").append(this.suppressOptionalErrors ? ENABLED : DISABLED); //$NON-NLS-1$
1525
		buf.append("\n\t- unhandled warning token: ").append(getSeverityString(UnhandledWarningToken)); //$NON-NLS-1$
1525
		buf.append("\n\t- unhandled warning token: ").append(getSeverityString(UnhandledWarningToken)); //$NON-NLS-1$
(-)model/org/eclipse/jdt/core/JavaCore.java (-6 / +12 lines)
Lines 1427-1446 Link Here
1427
	 */
1427
	 */
1428
	public static final String COMPILER_PB_SUPPRESS_WARNINGS = PLUGIN_ID + ".compiler.problem.suppressWarnings"; //$NON-NLS-1$
1428
	public static final String COMPILER_PB_SUPPRESS_WARNINGS = PLUGIN_ID + ".compiler.problem.suppressWarnings"; //$NON-NLS-1$
1429
	/**
1429
	/**
1430
	 * Compiler option ID: Suppress null related warnings arising because of assert statements.
1430
	 * Compiler option ID: Suppress null related errors/warnings arising because of assert statements.
1431
	 * <p>When enabled, the compiler will not flag null warnings on variables that got marked as maybe or definitely
1431
	 * <p>When enabled, the compiler will not flag null errors/warnings on variables that got marked as maybe or definitely
1432
	 *  <code>null</code> in an assert statement upstream.</p>
1432
	 *  <code>null</code> in an assert statement upstream.</p>
1433
	 * <p>When disabled, the compiler will flag all null related warnings that have been enabled by the user,
1433
	 * <p>When disabled, the compiler will flag all null related errors/warnings that have been enabled by the user,
1434
	 *    irrespective of whether a variable occurred in an assert statement.</p>
1434
	 *    irrespective of whether a variable occurred in an assert statement.</p>
1435
	 * <dl>
1435
	 * <dl>
1436
	 * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.suppressNullInfoFromAsserts"</code></dd>
1436
	 * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts"</code></dd>
1437
	 * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd>
1437
	 * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd>
1438
	 * <dt>Default:</dt><dd><code>"disabled"</code></dd>
1438
	 * <dt>Default:</dt><dd><code>"disabled"</code></dd>
1439
	 * </dl>
1439
	 * </dl>
1440
	 * @since 3.7
1440
	 * @since 3.7
1441
	 * @category CompilerOptionID
1441
	 * @category CompilerOptionID
1442
	 */
1442
	 */
1443
	public static final String COMPILER_PB_SUPPRESS_NULL_INFO_ASSERTS = PLUGIN_ID + ".compiler.problem.suppressNullInfoFromAsserts"; //$NON-NLS-1$
1443
	public static final String COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS = PLUGIN_ID + ".compiler.problem.includeNullInfoFromAsserts"; //$NON-NLS-1$
1444
	/**
1444
	/**
1445
	 * Compiler option ID: Further Determining the Effect of <code>@SuppressWarnings</code> if also
1445
	 * Compiler option ID: Further Determining the Effect of <code>@SuppressWarnings</code> if also
1446
	 * {@link #COMPILER_PB_SUPPRESS_WARNINGS} is enabled.
1446
	 * {@link #COMPILER_PB_SUPPRESS_WARNINGS} is enabled.
Lines 1488-1494 Link Here
1488
	 * Compiler option ID: Reporting Null Dereference.
1488
	 * Compiler option ID: Reporting Null Dereference.
1489
	 * <p>When enabled, the compiler will issue an error or a warning whenever a
1489
	 * <p>When enabled, the compiler will issue an error or a warning whenever a
1490
	 *    variable that is statically known to hold a null value is used to
1490
	 *    variable that is statically known to hold a null value is used to
1491
	 *    access a field or method.
1491
	 *    access a field or method.</p>
1492
	 * <p>This diagnostic is further tuned in the presence of assert statements
1493
	 *    by the option {@link #COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS}
1492
	 * <dl>
1494
	 * <dl>
1493
	 * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nullReference"</code></dd>
1495
	 * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nullReference"</code></dd>
1494
	 * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd>
1496
	 * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd>
Lines 1504-1509 Link Here
1504
	 *    variable that has formerly been tested against null but is not (no more)
1506
	 *    variable that has formerly been tested against null but is not (no more)
1505
	 *    statically known to hold a non-null value is used to access a field or
1507
	 *    statically known to hold a non-null value is used to access a field or
1506
	 *    method.
1508
	 *    method.
1509
	* <p>This diagnostic is further tuned in the presence of assert statements
1510
	 *    by the option {@link #COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS}
1507
	 * <dl>
1511
	 * <dl>
1508
	 * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.potentialNullReference"</code></dd>
1512
	 * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.potentialNullReference"</code></dd>
1509
	 * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd>
1513
	 * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd>
Lines 1518-1523 Link Here
1518
	 * <p>When enabled, the compiler will issue an error or a warning whenever a
1522
	 * <p>When enabled, the compiler will issue an error or a warning whenever a
1519
	 *    variable that is statically known to hold a null or a non-null value
1523
	 *    variable that is statically known to hold a null or a non-null value
1520
	 *    is tested against null.
1524
	 *    is tested against null.
1525
	 * <p>This diagnostic is further tuned in the presence of assert statements
1526
	 *    by the option {@link #COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS}
1521
	 * <dl>
1527
	 * <dl>
1522
	 * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.redundantNullCheck"</code></dd>
1528
	 * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.redundantNullCheck"</code></dd>
1523
	 * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd>
1529
	 * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd>
(-)src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (-82 / +78 lines)
Lines 1652-1737 Link Here
1652
        "{0} {1}\n" +
1652
        "{0} {1}\n" +
1653
        "{2}\n" +
1653
        "{2}\n" +
1654
        " \n" +
1654
        " \n" +
1655
        " Warning options:\n" +
1655
        " Warning options:\n" + 
1656
        "    -deprecation         + deprecation outside deprecated code\n" +
1656
        "    -deprecation         + deprecation outside deprecated code\n" + 
1657
        "    -nowarn -warn:none disable all warnings\n" +
1657
        "    -nowarn -warn:none disable all warnings\n" + 
1658
        "    -warn:<warnings separated by ,>    enable exactly the listed warnings\n" +
1658
        "    -warn:<warnings separated by ,>    enable exactly the listed warnings\n" + 
1659
        "    -warn:+<warnings separated by ,>   enable additional warnings\n" +
1659
        "    -warn:+<warnings separated by ,>   enable additional warnings\n" + 
1660
        "    -warn:-<warnings separated by ,>   disable specific warnings\n" +
1660
        "    -warn:-<warnings separated by ,>   disable specific warnings\n" + 
1661
        "      allDeadCode          dead code including trivial if(DEBUG) check\n" +
1661
        "      allDeadCode          dead code including trivial if(DEBUG) check\n" + 
1662
        "      allDeprecation       deprecation including inside deprecated code\n" +
1662
        "      allDeprecation       deprecation including inside deprecated code\n" + 
1663
        "      allJavadoc           invalid or missing javadoc\n" +
1663
        "      allJavadoc           invalid or missing javadoc\n" + 
1664
        "      allOver-ann          all missing @Override annotations\n" +
1664
        "      allOver-ann          all missing @Override annotations\n" + 
1665
        "      assertIdentifier   + ''assert'' used as identifier\n" +
1665
        "      assertIdentifier   + ''assert'' used as identifier\n" + 
1666
        "      boxing               autoboxing conversion\n" +
1666
        "      boxing               autoboxing conversion\n" + 
1667
        "      charConcat         + char[] in String concat\n" +
1667
        "      charConcat         + char[] in String concat\n" + 
1668
        "      compareIdentical   + comparing identical expressions\n" +
1668
        "      compareIdentical   + comparing identical expressions\n" + 
1669
        "      conditionAssign      possible accidental boolean assignment\n" +
1669
        "      conditionAssign      possible accidental boolean assignment\n" + 
1670
        "      constructorName    + method with constructor name\n" +
1670
        "      constructorName    + method with constructor name\n" + 
1671
        "      deadCode           + dead code excluding trivial if (DEBUG) check\n" +
1671
        "      deadCode           + dead code excluding trivial if (DEBUG) check\n" + 
1672
        "      dep-ann              missing @Deprecated annotation\n" +
1672
        "      dep-ann              missing @Deprecated annotation\n" + 
1673
        "      deprecation        + deprecation outside deprecated code\n" +
1673
        "      deprecation        + deprecation outside deprecated code\n" + 
1674
        "      discouraged        + use of types matching a discouraged access rule\n" +
1674
        "      discouraged        + use of types matching a discouraged access rule\n" + 
1675
        "      emptyBlock           undocumented empty block\n" +
1675
        "      emptyBlock           undocumented empty block\n" + 
1676
        "      enumIdentifier       ''enum'' used as identifier\n" + 
1676
        "      enumIdentifier       ''enum'' used as identifier\n" + 
1677
        "      enumSwitch           incomplete enum switch\n" +
1677
        "      enumSwitch           incomplete enum switch\n" + 
1678
        "      fallthrough          possible fall-through case\n" +
1678
        "      fallthrough          possible fall-through case\n" + 
1679
        "      fieldHiding          field hiding another variable\n" +
1679
        "      fieldHiding          field hiding another variable\n" + 
1680
        "      finalBound           type parameter with final bound\n" +
1680
        "      finalBound           type parameter with final bound\n" + 
1681
        "      finally            + finally block not completing normally\n" +
1681
        "      finally            + finally block not completing normally\n" + 
1682
        "      forbidden          + use of types matching a forbidden access rule\n" +
1682
        "      forbidden          + use of types matching a forbidden access rule\n" + 
1683
        "      hashCode              missing hashCode() method when overriding equals()\n" + 
1683
        "      hashCode              missing hashCode() method when overriding equals()\n" + 
1684
        "      hiding               macro for fieldHiding, localHiding, typeHiding and\n" +
1684
        "      hiding               macro for fieldHiding, localHiding, typeHiding and\n" + 
1685
        "                           maskedCatchBlock\n" +
1685
        "                           maskedCatchBlock\n" + 
1686
        "      incomplete-switch    same as enumSwitch\n" +
1686
        "	   includeAssertNull    raise null warnings for variables\n" + 
1687
        "      indirectStatic       indirect reference to static member\n" +
1687
        "							that got tainted in an assert expression\n" + 
1688
        "      intfAnnotation     + annotation type used as super interface\n" +
1688
        "      incomplete-switch    same as enumSwitch\n" + 
1689
        "      intfNonInherited   + interface non-inherited method compatibility\n" +
1689
        "      indirectStatic       indirect reference to static member\n" + 
1690
        "      intfAnnotation     + annotation type used as super interface\n" + 
1691
        "      intfNonInherited   + interface non-inherited method compatibility\n" + 
1690
        "      intfRedundant        find redundant superinterfaces\n" + 
1692
        "      intfRedundant        find redundant superinterfaces\n" + 
1691
        "      javadoc              invalid javadoc\n" +
1693
        "      javadoc              invalid javadoc\n" + 
1692
        "      localHiding          local variable hiding another variable\n" +
1694
        "      localHiding          local variable hiding another variable\n" + 
1693
        "      maskedCatchBlock   + hidden catch block\n" +
1695
        "      maskedCatchBlock   + hidden catch block\n" + 
1694
        "      nls                  string literal lacking non-nls tag //$NON-NLS-<n>$\n" +
1696
        "      nls                  string literal lacking non-nls tag //$NON-NLS-<n>$\n" + 
1695
        "      noEffectAssign     + assignment without effect\n" +
1697
        "      noEffectAssign     + assignment without effect\n" + 
1696
        "      null                 potential missing or redundant null check\n" +
1698
        "      null                 potential missing or redundant null check\n" + 
1697
        "      nullDereference    + missing null check\n" +
1699
        "      nullDereference    + missing null check\n" + 
1698
        "      over-ann             missing @Override annotation (superclass)\n" +
1700
        "      over-ann             missing @Override annotation (superclass)\n" + 
1699
        "      paramAssign          assignment to a parameter\n" +
1701
        "      paramAssign          assignment to a parameter\n" + 
1700
        "      pkgDefaultMethod   + attempt to override package-default method\n" +
1702
        "      pkgDefaultMethod   + attempt to override package-default method\n" + 
1701
        "      raw                + usage of raw type\n" +
1703
        "      raw                + usage of raw type\n" + 
1702
        "      semicolon            unnecessary semicolon, empty statement\n" +
1704
        "      semicolon            unnecessary semicolon, empty statement\n" + 
1703
        "      serial             + missing serialVersionUID\n" +
1705
        "      serial             + missing serialVersionUID\n" + 
1704
        "      specialParamHiding   constructor or setter parameter hiding a field\n" +
1706
        "      specialParamHiding   constructor or setter parameter hiding a field\n" + 
1705
        "      static-access        macro for indirectStatic and staticReceiver\n" +
1707
        "      static-access        macro for indirectStatic and staticReceiver\n" + 
1706
        "      staticReceiver     + non-static reference to static member\n" +
1708
        "      staticReceiver     + non-static reference to static member\n" + 
1707
        "      super                overriding a method without making a super invocation\n" +
1709
        "      super                overriding a method without making a super invocation\n" + 
1708
        "      suppress           + enable @SuppressWarnings\n" + 
1710
        "      suppress           + enable @SuppressWarnings\n" + 
1709
        "                           When used with -err:, it can also silent optional\n" +
1711
        "                           When used with -err:, it can also silent optional\n" + 
1710
        "                           errors and warnings\n" +
1712
        "                           errors and warnings\n" + 
1711
        "	   suppressAssertNull   suppress null warnings for variables\n" +
1713
        "\n";
1712
        "							that got tainted in an assert expression\n" +
1713
        "      syncOverride         missing synchronized in synchr. method override\n" +
1714
        "      syntheticAccess      synthetic access for innerclass\n" +
1715
        "      tasks(<tags separated by |>) tasks identified by tags inside comments\n" +
1716
        "      typeHiding         + type parameter hiding another type\n" +
1717
        "      unchecked          + unchecked type operation\n" +
1718
        "      unnecessaryElse      unnecessary else clause\n" +
1719
        "      unqualifiedField     unqualified reference to field\n" +
1720
        "      unused               macro for unusedAllocation, unusedArgument,\n" +
1721
        "                               unusedImport, unusedLabel, unusedLocal,\n" +
1722
        "                               unusedPrivate, unusedThrown, and unusedTypeArgs\n" +
1723
        "      unusedAllocation     allocating an object that is not used\n" +
1724
        "      unusedArgument       unread method parameter\n" +
1725
        "      unusedImport       + unused import declaration\n" +
1726
        "      unusedLabel        + unused label\n" +
1727
        "      unusedLocal        + unread local variable\n" +
1728
        "      unusedPrivate      + unused private member declaration\n" +
1729
        "      unusedThrown         unused declared thrown exception\n" +
1730
        "      unusedTypeArgs     + unused type arguments for method\n" +
1731
        "      uselessTypeCheck     unnecessary cast/instanceof operation\n" +
1732
        "      varargsCast        + varargs argument need explicit cast\n" +
1733
        "      warningToken       + unsupported or unnecessary @SuppressWarnings\n" +
1734
		"\n";
1735
	String expandedExpectedOutput =
1714
	String expandedExpectedOutput =
1736
		MessageFormat.format(expectedOutput, new String[] {
1715
		MessageFormat.format(expectedOutput, new String[] {
1737
				MAIN.bind("compiler.name"),
1716
				MAIN.bind("compiler.name"),
Lines 1819-1824 Link Here
1819
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally\" value=\"warning\"/>\n" + 
1798
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally\" value=\"warning\"/>\n" + 
1820
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.forbiddenReference\" value=\"warning\"/>\n" + 
1799
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.forbiddenReference\" value=\"warning\"/>\n" + 
1821
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock\" value=\"warning\"/>\n" + 
1800
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock\" value=\"warning\"/>\n" + 
1801
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts\" value=\"disabled\"/>\n" + 
1822
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod\" value=\"warning\"/>\n" + 
1802
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod\" value=\"warning\"/>\n" + 
1823
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch\" value=\"ignore\"/>\n" + 
1803
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch\" value=\"ignore\"/>\n" + 
1824
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess\" value=\"ignore\"/>\n" + 
1804
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess\" value=\"ignore\"/>\n" + 
Lines 1856-1862 Link Here
1856
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.redundantSuperinterface\" value=\"ignore\"/>\n" + 
1836
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.redundantSuperinterface\" value=\"ignore\"/>\n" + 
1857
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + 
1837
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + 
1858
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + 
1838
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + 
1859
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressNullInfoFromAsserts\" value=\"disabled\"/>\n" + 
1860
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors\" value=\"disabled\"/>\n" + 
1839
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors\" value=\"disabled\"/>\n" + 
1861
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" + 
1840
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" + 
1862
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation\" value=\"ignore\"/>\n" + 
1841
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation\" value=\"ignore\"/>\n" + 
Lines 11129-11135 Link Here
11129
}
11108
}
11130
11109
11131
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325342
11110
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325342
11132
// -warn option - regression tests to check option suppressAssertNull
11111
// -warn option - regression tests to check option includeAssertNull
11112
// No null problems arising from asserts should be reported here
11113
// since includeAssertNull is not enabled
11133
public void test293_warn_options() {
11114
public void test293_warn_options() {
11134
	this.runConformTest(
11115
	this.runConformTest(
11135
		new String[] {
11116
		new String[] {
Lines 11165-11179 Link Here
11165
		},
11146
		},
11166
		"\"" + OUTPUT_DIR +  File.separator + "X.java\""
11147
		"\"" + OUTPUT_DIR +  File.separator + "X.java\""
11167
		+ " -sourcepath \"" + OUTPUT_DIR + "\""
11148
		+ " -sourcepath \"" + OUTPUT_DIR + "\""
11168
		+ " -warn:null,suppressAssertNull -1.5 -proc:none -d \"" + OUTPUT_DIR + "\"",
11149
		+ " -warn:null,includeAssertNull -1.5 -proc:none -d \"" + OUTPUT_DIR + "\"",
11169
		"",
11150
		"",
11170
		"----------\n" +
11151
		"----------\n" + 
11171
		"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 10)\n" + 
11152
		"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" + 
11153
		"	if (a!=null) {\n" + 
11154
		"	    ^\n" + 
11155
		"Null comparison always yields false: The variable a can only be null at this location\n" + 
11156
		"----------\n" + 
11157
		"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 10)\n" + 
11172
		"	if (a== null) {}\n" + 
11158
		"	if (a== null) {}\n" + 
11173
		"	    ^\n" + 
11159
		"	    ^\n" + 
11174
		"Redundant null check: The variable a can only be null at this location\n" + 
11160
		"Redundant null check: The variable a can only be null at this location\n" + 
11175
		"----------\n" + 
11161
		"----------\n" + 
11176
		"1 problem (1 warning)",
11162
		"3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 12)\n" + 
11163
		"	if (b!=null) {\n" + 
11164
		"	    ^\n" + 
11165
		"Redundant null check: The variable b cannot be null at this location\n" + 
11166
		"----------\n" + 
11167
		"4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 18)\n" + 
11168
		"	if (c.equals(a)) {\n" + 
11169
		"	    ^\n" +  
11170
		"Null pointer access: The variable c can only be null at this location\n" + 
11171
		"----------\n" + 
11172
		"4 problems (4 warnings)", 
11177
		true);
11173
		true);
11178
}
11174
}
11179
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=280784
11175
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=280784
(-)src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java (-4 / +5 lines)
Lines 57-62 Link Here
57
	    defaultOptions.put(CompilerOptions.OPTION_ReportPotentialNullReference, CompilerOptions.ERROR);
57
	    defaultOptions.put(CompilerOptions.OPTION_ReportPotentialNullReference, CompilerOptions.ERROR);
58
	    defaultOptions.put(CompilerOptions.OPTION_ReportRedundantNullCheck, CompilerOptions.ERROR);
58
	    defaultOptions.put(CompilerOptions.OPTION_ReportRedundantNullCheck, CompilerOptions.ERROR);
59
		defaultOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
59
		defaultOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
60
		defaultOptions.put(CompilerOptions.OPTION_IncludeNullInfoFromAsserts, CompilerOptions.ENABLED);
60
    }
61
    }
61
    return defaultOptions;
62
    return defaultOptions;
62
}
63
}
Lines 13496-13506 Link Here
13496
13497
13497
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325342
13498
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325342
13498
// Null warnings because of assert statements should be suppressed
13499
// Null warnings because of assert statements should be suppressed
13499
// when CompilerOptions.OPTION_SuppressNullInfoFromAsserts is enabled.
13500
// when CompilerOptions.OPTION_IncludeNullInfoFromAsserts is disabled.
13500
public void testBug325342a() {
13501
public void testBug325342a() {
13501
	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
13502
	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
13502
		Map compilerOptions = getCompilerOptions();
13503
		Map compilerOptions = getCompilerOptions();
13503
		compilerOptions.put(CompilerOptions.OPTION_SuppressNullInfoFromAsserts, CompilerOptions.ENABLED);
13504
		compilerOptions.put(CompilerOptions.OPTION_IncludeNullInfoFromAsserts, CompilerOptions.DISABLED);
13504
		this.runNegativeTest(
13505
		this.runNegativeTest(
13505
			new String[] {
13506
			new String[] {
13506
				"Test.java",
13507
				"Test.java",
Lines 13546-13556 Link Here
13546
13547
13547
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325342
13548
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325342
13548
// Null warnings because of assert statements should not be suppressed
13549
// Null warnings because of assert statements should not be suppressed
13549
// when CompilerOptions.OPTION_SuppressNullInfoFromAsserts is disabled.
13550
// when CompilerOptions.OPTION_IncludeNullInfoFromAsserts is enabled.
13550
public void testBug325342b() {
13551
public void testBug325342b() {
13551
	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
13552
	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
13552
		Map compilerOptions = getCompilerOptions();
13553
		Map compilerOptions = getCompilerOptions();
13553
		compilerOptions.put(CompilerOptions.OPTION_SuppressNullInfoFromAsserts, CompilerOptions.DISABLED);
13554
		compilerOptions.put(CompilerOptions.OPTION_IncludeNullInfoFromAsserts, CompilerOptions.ENABLED);
13554
		this.runNegativeTest(
13555
		this.runNegativeTest(
13555
			new String[] {
13556
			new String[] {
13556
				"Test.java",
13557
				"Test.java",
(-)guide/jdt_api_options.htm (-6 / +35 lines)
Lines 503-508 Link Here
503
</tr>
503
</tr>
504
504
505
<tr>
505
<tr>
506
<td colspan=2><a name = "INCLUDE_ASSERTS_IN_NULL_ANALYSIS"></a><b>Reporting Null related problems as a consequnce of assert statements</b> (<b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS">COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS</a></b>)</td>
507
</tr>
508
<tr valign="top">
509
<td rowspan=2>When enabled, the compiler will raise null related errors/warnings for  
510
              a variable that got marked as potentially/definitely <code>null</code> or 
511
              not <code>null</code> inside an assert statement, and whose null state has not
512
              been modified by any other statement following the assert.
513
              <br>This option has an effect only when the compiler compliance is 1.5 or greater.
514
              <br>Note that this option is only relevant in the context of the warnings raised
515
              by the options <a href="#REDUNDANT_NULL_CHECK">COMPILER_PB_REDUNDANT_NULL_CHECK</a>,
516
              <a href="#NULL_REFERENCE">COMPILER_PB_NULL_REFERENCE</a>, and 
517
              <a href="#POTENTIAL_NULL_REFERENCE">COMPILER_PB_POTENTIAL_NULL_REFERENCE</a> as a consequence of
518
              an assert statement.</td>
519
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#ENABLED">ENABLED</a></b></td>
520
</tr>
521
<tr valign="top">
522
<td><b><i><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#DISABLED">DISABLED</a></i></b></td>
523
</tr>
524
525
<tr>
506
<td colspan=2><b>Reporting Interface Method not Compatible with non-Inherited Methods</b> (<b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_INCOMPATIBLE_NON_INHERITED_INTERFACE_METHOD">COMPILER_PB_INCOMPATIBLE_NON_INHERITED_INTERFACE_METHOD</a></b>)</td>
526
<td colspan=2><b>Reporting Interface Method not Compatible with non-Inherited Methods</b> (<b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_INCOMPATIBLE_NON_INHERITED_INTERFACE_METHOD">COMPILER_PB_INCOMPATIBLE_NON_INHERITED_INTERFACE_METHOD</a></b>)</td>
507
</tr>
527
</tr>
508
<tr valign="top">
528
<tr valign="top">
Lines 861-872 Link Here
861
</tr>
881
</tr>
862
882
863
<tr>
883
<tr>
864
<td colspan=2><b>Reporting Null Dereference</b> (<b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_NULL_REFERENCE">COMPILER_PB_NULL_REFERENCE</a></b>)</td>
884
<td colspan=2><a name = "NULL_REFERENCE"></a><b>Reporting Null Dereference</b> (<b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_NULL_REFERENCE">COMPILER_PB_NULL_REFERENCE</a></b>)</td>
865
</tr>
885
</tr>
866
<tr valign="top">
886
<tr valign="top">
867
<td rowspan=3>When enabled, the compiler will issue an error or a warning 
887
<td rowspan=3>When enabled, the compiler will issue an error or a warning 
868
  whenever a variable that is statically known to hold a null value is used to
888
  whenever a variable that is statically known to hold a null value is used to
869
  access a field or method.</td>
889
  access a field or method.
890
  <br>Warnings/errors raised due to this option arising as a consequence of asserts can be
891
  controlled by <a href = "#INCLUDE_ASSERTS_IN_NULL_ANALYSIS">COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS</a>
892
  (java 1.5 and greater)</td>
870
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#ERROR">ERROR</a></b></td>
893
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#ERROR">ERROR</a></b></td>
871
</tr>
894
</tr>
872
<tr valign="top">
895
<tr valign="top">
Lines 892-904 Link Here
892
</tr>
915
</tr>
893
916
894
<tr>
917
<tr>
895
<td colspan=2><b>Reporting Potential Null Dereference</b> (<b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_POTENTIAL_NULL_REFERENCE">COMPILER_PB_POTENTIAL_NULL_REFERENCE</a></b>)</td>
918
<td colspan=2><a name = "POTENTIAL_NULL_REFERENCE"></a><b>Reporting Potential Null Dereference</b> (<b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_POTENTIAL_NULL_REFERENCE">COMPILER_PB_POTENTIAL_NULL_REFERENCE</a></b>)</td>
896
</tr>
919
</tr>
897
<tr valign="top">
920
<tr valign="top">
898
<td rowspan=3>When enabled, the compiler will issue an error or a warning 
921
<td rowspan=3>When enabled, the compiler will issue an error or a warning 
899
  whenever a variable that has formerly been tested against null but is not (no 
922
  whenever a variable that has formerly been tested against null but is not (no 
900
  more) statically known to hold a non-null value is used to access a field or 
923
  more) statically known to hold a non-null value is used to access a field or 
901
  method.</td>
924
  method.
925
  <br>Warnings/errors raised due to this option arising as a consequence of asserts can be
926
  controlled by <a href = "#INCLUDE_ASSERTS_IN_NULL_ANALYSIS">COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS</a>
927
  (java 1.5 and greater)</td>
902
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#ERROR">ERROR</a></b></td>
928
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#ERROR">ERROR</a></b></td>
903
</tr>
929
</tr>
904
<tr valign="top">
930
<tr valign="top">
Lines 909-921 Link Here
909
</tr>
935
</tr>
910
936
911
<tr>
937
<tr>
912
<td colspan=2><b>Reporting Redundant Null Check</b> (<b><a href=
938
<td colspan=2><a name = "REDUNDANT_NULL_CHECK"></a><b>Reporting Redundant Null Check</b> (<b><a href=
913
  "../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_REDUNDANT_NULL_CHECK">COMPILER_PB_REDUNDANT_NULL_CHECK</a></b>)</td>
939
  "../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_REDUNDANT_NULL_CHECK">COMPILER_PB_REDUNDANT_NULL_CHECK</a></b>)</td>
914
</tr>
940
</tr>
915
<tr valign="top">
941
<tr valign="top">
916
<td rowspan=3>When enabled, the compiler will issue an error or a warning 
942
<td rowspan=3>When enabled, the compiler will issue an error or a warning 
917
  whenever a variable that is statically known to hold a null or a non-null 
943
  whenever a variable that is statically known to hold a null or a non-null 
918
  value is tested against null.</td>
944
  value is tested against null.
945
  <br>Warnings/errors raised due to this option arising as a consequence of asserts can be
946
  controlled by <a href = "#INCLUDE_ASSERTS_IN_NULL_ANALYSIS">COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS</a>
947
  (java 1.5 and greater)</td>
919
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#ERROR">ERROR</a></b></td>
948
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#ERROR">ERROR</a></b></td>
920
</tr>
949
</tr>
921
<tr valign="top">
950
<tr valign="top">

Return to bug 325342