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 |