Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 106812 Details for
Bug 239066
[compiler] Overriding a Synchronized Method with a Non-synchronized Method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
updated patch
syncOverride.diff (text/plain), 24.96 KB, created by
Benjamin Muskalla
on 2008-07-08 08:24:42 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Benjamin Muskalla
Created:
2008-07-08 08:24:42 EDT
Size:
24.96 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java,v >retrieving revision 1.154 >diff -u -r1.154 MethodVerifyTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 27 Jun 2008 16:04:43 -0000 1.154 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 8 Jul 2008 12:18:06 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Muskalla - Contribution for bug 239066 > *******************************************************************************/ > package org.eclipse.jdt.core.tests.compiler.regression; > >@@ -28,7 +29,7 @@ > static { > // TESTS_NAMES = new String[] { "test000" }; > // TESTS_NUMBERS = new int[] { 121 }; >-// TESTS_RANGE = new int[] { 113, -1}; >+ TESTS_RANGE = new int[] { 160, 170}; > } > > public MethodVerifyTest(String name) { >@@ -8676,4 +8677,75 @@ > "----------\n" > ); > } >+ >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 >+public void test166() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "class X { synchronized void foo() {} }\n" + >+ "class Y extends X { @Override void foo() { } }" >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 2)\n" + >+ " class Y extends X { @Override void foo() { } }\n" + >+ " ^^^^^\n" + >+ "The method Y.foo() is overriding a synchronized method without being synchronized\n" + >+ "----------\n" >+ ); >+} >+ >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 >+public void test167() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public enum X {\n" + >+ " FOO { @Override void foo() { super.foo(); } };\n"+ >+ " synchronized void foo() { }\n"+ >+ "}" >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 2)\n" + >+ " FOO { @Override void foo() { super.foo(); } };\n" + >+ " ^^^^^\n" + >+ "The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" + >+ "----------\n"); >+} >+ >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 >+public void test168() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " void bar() { new X() { @Override void foo() {} }; }\n"+ >+ " synchronized void foo() { }\n"+ >+ "}" >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 2)\n" + >+ " void bar() { new X() { @Override void foo() {} }; }\n"+ >+ " ^^^^^\n" + >+ "The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" + >+ "----------\n"); >+} >+ >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 >+public void test169() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X { synchronized void foo() {} }\n" + >+ "class Y extends X {}\n" + >+ "class Z extends Y { @Override void foo() {} }\n" >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 3)\n" + >+ " class Z extends Y { @Override void foo() {} }\n" + >+ " ^^^^^\n" + >+ "The method Z.foo() is overriding a synchronized method without being synchronized\n" + >+ "----------\n"); >+} >+ > } >\ No newline at end of file >Index: src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java,v >retrieving revision 1.17 >diff -u -r1.17 CompilerInvocationTests.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java 27 Jun 2008 16:04:45 -0000 1.17 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java 8 Jul 2008 12:18:05 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Muskalla - Contribution for bug 239066 > *******************************************************************************/ > package org.eclipse.jdt.core.tests.compiler.regression; > >@@ -847,6 +848,7 @@ > expectedProblemAttributes.put("JavadocTypeArgumentsForRawGenericConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); > expectedProblemAttributes.put("ExternalProblemNotFixable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); > expectedProblemAttributes.put("ExternalProblemFixable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); >+ expectedProblemAttributes.put("MissingSynchronizedModifierInInheritedMethod", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); > StringBuffer failures = new StringBuffer(); > Field[] fields = (iProblemClass = IProblem.class).getFields(); > boolean watchInternalCategory = false, printHeader = true; >@@ -1994,6 +1996,7 @@ > expectedProblemAttributes.put("ExternalProblemNotFixable", SKIP); > expectedProblemAttributes.put("ExternalProblemFixable", SKIP); > expectedProblemAttributes.put("ComparingIdentical", new ProblemAttributes(JavaCore.COMPILER_PB_COMPARING_IDENTICAL)); >+ expectedProblemAttributes.put("MissingSynchronizedModifierInInheritedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD)); > Map constantNamesIndex = new HashMap(); > Field[] fields = JavaCore.class.getFields(); > for (int i = 0, length = fields.length; i < length; i++) { >Index: src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java,v >retrieving revision 1.166 >diff -u -r1.166 BatchCompilerTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 27 Jun 2008 16:04:44 -0000 1.166 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 8 Jul 2008 12:18:04 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Muskalla - Contribution for bug 239066 > *******************************************************************************/ > package org.eclipse.jdt.core.tests.compiler.regression; > >@@ -1678,6 +1679,7 @@ > " staticReceiver + non-static reference to static member\n" + > " super overriding a method without making a super invocation\n" + > " suppress + enable @SuppressWarnings\n" + >+ " syncOverride overriding a synchronized method without synchronizing it\n" + > " synthetic-access same as syntheticAccess\n" + > " syntheticAccess synthetic access for innerclass\n" + > " tasks(<tags separated by |>) tasks identified by tags inside comments\n" + >@@ -1808,6 +1810,7 @@ > " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"public\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.missingSerialVersion\" value=\"warning\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.noEffectAssignment\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral\" value=\"ignore\"/>\n" + >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java,v >retrieving revision 1.96 >diff -u -r1.96 MethodVerifier.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 27 Jun 2008 16:04:02 -0000 1.96 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 8 Jul 2008 12:18:08 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Muskalla - Contribution for bug 239066 > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.lookup; > >@@ -179,6 +180,9 @@ > problemReporter(currentMethod).finalMethodCannotBeOverridden(currentMethod, inheritedMethod); > if (!isAsVisible(currentMethod, inheritedMethod)) > problemReporter(currentMethod).visibilityConflict(currentMethod, inheritedMethod); >+ if(inheritedMethod.isSynchronized() && !currentMethod.isSynchronized()) { >+ problemReporter(currentMethod).missingSynchronizedOnInheritedMethod(currentMethod, inheritedMethod); >+ } > if (options.reportDeprecationWhenOverridingDeprecatedMethod && inheritedMethod.isViewedAsDeprecated()) { > if (!currentMethod.isViewedAsDeprecated() || options.reportDeprecationInsideDeprecatedCode) { > // check against the other inherited methods to see if they hide this inheritedMethod >Index: batch/org/eclipse/jdt/internal/compiler/batch/Main.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java,v >retrieving revision 1.329 >diff -u -r1.329 Main.java >--- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 27 Jun 2008 16:04:10 -0000 1.329 >+++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 8 Jul 2008 12:18:08 -0000 >@@ -9,6 +9,7 @@ > * IBM Corporation - initial API and implementation > * Tom Tromey - Contribution for bug 125961 > * Tom Tromey - Contribution for bug 159641 >+ * Benjamin Muskalla - Contribution for bug 239066 > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.batch; > >@@ -3168,6 +3169,10 @@ > this.options.put( > CompilerOptions.OPTION_ReportComparingIdentical, > isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); >+ } else if (token.equals("syncOverride")) { //$NON-NLS-1$ >+ this.options.put( >+ CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, >+ isEnabling ? CompilerOptions.ERROR : CompilerOptions.IGNORE); > } else if (token.equals("intfNonInherited") || token.equals("interfaceNonInherited")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ > this.options.put( > CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, >Index: batch/org/eclipse/jdt/internal/compiler/batch/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties,v >retrieving revision 1.750 >diff -u -r1.750 messages.properties >--- batch/org/eclipse/jdt/internal/compiler/batch/messages.properties 1 Jul 2008 11:26:25 -0000 1.750 >+++ batch/org/eclipse/jdt/internal/compiler/batch/messages.properties 8 Jul 2008 12:18:08 -0000 >@@ -7,6 +7,7 @@ > # > # Contributors: > # IBM Corporation - initial API and implementation >+# Benjamin Muskalla - Contribution for bug 239066 > ############################################################################### > ### JavaBatchCompiler messages. > >@@ -275,6 +276,7 @@ > \ staticReceiver + non-static reference to static member\n\ > \ super overriding a method without making a super invocation\n\ > \ suppress + enable @SuppressWarnings\n\ >+\ syncOverride overriding a synchronized method without synchronizing it\n\ > \ synthetic-access same as syntheticAccess\n\ > \ syntheticAccess synthetic access for innerclass\n\ > \ tasks(<tags separated by |>) tasks identified by tags inside comments\n\ >Index: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v >retrieving revision 1.234 >diff -u -r1.234 messages.properties >--- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 23 Jun 2008 16:23:26 -0000 1.234 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 8 Jul 2008 12:18:09 -0000 >@@ -7,6 +7,7 @@ > # > # Contributors: > # IBM Corporation - initial API and implementation >+# Benjamin Muskalla - Contribution for bug 239066 > ############################################################################### > 0 = {0} > 1 = super cannot be used in java.lang.Object >@@ -348,6 +349,7 @@ > 414 = Exception {0} is not compatible with throws clause in {1}, thus this interface cannot be implemented > 415 = The variable argument type {0} of the method {1} must be the last parameter > 416 = The method {0} is overriding a method without making a super invocation >+417 = The method {0}.{1}({2}) is overriding a synchronized method without being synchronized > > 420 = Code snippet support cannot find the class {0} > 421 = Code snippet support cannot find the method {0}.{1}({2}) >Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v >retrieving revision 1.372 >diff -u -r1.372 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 27 Jun 2008 16:04:14 -0000 1.372 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 8 Jul 2008 12:18:09 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Muskalla - Contribution for bug 239066 > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.problem; > >@@ -318,6 +319,9 @@ > > case IProblem.ComparingIdentical: > return CompilerOptions.ComparingIdentical; >+ >+ case IProblem.MissingSynchronizedModifierInInheritedMethod: >+ return CompilerOptions.MissingSynchronizedModifierInInheritedMethod; > } > return 0; > } >@@ -410,6 +414,7 @@ > case (int)(CompilerOptions.FallthroughCase >>> 32): > case (int)(CompilerOptions.OverridingMethodWithoutSuperInvocation >>> 32): > case (int)(CompilerOptions.ComparingIdentical >>> 32): >+ case (int)(CompilerOptions.MissingSynchronizedModifierInInheritedMethod >> 32): > return CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM; > > case (int)(CompilerOptions.TypeHiding >>> 32): >@@ -4910,6 +4915,22 @@ > typeDecl.sourceStart, > typeDecl.sourceEnd); > } >+public void missingSynchronizedOnInheritedMethod(MethodBinding currentMethod, MethodBinding inheritedMethod) { >+ this.handle( >+ IProblem.MissingSynchronizedModifierInInheritedMethod, >+ new String[] { >+ new String(currentMethod.declaringClass.readableName()), >+ new String(currentMethod.selector), >+ typesAsString(currentMethod.isVarargs(), currentMethod.parameters, false), >+ }, >+ new String[] { >+ new String(currentMethod.declaringClass.shortReadableName()), >+ new String(currentMethod.selector), >+ typesAsString(currentMethod.isVarargs(), currentMethod.parameters, true), >+ }, >+ currentMethod.sourceStart(), >+ currentMethod.sourceEnd()); >+} > public void missingTypeInConstructor(ASTNode location, MethodBinding constructor) { > List missingTypes = constructor.collectMissingTypes(null); > TypeBinding missingType = (TypeBinding) missingTypes.get(0); >Index: model/org/eclipse/jdt/core/JavaCore.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java,v >retrieving revision 1.622 >diff -u -r1.622 JavaCore.java >--- model/org/eclipse/jdt/core/JavaCore.java 27 Jun 2008 16:04:01 -0000 1.622 >+++ model/org/eclipse/jdt/core/JavaCore.java 8 Jul 2008 12:18:10 -0000 >@@ -80,6 +80,7 @@ > * IBM Corporation - added the following constant: > * COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE > * IBM Corporation - added getOptionForConfigurableSeverity(int) >+ * Benjamin Muskalla - added COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD > *******************************************************************************/ > package org.eclipse.jdt.core; > >@@ -1468,7 +1469,19 @@ > * @category CompilerOptionID > */ > public static final String COMPILER_PB_COMPARING_IDENTICAL = PLUGIN_ID + ".compiler.problem.comparingIdentical"; //$NON-NLS-1$ >- >+ /** >+ * Compiler option ID: Reporting Missing Synchronized Modifier On Inherited Method. >+ * <p>When enabled, the compiler will issue an error or a warning if a method >+ * overrides a synchronized method without having a synchronized modifier. >+ * <dl> >+ * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod"</code></dd> >+ * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> >+ * <dt>Default:</dt><dd><code>"warning"</code></dd> >+ * </dl> >+ * @since 3.5 >+ * @category CompilerOptionID >+ */ >+ public static final String COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD = PLUGIN_ID + ".compiler.problem.missingSynchronizedOnInheritedMethod"; //$NON-NLS-1$ > /** > * Core option ID: Computing Project Build Order. > * <p>Indicate whether JavaCore should enforce the project build order to be based on >Index: compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java,v >retrieving revision 1.205 >diff -u -r1.205 CompilerOptions.java >--- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 27 Jun 2008 16:04:13 -0000 1.205 >+++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 8 Jul 2008 12:18:08 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Muskalla - Contribution for bug 239066 > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.impl; > >@@ -120,6 +121,7 @@ > public static final String OPTION_Process_Annotations = "org.eclipse.jdt.core.compiler.processAnnotations"; //$NON-NLS-1$ > public static final String OPTION_ReportRedundantSuperinterface = "org.eclipse.jdt.core.compiler.problem.redundantSuperinterface"; //$NON-NLS-1$ > public static final String OPTION_ReportComparingIdentical = "org.eclipse.jdt.core.compiler.problem.comparingIdentical"; //$NON-NLS-1$ >+ public static final String OPTION_ReportMissingSynchronizedOnInheritedMethod = "org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod"; //$NON-NLS-1$ > > // Backward compatibility > public static final String OPTION_ReportInvalidAnnotation = "org.eclipse.jdt.core.compiler.problem.invalidAnnotation"; //$NON-NLS-1$ >@@ -215,6 +217,7 @@ > public static final long UnusedWarningToken = ASTNode.Bit55L; > public static final long RedundantSuperinterface = ASTNode.Bit56L; > public static final long ComparingIdentical = ASTNode.Bit57L; >+ public static final long MissingSynchronizedModifierInInheritedMethod= ASTNode.Bit58L; > > // Map: String optionKey --> Long irritant> > private static Map OptionToIrritants; >@@ -251,7 +254,8 @@ > | UnusedTypeArguments > | NullReference > | UnusedWarningToken >- | ComparingIdentical; >+ | ComparingIdentical >+ | MissingSynchronizedModifierInInheritedMethod; > > // By default only lines and source attributes are generated. > public int produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES; >@@ -463,6 +467,7 @@ > optionsMap.put(OPTION_Process_Annotations, this.processAnnotations ? ENABLED : DISABLED); > optionsMap.put(OPTION_ReportRedundantSuperinterface, getSeverityString(RedundantSuperinterface)); > optionsMap.put(OPTION_ReportComparingIdentical, getSeverityString(ComparingIdentical)); >+ optionsMap.put(OPTION_ReportMissingSynchronizedOnInheritedMethod, getSeverityString(MissingSynchronizedModifierInInheritedMethod)); > return optionsMap; > } > >@@ -595,6 +600,8 @@ > return OPTION_ReportRedundantSuperinterface; > case (int)(ComparingIdentical >>> 32) : > return OPTION_ReportComparingIdentical; >+ case (int)(MissingSynchronizedModifierInInheritedMethod >>> 32) : >+ return OPTION_ReportMissingSynchronizedOnInheritedMethod; > } > } > return null; >@@ -884,6 +891,7 @@ > if ((optionValue = optionsMap.get(OPTION_ReportUnusedTypeArgumentsForMethodInvocation)) != null) updateSeverity(UnusedTypeArguments, optionValue); > if ((optionValue = optionsMap.get(OPTION_ReportRedundantSuperinterface)) != null) updateSeverity(RedundantSuperinterface, optionValue); > if ((optionValue = optionsMap.get(OPTION_ReportComparingIdentical)) != null) updateSeverity(ComparingIdentical, optionValue); >+ if ((optionValue = optionsMap.get(OPTION_ReportMissingSynchronizedOnInheritedMethod)) != null) updateSeverity(MissingSynchronizedModifierInInheritedMethod, optionValue); > > // Javadoc options > if ((optionValue = optionsMap.get(OPTION_DocCommentSupport)) != null) { >@@ -1081,6 +1089,7 @@ > buf.append("\n\t- unused type arguments for method/constructor invocation: ").append(getSeverityString(UnusedTypeArguments)); //$NON-NLS-1$ > buf.append("\n\t- redundant superinterface: ").append(getSeverityString(RedundantSuperinterface)); //$NON-NLS-1$ > buf.append("\n\t- comparing identical expr: ").append(getSeverityString(ComparingIdentical)); //$NON-NLS-1$ >+ buf.append("\n\t- missing synchronized on inherited method: ").append(getSeverityString(MissingSynchronizedModifierInInheritedMethod)); //$NON-NLS-1$ > return buf.toString(); > } > >@@ -1321,6 +1330,7 @@ > "unqualified-field-access", //$NON-NLS-1$ > "unused", //$NON-NLS-1$ > }; >+ > public static long warningTokenToIrritants(String warningToken) { > // keep in sync with warningTokens and warningTokenFromIrritant > if (warningToken == null || warningToken.length() == 0) return 0; >Index: compiler/org/eclipse/jdt/core/compiler/IProblem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java,v >retrieving revision 1.201 >diff -u -r1.201 IProblem.java >--- compiler/org/eclipse/jdt/core/compiler/IProblem.java 27 Jun 2008 16:04:14 -0000 1.201 >+++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 8 Jul 2008 12:18:08 -0000 >@@ -113,6 +113,9 @@ > * InvalidUsageOfTypeParametersForEnumDeclaration > * IBM Corporation - added the following constants > * RedundantSuperinterface >+ * Benjamin Muskalla - added the following constants >+ * MissingSynchronizedModifierInInheritedMethod >+ * > *******************************************************************************/ > package org.eclipse.jdt.core.compiler; > >@@ -769,6 +772,8 @@ > int IllegalVararg = MethodRelated + 415; > /** @since 3.3 */ > int OverridingMethodWithoutSuperInvocation = MethodRelated + 416; >+ /** @since 3.5 */ >+ int MissingSynchronizedModifierInInheritedMethod= MethodRelated + 417; > > // code snippet support > int CodeSnippetMissingClass = Internal + 420; >#P org.eclipse.jdt.doc.isv >Index: guide/jdt_api_options.htm >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.doc.isv/guide/jdt_api_options.htm,v >retrieving revision 1.67 >diff -u -r1.67 jdt_api_options.htm >--- guide/jdt_api_options.htm 3 Jun 2008 19:41:57 -0000 1.67 >+++ guide/jdt_api_options.htm 8 Jul 2008 12:18:12 -0000 >@@ -805,6 +805,20 @@ > </tr> > > <tr> >+<td colspan=2><b>Reporting Missing synchronized modifier of inherited methods</b> (<b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_MISSING_COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD">COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD</a></b>)</td> >+</tr> >+<tr valign="top"> >+<td rowspan=3>When enabled, the compiler will issue an error or a warning whenever a method overrides a synchronized method without having a synchronized modifier.</td> >+<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#ERROR">ERROR</a></b></td> >+</tr> >+<tr valign="top"> >+<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#WARNING"><i>WARNING</i></a></b></td> >+</tr> >+<tr valign="top"> >+<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#IGNORE">IGNORE</a></b></td> >+</tr> >+ >+<tr> > <td colspan=2><b>Reporting Assignment with No Effect</b> (<b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_NO_EFFECT_ASSIGNMENT">COMPILER_PB_NO_EFFECT_ASSIGNMENT</a></b>)</td> > </tr> > <tr valign="top">
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
philippe_mulet
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 239066
:
106233
| 106812