Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java,v retrieving revision 1.67 diff -u -r1.67 QualifiedAllocationExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java 1 Jun 2005 15:16:53 -0000 1.67 +++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java 13 Jun 2005 14:23:17 -0000 @@ -254,7 +254,9 @@ if (receiverType == null) { hasError = true; } else if (((ReferenceBinding) receiverType).isFinal() && this.anonymousType != null) { - if (!receiverType.isEnum()) { + if (receiverType.isEnum()) { + scope.problemReporter().cannotInstantiate(type, receiverType); + } else { scope.problemReporter().anonymousClassCannotExtendFinalClass(type, receiverType); } hasError = true; Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java,v retrieving revision 1.116 diff -u -r1.116 ClassScope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 8 Jun 2005 21:11:01 -0000 1.116 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 13 Jun 2005 14:23:17 -0000 @@ -491,6 +491,7 @@ modifiers |= AccAbstract; } } + modifiers |= AccFinal; } else { // detect abnormal cases for classes if (isMemberType) { // includes member types defined inside local types @@ -588,6 +589,9 @@ // set the modifiers int implicitValue = AccPublic | AccStatic | AccFinal | AccEnum; + if (fieldDecl.initialization instanceof QualifiedAllocationExpression) { + declaringClass.modifiers &= ~AccFinal; + } fieldBinding.modifiers|= implicitValue; return; }