Lines 7-12
Link Here
|
7 |
* |
7 |
* |
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
|
|
10 |
* Benjamin Muskalla - Contribution for bug 239066 |
10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
11 |
package org.eclipse.jdt.internal.compiler.impl; |
12 |
package org.eclipse.jdt.internal.compiler.impl; |
12 |
|
13 |
|
Lines 120-125
Link Here
|
120 |
public static final String OPTION_Process_Annotations = "org.eclipse.jdt.core.compiler.processAnnotations"; //$NON-NLS-1$ |
121 |
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$ |
122 |
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$ |
123 |
public static final String OPTION_ReportComparingIdentical = "org.eclipse.jdt.core.compiler.problem.comparingIdentical"; //$NON-NLS-1$ |
|
|
124 |
public static final String OPTION_ReportMissingSynchronizedOnInheritedMethod = "org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod"; //$NON-NLS-1$ |
123 |
|
125 |
|
124 |
// Backward compatibility |
126 |
// Backward compatibility |
125 |
public static final String OPTION_ReportInvalidAnnotation = "org.eclipse.jdt.core.compiler.problem.invalidAnnotation"; //$NON-NLS-1$ |
127 |
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; |
217 |
public static final long UnusedWarningToken = ASTNode.Bit55L; |
216 |
public static final long RedundantSuperinterface = ASTNode.Bit56L; |
218 |
public static final long RedundantSuperinterface = ASTNode.Bit56L; |
217 |
public static final long ComparingIdentical = ASTNode.Bit57L; |
219 |
public static final long ComparingIdentical = ASTNode.Bit57L; |
|
|
220 |
public static final long MissingSynchronizedModifierInInheritedMethod= ASTNode.Bit58L; |
218 |
|
221 |
|
219 |
// Map: String optionKey --> Long irritant> |
222 |
// Map: String optionKey --> Long irritant> |
220 |
private static Map OptionToIrritants; |
223 |
private static Map OptionToIrritants; |
Lines 251-257
Link Here
|
251 |
| UnusedTypeArguments |
254 |
| UnusedTypeArguments |
252 |
| NullReference |
255 |
| NullReference |
253 |
| UnusedWarningToken |
256 |
| UnusedWarningToken |
254 |
| ComparingIdentical; |
257 |
| ComparingIdentical |
|
|
258 |
| MissingSynchronizedModifierInInheritedMethod; |
255 |
|
259 |
|
256 |
// By default only lines and source attributes are generated. |
260 |
// By default only lines and source attributes are generated. |
257 |
public int produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES; |
261 |
public int produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES; |
Lines 463-468
Link Here
|
463 |
optionsMap.put(OPTION_Process_Annotations, this.processAnnotations ? ENABLED : DISABLED); |
467 |
optionsMap.put(OPTION_Process_Annotations, this.processAnnotations ? ENABLED : DISABLED); |
464 |
optionsMap.put(OPTION_ReportRedundantSuperinterface, getSeverityString(RedundantSuperinterface)); |
468 |
optionsMap.put(OPTION_ReportRedundantSuperinterface, getSeverityString(RedundantSuperinterface)); |
465 |
optionsMap.put(OPTION_ReportComparingIdentical, getSeverityString(ComparingIdentical)); |
469 |
optionsMap.put(OPTION_ReportComparingIdentical, getSeverityString(ComparingIdentical)); |
|
|
470 |
optionsMap.put(OPTION_ReportMissingSynchronizedOnInheritedMethod, getSeverityString(MissingSynchronizedModifierInInheritedMethod)); |
466 |
return optionsMap; |
471 |
return optionsMap; |
467 |
} |
472 |
} |
468 |
|
473 |
|
Lines 595-600
Link Here
|
595 |
return OPTION_ReportRedundantSuperinterface; |
600 |
return OPTION_ReportRedundantSuperinterface; |
596 |
case (int)(ComparingIdentical >>> 32) : |
601 |
case (int)(ComparingIdentical >>> 32) : |
597 |
return OPTION_ReportComparingIdentical; |
602 |
return OPTION_ReportComparingIdentical; |
|
|
603 |
case (int)(MissingSynchronizedModifierInInheritedMethod >>> 32) : |
604 |
return OPTION_ReportMissingSynchronizedOnInheritedMethod; |
598 |
} |
605 |
} |
599 |
} |
606 |
} |
600 |
return null; |
607 |
return null; |
Lines 884-889
Link Here
|
884 |
if ((optionValue = optionsMap.get(OPTION_ReportUnusedTypeArgumentsForMethodInvocation)) != null) updateSeverity(UnusedTypeArguments, optionValue); |
891 |
if ((optionValue = optionsMap.get(OPTION_ReportUnusedTypeArgumentsForMethodInvocation)) != null) updateSeverity(UnusedTypeArguments, optionValue); |
885 |
if ((optionValue = optionsMap.get(OPTION_ReportRedundantSuperinterface)) != null) updateSeverity(RedundantSuperinterface, optionValue); |
892 |
if ((optionValue = optionsMap.get(OPTION_ReportRedundantSuperinterface)) != null) updateSeverity(RedundantSuperinterface, optionValue); |
886 |
if ((optionValue = optionsMap.get(OPTION_ReportComparingIdentical)) != null) updateSeverity(ComparingIdentical, optionValue); |
893 |
if ((optionValue = optionsMap.get(OPTION_ReportComparingIdentical)) != null) updateSeverity(ComparingIdentical, optionValue); |
|
|
894 |
if ((optionValue = optionsMap.get(OPTION_ReportMissingSynchronizedOnInheritedMethod)) != null) updateSeverity(MissingSynchronizedModifierInInheritedMethod, optionValue); |
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- missing synchronized on inherited method: ").append(getSeverityString(MissingSynchronizedModifierInInheritedMethod)); //$NON-NLS-1$ |
1084 |
return buf.toString(); |
1093 |
return buf.toString(); |
1085 |
} |
1094 |
} |
1086 |
|
1095 |
|
Lines 1321-1326
Link Here
|
1321 |
"unqualified-field-access", //$NON-NLS-1$ |
1330 |
"unqualified-field-access", //$NON-NLS-1$ |
1322 |
"unused", //$NON-NLS-1$ |
1331 |
"unused", //$NON-NLS-1$ |
1323 |
}; |
1332 |
}; |
|
|
1333 |
|
1324 |
public static long warningTokenToIrritants(String warningToken) { |
1334 |
public static long warningTokenToIrritants(String warningToken) { |
1325 |
// keep in sync with warningTokens and warningTokenFromIrritant |
1335 |
// keep in sync with warningTokens and warningTokenFromIrritant |
1326 |
if (warningToken == null || warningToken.length() == 0) return 0; |
1336 |
if (warningToken == null || warningToken.length() == 0) return 0; |