### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java,v retrieving revision 1.152 diff -u -r1.152 CodeStream.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 26 Apr 2007 02:51:05 -0000 1.152 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 5 Jul 2007 17:44:01 -0000 @@ -5872,6 +5872,16 @@ } } } +/** + * Remove all entries in pcToSourceMap table that are beyond this.position + */ +public void removeUnusedPcToSourceMapEntries() { + if (this.pcToSourceMapSize != 0) { + while (pcToSourceMap[pcToSourceMapSize - 2] > this.position) { + this.pcToSourceMapSize -= 2; + } + } +} public void removeVariable(LocalVariableBinding localBinding) { if (localBinding == null) return; if (localBinding.initializationCount > 0) { Index: compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java,v retrieving revision 1.9 diff -u -r1.9 BranchLabel.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java 21 Nov 2006 15:42:02 -0000 1.9 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java 5 Jul 2007 17:44:00 -0000 @@ -205,14 +205,6 @@ this.codeStream.position = (this.position -= 3); this.codeStream.classFileOffset -= 3; this.forwardReferenceCount--; - // also update the PCs in the related debug attributes - /* OLD CODE - int index = codeStream.pcToSourceMapSize - 1; - while ((index >= 0) && (codeStream.pcToSourceMap[index][1] == oldPosition)) { - codeStream.pcToSourceMap[index--][1] = position; - } - */ - // Beginning of new code if (this.codeStream.lastEntryPC == oldPosition) { this.codeStream.lastEntryPC = this.position; } @@ -233,6 +225,10 @@ } } } + if ((this.codeStream.generateAttributes & ClassFileConstants.ATTR_LINES) != 0) { + // we need to remove all entries that is beyond this.position inside the pcToSourcerMap table + this.codeStream.removeUnusedPcToSourceMapEntries(); + } } } for (int i = 0; i < this.forwardReferenceCount; i++) {