diff options
author | M N Palat | 2013-07-11 11:17:39 +0000 |
---|---|---|
committer | M N Palat | 2013-07-11 11:17:39 +0000 |
commit | 328c06fa136c963530115a367863b6a931384871 (patch) | |
tree | f01986499e174f594ec28f42dee179229ed0f487 | |
parent | 7a4894572c8dc97616c8aa59652842aae37320e6 (diff) | |
download | eclipse.jdt.core-328c06fa136c963530115a367863b6a931384871.tar.gz eclipse.jdt.core-328c06fa136c963530115a367863b6a931384871.tar.xz eclipse.jdt.core-328c06fa136c963530115a367863b6a931384871.zip |
interface methods produces confusing diagnostics
7 files changed, 118 insertions, 34 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java index f782c4a49a..d0ef0e266d 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java @@ -510,6 +510,7 @@ public void test011_problem_categories() { expectedProblemAttributes.put("HierarchyCircularitySelfReference", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("HierarchyHasProblems", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalAbstractModifierCombinationForMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalAbstractStrictfpModifierCombinationForInterfaceMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); expectedProblemAttributes.put("IllegalAccessFromTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalAnnotationForBaseType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalCast", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); @@ -527,6 +528,7 @@ public void test011_problem_categories() { expectedProblemAttributes.put("IllegalBasetypeInIntersectionCast", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalModifierCombinationFinalAbstractForClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalModifierCombinationFinalVolatileForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalModifierCombinationForInterfaceMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); expectedProblemAttributes.put("IllegalModifierForAnnotationField", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); expectedProblemAttributes.put("IllegalModifierForAnnotationMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalModifierForAnnotationMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); @@ -541,7 +543,7 @@ public void test011_problem_categories() { expectedProblemAttributes.put("IllegalModifierForInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalModifierForInterfaceField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); expectedProblemAttributes.put("IllegalModifierForInterfaceMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierForInterfaceDefaultMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalModifierForInterfaceMethod18", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); expectedProblemAttributes.put("IllegalModifierForLocalClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalModifierForLocalEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalModifierForMemberClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); @@ -1292,6 +1294,7 @@ public void test012_compiler_problems_tuning() { expectedProblemAttributes.put("HierarchyCircularitySelfReference", SKIP); expectedProblemAttributes.put("HierarchyHasProblems", SKIP); expectedProblemAttributes.put("IllegalAbstractModifierCombinationForMethod", SKIP); + expectedProblemAttributes.put("IllegalAbstractStrictfpModifierCombinationForInterfaceMethod", SKIP); expectedProblemAttributes.put("IllegalAccessFromTypeVariable", SKIP); expectedProblemAttributes.put("IllegalAnnotationForBaseType", SKIP); expectedProblemAttributes.put("IllegalCast", SKIP); @@ -1309,6 +1312,7 @@ public void test012_compiler_problems_tuning() { expectedProblemAttributes.put("IllegalBasetypeInIntersectionCast", SKIP); expectedProblemAttributes.put("IllegalModifierCombinationFinalAbstractForClass", SKIP); expectedProblemAttributes.put("IllegalModifierCombinationFinalVolatileForField", SKIP); + expectedProblemAttributes.put("IllegalModifierCombinationForInterfaceMethod", SKIP); expectedProblemAttributes.put("IllegalModifierForAnnotationField", SKIP); expectedProblemAttributes.put("IllegalModifierForAnnotationMemberType", SKIP); expectedProblemAttributes.put("IllegalModifierForAnnotationMethod", SKIP); @@ -1323,7 +1327,7 @@ public void test012_compiler_problems_tuning() { expectedProblemAttributes.put("IllegalModifierForInterface", SKIP); expectedProblemAttributes.put("IllegalModifierForInterfaceField", SKIP); expectedProblemAttributes.put("IllegalModifierForInterfaceMethod", SKIP); - expectedProblemAttributes.put("IllegalModifierForInterfaceDefaultMethod", SKIP); + expectedProblemAttributes.put("IllegalModifierForInterfaceMethod18", SKIP); expectedProblemAttributes.put("IllegalModifierForLocalClass", SKIP); expectedProblemAttributes.put("IllegalModifierForLocalEnum", SKIP); expectedProblemAttributes.put("IllegalModifierForMemberClass", SKIP); diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java index 5ec8f8788e..367866f22c 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java @@ -83,17 +83,17 @@ public class InterfaceMethodsTest extends AbstractComparableTest { "1. ERROR in I.java (at line 5)\n" + " public default synchronized void foo2() { System.exit(0); }\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo2; only public, abstract and strictfp are permitted\n" + + "Illegal modifier for the interface method foo2; only public, abstract, default, static and strictfp are permitted\n" + "----------\n" + "2. ERROR in I.java (at line 7)\n" + " public default strictfp synchronized void foo4() {}\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo4; only public, abstract and strictfp are permitted\n" + + "Illegal modifier for the interface method foo4; only public, abstract, default, static and strictfp are permitted\n" + "----------\n" + "3. ERROR in I.java (at line 8)\n" + " public default strictfp synchronized @Annot void foo5() {}\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo5; only public, abstract and strictfp are permitted\n" + + "Illegal modifier for the interface method foo5; only public, abstract, default, static and strictfp are permitted\n" + "----------\n"); } @@ -148,22 +148,32 @@ public class InterfaceMethodsTest extends AbstractComparableTest { "1. ERROR in I.java (at line 5)\n" + " public synchronized void foo2();\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo2; only public & abstract are permitted\n" + + "Illegal modifier for the interface method foo2; only public, abstract, default, static and strictfp are permitted\n" + "----------\n" + "2. ERROR in I.java (at line 6)\n" + " strictfp void foo3();\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo3; only public & abstract are permitted\n" + + "Illegal modifiers for the interface method foo3; strictfp is not permitted for abstract interface methods\n" + "----------\n" + "3. ERROR in I.java (at line 7)\n" + " public strictfp synchronized void foo4();\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo4; only public & abstract are permitted\n" + + "Illegal modifiers for the interface method foo4; strictfp is not permitted for abstract interface methods\n" + "----------\n" + - "4. ERROR in I.java (at line 8)\n" + + "4. ERROR in I.java (at line 7)\n" + + " public strictfp synchronized void foo4();\n" + + " ^^^^^^\n" + + "Illegal modifier for the interface method foo4; only public, abstract, default, static and strictfp are permitted\n" + + "----------\n" + + "5. ERROR in I.java (at line 8)\n" + " public strictfp synchronized @Annot void foo5();\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo5; only public & abstract are permitted\n" + + "Illegal modifiers for the interface method foo5; strictfp is not permitted for abstract interface methods\n" + + "----------\n" + + "6. ERROR in I.java (at line 8)\n" + + " public strictfp synchronized @Annot void foo5();\n" + + " ^^^^^^\n" + + "Illegal modifier for the interface method foo5; only public, abstract, default, static and strictfp are permitted\n" + "----------\n"); } @@ -184,7 +194,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest { "1. ERROR in I.java (at line 2)\n" + " native void foo1();\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo1; only public & abstract are permitted\n" + + "Illegal modifier for the interface method foo1; only public, abstract, default, static and strictfp are permitted\n" + "----------\n" + "2. ERROR in I.java (at line 3)\n" + " static void foo2();\n" + @@ -194,22 +204,22 @@ public class InterfaceMethodsTest extends AbstractComparableTest { "3. ERROR in I.java (at line 4)\n" + " native default void foo3() {}\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo3; only public, abstract and strictfp are permitted\n" + + "Illegal modifier for the interface method foo3; only public, abstract, default, static and strictfp are permitted\n" + "----------\n" + "4. ERROR in I.java (at line 5)\n" + " default native void foo4() {}\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo4; only public, abstract and strictfp are permitted\n" + + "Illegal modifier for the interface method foo4; only public, abstract, default, static and strictfp are permitted\n" + "----------\n" + "5. ERROR in I.java (at line 6)\n" + " static default void foo5() {}\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo5; only public, abstract and strictfp are permitted\n" + + "Illegal combination of modifiers for the interface method foo5; only one of abstract, default, or static permitted\n" + "----------\n" + "6. ERROR in I.java (at line 7)\n" + " default static void foo6() {}\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo6; only public, abstract and strictfp are permitted\n" + + "Illegal combination of modifiers for the interface method foo6; only one of abstract, default, or static permitted\n" + "----------\n"); } @@ -230,12 +240,12 @@ public class InterfaceMethodsTest extends AbstractComparableTest { "1. ERROR in I.java (at line 4)\n" + " public abstract default void foo2() {}\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo2; only public, abstract and strictfp are permitted\n" + + "Illegal combination of modifiers for the interface method foo2; only one of abstract, default, or static permitted\n" + "----------\n" + "2. ERROR in I.java (at line 5)\n" + " default abstract void foo3() {}\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo3; only public, abstract and strictfp are permitted\n" + + "Illegal combination of modifiers for the interface method foo3; only one of abstract, default, or static permitted\n" + "----------\n" + "3. ERROR in I.java (at line 6)\n" + " void foo4() { }\n" + @@ -245,7 +255,7 @@ public class InterfaceMethodsTest extends AbstractComparableTest { "4. ERROR in I.java (at line 7)\n" + " abstract static default void foo5() {}\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo5; only public, abstract and strictfp are permitted\n" + + "Illegal combination of modifiers for the interface method foo5; only one of abstract, default, or static permitted\n" + "----------\n"); } @@ -1354,17 +1364,17 @@ public class InterfaceMethodsTest extends AbstractComparableTest { "2. ERROR in I.java (at line 4)\n" + " public static default void foo2 () {};\n" + " ^^^^^^^\n" + - "Illegal modifier for the interface method foo2; only public, abstract and strictfp are permitted\n" + + "Illegal combination of modifiers for the interface method foo2; only one of abstract, default, or static permitted\n" + "----------\n" + "3. ERROR in I.java (at line 5)\n" + " abstract static void foo3();\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo3; only public & abstract are permitted\n" + + "Illegal combination of modifiers for the interface method foo3; only one of abstract, default, or static permitted\n" + "----------\n" + "4. ERROR in I.java (at line 6)\n" + " abstract static void foo4() {}\n" + " ^^^^^^\n" + - "Illegal modifier for the interface method foo4; only public & abstract are permitted\n" + + "Illegal combination of modifiers for the interface method foo4; only one of abstract, default, or static permitted\n" + "----------\n"); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780 @@ -2039,4 +2049,37 @@ public class InterfaceMethodsTest extends AbstractComparableTest { }, "In B.set(CharSequence)"); } + + // test for different error messages in modifiers. + public void test400977() { + runNegativeTest( + new String[] { + "I.java", + "public interface I {\n" + + " default abstract void foo();\n" + + " public abstract default strictfp final void bar();" + + "}\n"}, + "----------\n" + + "1. ERROR in I.java (at line 2)\n" + + " default abstract void foo();\n" + + " ^^^^^\n" + + "Illegal combination of modifiers for the interface method foo; only one of abstract, default, or static permitted\n" + + "----------\n" + + "2. ERROR in I.java (at line 3)\n" + + " public abstract default strictfp final void bar();}\n" + + " ^^^^^\n" + + "Illegal modifiers for the interface method bar; strictfp is not permitted for abstract interface methods\n" + + "----------\n" + + "3. ERROR in I.java (at line 3)\n" + + " public abstract default strictfp final void bar();}\n" + + " ^^^^^\n" + + "Illegal combination of modifiers for the interface method bar; only one of abstract, default, or static permitted\n" + + "----------\n" + + "4. ERROR in I.java (at line 3)\n" + + " public abstract default strictfp final void bar();}\n" + + " ^^^^^\n" + + "Illegal modifier for the interface method bar; only public, abstract, default, static and strictfp are permitted\n" + + "----------\n"); + } + } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java index e117f1f0d2..8bdc3b68de 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java @@ -2989,7 +2989,7 @@ public void test090() { "3. ERROR in X.java (at line 4)\n" + " public volatile void foo() {}\n" + " ^^^^^\n" + - "Illegal modifier for the method foo; only public, protected, private, static, final, abstract, synchronized, strictfp & native are permitted\n" + + "Illegal modifier for the method foo; only public, protected, private, abstract, static, final, synchronized, native & strictfp are permitted\n" + "----------\n" ); } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java index 6fac35dffa..f52ea75d66 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java @@ -1693,7 +1693,7 @@ void setSourceStart(int sourceStart); // default methods: /** @since 3.9 BETA_JAVA8 */ - int IllegalModifierForInterfaceDefaultMethod = MethodRelated + 1050; + int IllegalModifierForInterfaceMethod18 = MethodRelated + 1050; /** @since 3.9 BETA_JAVA8 */ int DefaultMethodOverridesObjectMethod = MethodRelated + 1051; @@ -1708,6 +1708,10 @@ void setSourceStart(int sourceStart); int SuperAccessCannotBypassDirectSuper = TypeRelated + 1054; /** @since 3.9 BETA_JAVA8 */ int SuperCallCannotBypassOverride = MethodRelated + 1055; + /** @since 3.9 BETA_JAVA8 */ + int IllegalModifierCombinationForInterfaceMethod = MethodRelated + 1056; + /** @since 3.9 BETA_JAVA8 */ + int IllegalAbstractStrictfpModifierCombinationForInterfaceMethod = MethodRelated + 1057; /** * External problems -- These are problems defined by other plugins diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java index d1e06dfb62..843981786f 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java @@ -179,10 +179,22 @@ private void checkAndSetModifiersForMethod(MethodBinding methodBinding) { if (declaringClass.isInterface()) { int expectedModifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract; boolean isDefaultMethod = (modifiers & ExtraCompilerModifiers.AccDefaultMethod) != 0; // no need to check validity, is done by the parser + boolean reportIllegalModifierCombination = false; + boolean isJDK18orGreater = false; if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8 && !declaringClass.isAnnotationType()) { + expectedModifiers |= ClassFileConstants.AccStrictfp + | ExtraCompilerModifiers.AccDefaultMethod | ClassFileConstants.AccStatic; + isJDK18orGreater = true; if (!methodBinding.isAbstract()) { - expectedModifiers |= ClassFileConstants.AccStrictfp - | (isDefaultMethod ? ExtraCompilerModifiers.AccDefaultMethod : ClassFileConstants.AccStatic); + reportIllegalModifierCombination = isDefaultMethod && methodBinding.isStatic(); + } else { + reportIllegalModifierCombination = isDefaultMethod || methodBinding.isStatic(); + if (methodBinding.isStrictfp()) { + problemReporter().illegalAbstractModifierCombinationForMethod((AbstractMethodDeclaration) this.referenceContext); + } + } + if (reportIllegalModifierCombination) { + problemReporter().illegalModifierCombinationForInterfaceMethod((AbstractMethodDeclaration) this.referenceContext); } // Kludge - The AccDefaultMethod bit is outside the lower 16 bits and got removed earlier. Putting it back. if (isDefaultMethod) { @@ -193,7 +205,7 @@ private void checkAndSetModifiersForMethod(MethodBinding methodBinding) { if ((declaringClass.modifiers & ClassFileConstants.AccAnnotation) != 0) problemReporter().illegalModifierForAnnotationMember((AbstractMethodDeclaration) this.referenceContext); else - problemReporter().illegalModifierForInterfaceMethod((AbstractMethodDeclaration) this.referenceContext, isDefaultMethod); + problemReporter().illegalModifierForInterfaceMethod((AbstractMethodDeclaration) this.referenceContext, isJDK18orGreater); } return; } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java index 1ac82209b0..d4af206f88 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java @@ -2442,6 +2442,15 @@ public void illegalAbstractModifierCombinationForMethod(ReferenceBinding type, A methodDecl.sourceStart, methodDecl.sourceEnd); } +public void illegalAbstractModifierCombinationForMethod(AbstractMethodDeclaration methodDecl) { + String[] arguments = new String[] {new String(methodDecl.selector)}; + this.handle( + IProblem.IllegalAbstractStrictfpModifierCombinationForInterfaceMethod, + arguments, + arguments, + methodDecl.sourceStart, + methodDecl.sourceEnd); +} public void illegalAccessFromTypeVariable(TypeVariableBinding variable, ASTNode location) { if ((location.bits & ASTNode.InsideJavadoc)!= 0) { javadocInvalidReference(location.sourceStart, location.sourceEnd); @@ -2568,6 +2577,16 @@ public void illegalModifierCombinationFinalVolatileForField(ReferenceBinding typ fieldDecl.sourceStart, fieldDecl.sourceEnd); } +public void illegalModifierCombinationForInterfaceMethod(AbstractMethodDeclaration methodDecl) { + String[] arguments = new String[] {new String(methodDecl.selector)}; + this.handle( + IProblem.IllegalModifierCombinationForInterfaceMethod, + arguments, + arguments, + methodDecl.sourceStart, + methodDecl.sourceEnd); +} + public void illegalModifierForAnnotationField(FieldDeclaration fieldDecl) { String name = new String(fieldDecl.name); this.handle( @@ -2685,12 +2704,12 @@ public void illegalModifierForInterfaceField(FieldDeclaration fieldDecl) { fieldDecl.sourceStart, fieldDecl.sourceEnd); } -public void illegalModifierForInterfaceMethod(AbstractMethodDeclaration methodDecl, boolean isDefaultMethod) { +public void illegalModifierForInterfaceMethod(AbstractMethodDeclaration methodDecl, boolean isJDK18orGreater) { // cannot include parameter types since they are not resolved yet // and the error message would be too long this.handle( - isDefaultMethod - ? IProblem.IllegalModifierForInterfaceDefaultMethod + isJDK18orGreater + ? IProblem.IllegalModifierForInterfaceMethod18 : IProblem.IllegalModifierForInterfaceMethod, new String[] { new String(methodDecl.selector) diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties index 88c5c2a20f..f2b733358b 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties @@ -273,8 +273,8 @@ 301 = Duplicate modifier for the type {0} 302 = Illegal modifier for the class {0}; only public, abstract & final are permitted 303 = Illegal modifier for the interface {0}; only public & abstract are permitted -304 = Illegal modifier for the member class {0}; only public, protected, private, static, abstract & final are permitted -305 = Illegal modifier for the member interface {0}; only public, protected, private, static & abstract are permitted +304 = Illegal modifier for the member class {0}; only public, protected, private, abstract, static & final are permitted +305 = Illegal modifier for the member interface {0}; only public, protected, private, abstract & static are permitted 306 = Illegal modifier for the local class {0}; only abstract or final is permitted 307 = Access restriction: {0} 308 = The class {0} can be either abstract or final, not both @@ -332,7 +332,7 @@ 355 = Duplicate method {0}({2}) in type {1} 356 = Illegal modifier for parameter {0}; only final is permitted 357 = Duplicate modifier for the method {1} in type {0} -358 = Illegal modifier for the method {0}; only public, protected, private, static, final, abstract, synchronized, strictfp & native are permitted +358 = Illegal modifier for the method {0}; only public, protected, private, abstract, static, final, synchronized, native & strictfp are permitted 359 = Illegal modifier for the interface method {0}; only public & abstract are permitted 360 = The method {1} in type {0} can only set one of public / protected / private 361 = The method {1} cannot be declared static; static methods can only be declared in a static or top level type @@ -578,7 +578,7 @@ 601 = Extended dimensions are illegal in an annotation attribute declaration 602 = Package annotations must be in file package-info.java 603 = Illegal modifier for the annotation type {0}; only public & abstract are permitted -604 = Illegal modifier for the member annotation type {0}; only public, protected, private, static & abstract are permitted +604 = Illegal modifier for the member annotation type {0}; only public, protected, private, abstract & static are permitted 605 = Invalid type {0} for the annotation attribute {2}.{1}; only primitive type, String, Class, annotation, enumeration are permitted or 1-dimensional arrays thereof 606 = Cycle detected: the annotation type {0} cannot contain attributes of the annotation type itself 607 = Cycle detected: a cycle exists between annotation attributes of {0} and {1} @@ -787,12 +787,14 @@ # Default methods: # variant of 359: -1050 = Illegal modifier for the interface method {0}; only public, abstract and strictfp are permitted +1050 = Illegal modifier for the interface method {0}; only public, abstract, default, static and strictfp are permitted 1051 = A default method cannot override a method from java.lang.Object 1052 = The default method {0} inherited from {1} conflicts with another method inherited from {2} 1053 = Duplicate default methods named {0} with the parameters ({1}) and ({2}) are inherited from the types {3} and {4} 1054 = Illegal reference to super type {0}, cannot bypass the more specific direct super type {1} 1055 = Illegal reference to super method {0} from type {1}, cannot bypass the more specific override from type {2} +1056 = Illegal combination of modifiers for the interface method {0}; only one of abstract, default, or static permitted +1057 = Illegal modifiers for the interface method {0}; strictfp is not permitted for abstract interface methods ### ELABORATIONS ## Access restrictions |