### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java,v retrieving revision 1.58 diff -u -r1.58 ConstantPool.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java 17 Sep 2008 09:08:39 -0000 1.58 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java 26 Jan 2009 16:30:11 -0000 @@ -999,4 +999,11 @@ this.currentIndex = 1; this.currentOffset = 0; } +public void resetForAttributeName(char[] attributeName, int constantPoolIndex, int constantPoolOffset) { + this.currentIndex = constantPoolIndex; + this.currentOffset = constantPoolOffset; + if (this.UTF8Cache.get(attributeName) >= constantPoolIndex) { + this.UTF8Cache.remove(attributeName); + } +} } 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.183 diff -u -r1.183 ClassFile.java --- compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 20 Nov 2008 16:32:30 -0000 1.183 +++ compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 26 Jan 2009 16:30:11 -0000 @@ -6507,6 +6507,8 @@ } int annotationAttributeOffset = this.contentsOffset; + int constantPOffset = this.constantPool.currentOffset; + int constantPoolIndex = this.constantPool.currentIndex; if (invisibleAnnotationsCounter != 0) { if (this.contentsOffset + 10 >= this.contents.length) { resizeContents(10); @@ -6546,10 +6548,14 @@ attributesNumber++; } else { this.contentsOffset = annotationAttributeOffset; + // reset the constant pool to its state before the clinit + this.constantPool.resetForAttributeName(AttributeNamesConstants.RuntimeInvisibleAnnotationsName, constantPoolIndex, constantPOffset); } } annotationAttributeOffset = this.contentsOffset; + constantPOffset = this.constantPool.currentOffset; + constantPoolIndex = this.constantPool.currentIndex; if (visibleAnnotationsCounter != 0) { if (this.contentsOffset + 10 >= this.contents.length) { resizeContents(10); @@ -6589,6 +6595,7 @@ attributesNumber++; } else { this.contentsOffset = annotationAttributeOffset; + this.constantPool.resetForAttributeName(AttributeNamesConstants.RuntimeVisibleAnnotationsName, constantPoolIndex, constantPOffset); } } return attributesNumber;