Lines 120-125
Link Here
|
120 |
public static final String OPTION_Process_Annotations = "org.eclipse.jdt.core.compiler.processAnnotations"; //$NON-NLS-1$ |
120 |
public static final String OPTION_Process_Annotations = "org.eclipse.jdt.core.compiler.processAnnotations"; //$NON-NLS-1$ |
121 |
public static final String OPTION_ReportRedundantSuperinterface = "org.eclipse.jdt.core.compiler.problem.redundantSuperinterface"; //$NON-NLS-1$ |
121 |
public static final String OPTION_ReportRedundantSuperinterface = "org.eclipse.jdt.core.compiler.problem.redundantSuperinterface"; //$NON-NLS-1$ |
122 |
public static final String OPTION_ReportComparingIdentical = "org.eclipse.jdt.core.compiler.problem.comparingIdentical"; //$NON-NLS-1$ |
122 |
public static final String OPTION_ReportComparingIdentical = "org.eclipse.jdt.core.compiler.problem.comparingIdentical"; //$NON-NLS-1$ |
|
|
123 |
public static final String OPTION_ReportUnusedThrowableAllocation = "org.eclipse.jdt.core.compiler.problem.unusedThrowableAllocation"; //$NON-NLS-1$ |
123 |
|
124 |
|
124 |
// Backward compatibility |
125 |
// Backward compatibility |
125 |
public static final String OPTION_ReportInvalidAnnotation = "org.eclipse.jdt.core.compiler.problem.invalidAnnotation"; //$NON-NLS-1$ |
126 |
public static final String OPTION_ReportInvalidAnnotation = "org.eclipse.jdt.core.compiler.problem.invalidAnnotation"; //$NON-NLS-1$ |
Lines 215-220
Link Here
|
215 |
public static final long UnusedWarningToken = ASTNode.Bit55L; |
216 |
public static final long UnusedWarningToken = ASTNode.Bit55L; |
216 |
public static final long RedundantSuperinterface = ASTNode.Bit56L; |
217 |
public static final long RedundantSuperinterface = ASTNode.Bit56L; |
217 |
public static final long ComparingIdentical = ASTNode.Bit57L; |
218 |
public static final long ComparingIdentical = ASTNode.Bit57L; |
|
|
219 |
public static final long UnusedThrowableAllocation = ASTNode.Bit58L; |
218 |
|
220 |
|
219 |
// Map: String optionKey --> Long irritant> |
221 |
// Map: String optionKey --> Long irritant> |
220 |
private static Map OptionToIrritants; |
222 |
private static Map OptionToIrritants; |
Lines 251-257
Link Here
|
251 |
| UnusedTypeArguments |
253 |
| UnusedTypeArguments |
252 |
| NullReference |
254 |
| NullReference |
253 |
| UnusedWarningToken |
255 |
| UnusedWarningToken |
254 |
| ComparingIdentical; |
256 |
| ComparingIdentical |
|
|
257 |
| UnusedThrowableAllocation; |
255 |
|
258 |
|
256 |
// By default only lines and source attributes are generated. |
259 |
// By default only lines and source attributes are generated. |
257 |
public int produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES; |
260 |
public int produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES; |
Lines 463-468
Link Here
|
463 |
optionsMap.put(OPTION_Process_Annotations, this.processAnnotations ? ENABLED : DISABLED); |
466 |
optionsMap.put(OPTION_Process_Annotations, this.processAnnotations ? ENABLED : DISABLED); |
464 |
optionsMap.put(OPTION_ReportRedundantSuperinterface, getSeverityString(RedundantSuperinterface)); |
467 |
optionsMap.put(OPTION_ReportRedundantSuperinterface, getSeverityString(RedundantSuperinterface)); |
465 |
optionsMap.put(OPTION_ReportComparingIdentical, getSeverityString(ComparingIdentical)); |
468 |
optionsMap.put(OPTION_ReportComparingIdentical, getSeverityString(ComparingIdentical)); |
|
|
469 |
optionsMap.put(OPTION_ReportUnusedThrowableAllocation, getSeverityString(UnusedThrowableAllocation)); |
466 |
return optionsMap; |
470 |
return optionsMap; |
467 |
} |
471 |
} |
468 |
|
472 |
|
Lines 595-600
Link Here
|
595 |
return OPTION_ReportRedundantSuperinterface; |
599 |
return OPTION_ReportRedundantSuperinterface; |
596 |
case (int)(ComparingIdentical >>> 32) : |
600 |
case (int)(ComparingIdentical >>> 32) : |
597 |
return OPTION_ReportComparingIdentical; |
601 |
return OPTION_ReportComparingIdentical; |
|
|
602 |
case (int)(UnusedThrowableAllocation >>> 32) : |
603 |
return OPTION_ReportUnusedThrowableAllocation; |
598 |
} |
604 |
} |
599 |
} |
605 |
} |
600 |
return null; |
606 |
return null; |
Lines 884-889
Link Here
|
884 |
if ((optionValue = optionsMap.get(OPTION_ReportUnusedTypeArgumentsForMethodInvocation)) != null) updateSeverity(UnusedTypeArguments, optionValue); |
890 |
if ((optionValue = optionsMap.get(OPTION_ReportUnusedTypeArgumentsForMethodInvocation)) != null) updateSeverity(UnusedTypeArguments, optionValue); |
885 |
if ((optionValue = optionsMap.get(OPTION_ReportRedundantSuperinterface)) != null) updateSeverity(RedundantSuperinterface, optionValue); |
891 |
if ((optionValue = optionsMap.get(OPTION_ReportRedundantSuperinterface)) != null) updateSeverity(RedundantSuperinterface, optionValue); |
886 |
if ((optionValue = optionsMap.get(OPTION_ReportComparingIdentical)) != null) updateSeverity(ComparingIdentical, optionValue); |
892 |
if ((optionValue = optionsMap.get(OPTION_ReportComparingIdentical)) != null) updateSeverity(ComparingIdentical, optionValue); |
|
|
893 |
if ((optionValue = optionsMap.get(OPTION_ReportUnusedThrowableAllocation)) != null) updateSeverity(UnusedThrowableAllocation, optionValue); |
894 |
|
887 |
|
895 |
|
888 |
// Javadoc options |
896 |
// Javadoc options |
889 |
if ((optionValue = optionsMap.get(OPTION_DocCommentSupport)) != null) { |
897 |
if ((optionValue = optionsMap.get(OPTION_DocCommentSupport)) != null) { |
Lines 1081-1086
Link Here
|
1081 |
buf.append("\n\t- unused type arguments for method/constructor invocation: ").append(getSeverityString(UnusedTypeArguments)); //$NON-NLS-1$ |
1089 |
buf.append("\n\t- unused type arguments for method/constructor invocation: ").append(getSeverityString(UnusedTypeArguments)); //$NON-NLS-1$ |
1082 |
buf.append("\n\t- redundant superinterface: ").append(getSeverityString(RedundantSuperinterface)); //$NON-NLS-1$ |
1090 |
buf.append("\n\t- redundant superinterface: ").append(getSeverityString(RedundantSuperinterface)); //$NON-NLS-1$ |
1083 |
buf.append("\n\t- comparing identical expr: ").append(getSeverityString(ComparingIdentical)); //$NON-NLS-1$ |
1091 |
buf.append("\n\t- comparing identical expr: ").append(getSeverityString(ComparingIdentical)); //$NON-NLS-1$ |
|
|
1092 |
buf.append("\n\t- unused instantiation of throwable: ").append(getSeverityString(UnusedThrowableAllocation)); //$NON-NLS-1$ |
1093 |
|
1084 |
return buf.toString(); |
1094 |
return buf.toString(); |
1085 |
} |
1095 |
} |
1086 |
|
1096 |
|
Lines 1283-1288
Link Here
|
1283 |
case (int) (UnusedLabel >>> 32): |
1293 |
case (int) (UnusedLabel >>> 32): |
1284 |
case (int) (UnusedTypeArguments >>> 32) : |
1294 |
case (int) (UnusedTypeArguments >>> 32) : |
1285 |
case (int) (RedundantSuperinterface >>> 32) : |
1295 |
case (int) (RedundantSuperinterface >>> 32) : |
|
|
1296 |
case (int) (UnusedThrowableAllocation >>> 32): |
1286 |
return "unused"; //$NON-NLS-1$ |
1297 |
return "unused"; //$NON-NLS-1$ |
1287 |
case (int) (DiscouragedReference >>> 32) : |
1298 |
case (int) (DiscouragedReference >>> 32) : |
1288 |
case (int) (ForbiddenReference >>> 32) : |
1299 |
case (int) (ForbiddenReference >>> 32) : |
Lines 1379-1385
Link Here
|
1379 |
break; |
1390 |
break; |
1380 |
case 'u' : |
1391 |
case 'u' : |
1381 |
if ("unused".equals(warningToken)) //$NON-NLS-1$ |
1392 |
if ("unused".equals(warningToken)) //$NON-NLS-1$ |
1382 |
return UnusedLocalVariable | UnusedArgument | UnusedPrivateMember | UnusedDeclaredThrownException | UnusedLabel | UnusedImport | UnusedTypeArguments | RedundantSuperinterface; |
1393 |
return UnusedLocalVariable | UnusedArgument | UnusedPrivateMember | UnusedDeclaredThrownException | UnusedLabel | UnusedImport | UnusedTypeArguments | RedundantSuperinterface | UnusedThrowableAllocation; |
1383 |
if ("unchecked".equals(warningToken)) //$NON-NLS-1$ |
1394 |
if ("unchecked".equals(warningToken)) //$NON-NLS-1$ |
1384 |
return UncheckedTypeOperation | RawTypeReference; |
1395 |
return UncheckedTypeOperation | RawTypeReference; |
1385 |
if ("unqualified-field-access".equals(warningToken)) //$NON-NLS-1$ |
1396 |
if ("unqualified-field-access".equals(warningToken)) //$NON-NLS-1$ |