Index: compiler/org/eclipse/jdt/core/compiler/IProblem.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java,v retrieving revision 1.118 diff -u -r1.118 IProblem.java --- compiler/org/eclipse/jdt/core/compiler/IProblem.java 29 Nov 2004 17:57:27 -0000 1.118 +++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 29 Nov 2004 22:28:34 -0000 @@ -1019,6 +1019,8 @@ int IllegalQualifiedEnumConstantLabel = FieldRelated + 755; /** @since 3.1 */ int CannotExtendEnum = TypeRelated + 756; + /** @since 3.1 */ + int ExplicitConstructorCallCannotBeUsedInEnum = MethodRelated + 757; /** * Var args Index: compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java,v retrieving revision 1.38 diff -u -r1.38 ExplicitConstructorCall.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java 2 Nov 2004 14:14:03 -0000 1.38 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java 29 Nov 2004 22:28:34 -0000 @@ -264,6 +264,10 @@ return; } + if (!isImplicitSuper() && receiverType.erasure().id == T_JavaLangEnum) { + scope.problemReporter().explicitConstructorCallCannotBeUsedInEnum(this); + return; + } // qualification should be from the type of the enclosingType if (qualification != null) { if (accessMode != Super) { Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v retrieving revision 1.200 diff -u -r1.200 ProblemReporter.java --- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 29 Nov 2004 17:57:27 -0000 1.200 +++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 29 Nov 2004 22:28:34 -0000 @@ -1083,6 +1083,14 @@ reference.sourceStart, reference.sourceEnd); } +public void explicitConstructorCallCannotBeUsedInEnum(ExplicitConstructorCall constructorCall) { + this.handle( + IProblem.ExplicitConstructorCallCannotBeUsedInEnum, + NoArgument, + NoArgument, + constructorCall.sourceStart, + constructorCall.sourceEnd); +} public void expressionShouldBeAVariable(Expression expression) { this.handle( IProblem.ExpressionShouldBeAVariable, Index: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v retrieving revision 1.143 diff -u -r1.143 messages.properties --- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 29 Nov 2004 17:57:29 -0000 1.143 +++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 29 Nov 2004 22:28:34 -0000 @@ -494,6 +494,7 @@ 754 = The enum {1} already defines the method {0}({2}) implicitly 755 = Cannot qualify the name of the enum constant {0} in a case label 756 = The type {1} may not subclass {0} explicitly +757 = Explicit constructor call is not allowed in an enum constructor ### VARARGS