### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java,v retrieving revision 1.156 diff -u -r1.156 TypeDeclaration.java --- compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java 13 Feb 2009 21:40:39 -0000 1.156 +++ compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java 18 Mar 2009 10:49:31 -0000 @@ -1016,7 +1016,8 @@ } } while ((current = current.enclosingType()) != null); } - this.maxFieldCount = 0; + // this.maxFieldCount might already be set + int localMaxFieldCount = 0; int lastVisibleFieldID = -1; boolean hasEnumConstants = false; FieldDeclaration[] enumConstantsWithoutBody = null; @@ -1057,7 +1058,7 @@ && TypeBinding.LONG == fieldBinding.type) { needSerialVersion = false; } - this.maxFieldCount++; + localMaxFieldCount++; lastVisibleFieldID = field.binding.id; break; @@ -1068,6 +1069,9 @@ field.resolve(field.isStatic() ? this.staticInitializerScope : this.initializerScope); } } + if (this.maxFieldCount < localMaxFieldCount) { + this.maxFieldCount = localMaxFieldCount; + } if (needSerialVersion) { this.scope.problemReporter().missingSerialVersion(this); } Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java,v retrieving revision 1.48 diff -u -r1.48 CodeSnippetClassFile.java --- eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java 7 Mar 2009 01:08:09 -0000 1.48 +++ eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java 18 Mar 2009 10:49:31 -0000 @@ -127,12 +127,7 @@ } // retrieve the enclosing one guaranteed to be the one matching the propagated flow info // 1FF9ZBU: LFCOM:ALL - Local variable attributes busted (Sanity check) - if (this.enclosingClassFile == null) { - this.codeStream.maxFieldCount = aType.scope.referenceType().maxFieldCount; - } else { - ClassFile outermostClassFile = outerMostEnclosingClassFile(); - this.codeStream.maxFieldCount = outermostClassFile.codeStream.maxFieldCount; - } + this.codeStream.maxFieldCount = aType.scope.outerMostClassScope().referenceType().maxFieldCount; } /** * INTERNAL USE-ONLY Index: compiler/org/eclipse/jdt/internal/compiler/ClassFile.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java,v retrieving revision 1.185 diff -u -r1.185 ClassFile.java --- compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 7 Mar 2009 00:59:05 -0000 1.185 +++ compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 18 Mar 2009 10:49:31 -0000 @@ -6915,12 +6915,7 @@ // retrieve the enclosing one guaranteed to be the one matching the propagated flow info // 1FF9ZBU: LFCOM:ALL - Local variable attributes busted (Sanity check) - if (this.enclosingClassFile == null) { - this.codeStream.maxFieldCount = aType.scope.referenceType().maxFieldCount; - } else { - ClassFile outermostClassFile = outerMostEnclosingClassFile(); - this.codeStream.maxFieldCount = outermostClassFile.codeStream.maxFieldCount; - } + this.codeStream.maxFieldCount = aType.scope.outerMostClassScope().referenceType().maxFieldCount; } private void initializeDefaultLocals(StackMapFrame frame,