### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java,v retrieving revision 1.88 diff -u -r1.88 ClassFileReader.java --- compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java 3 Mar 2009 20:10:25 -0000 1.88 +++ compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java 9 Mar 2009 17:06:43 -0000 @@ -51,6 +51,7 @@ private char[] enclosingTypeName; private char[][][] missingTypeNames; private int enclosingNameAndTypeIndex; + private char[] enclosingMethod; private static String printTypeModifiers(int modifiers) { java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream(); @@ -451,17 +452,20 @@ if (this.enclosingNameAndTypeIndex <= 0) { return null; } - // read the name - StringBuffer buffer = new StringBuffer(); + if (this.enclosingMethod == null) { + // read the name + StringBuffer buffer = new StringBuffer(); + + int nameAndTypeOffset = this.constantPoolOffsets[this.enclosingNameAndTypeIndex]; + int utf8Offset = this.constantPoolOffsets[u2At(nameAndTypeOffset + 1)]; + buffer.append(utf8At(utf8Offset + 3, u2At(utf8Offset + 1))); - int nameAndTypeOffset = this.constantPoolOffsets[this.enclosingNameAndTypeIndex]; - int utf8Offset = this.constantPoolOffsets[u2At(nameAndTypeOffset + 1)]; - buffer.append(utf8At(utf8Offset + 3, u2At(utf8Offset + 1))); - - utf8Offset = this.constantPoolOffsets[u2At(nameAndTypeOffset + 3)]; - buffer.append(utf8At(utf8Offset + 3, u2At(utf8Offset + 1))); - - return String.valueOf(buffer).toCharArray(); + utf8Offset = this.constantPoolOffsets[u2At(nameAndTypeOffset + 3)]; + buffer.append(utf8At(utf8Offset + 3, u2At(utf8Offset + 1))); + + this.enclosingMethod = String.valueOf(buffer).toCharArray(); + } + return this.enclosingMethod; } /* @@ -1072,6 +1076,7 @@ this.annotations[i].initialize(); } } + this.getEnclosingMethod(); reset(); } catch(RuntimeException e) { ClassFormatException exception = new ClassFormatException(e, this.classFileName);