Project: JDT
Bug 157468 [clean up] Overlapping text edits when formating code/comment
Reported: 2006-09-15 09:59:56 | Status: resolved fixed

Given: package test1; public class E1 { private void bar(boolean bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) { if (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) { // a b c d e f g h i j k final String s = ""; } } } 1. Eclipse formatter settings 2. Clean Ups: Format source code Format single line comments 3. Run clean up on E1 Is: org.eclipse.text.edits.MalformedTreeException: Overlapping text edits at org.eclipse.text.edits.TextEdit$InsertionComparator.compare(TextEdit.java:119) at java.util.Collections.indexedBinarySearch(Collections.java:322) at java.util.Collections.binarySearch(Collections.java:310) at org.eclipse.text.edits.TextEdit.computeInsertionIndex(TextEdit.java:793) at org.eclipse.text.edits.TextEdit.internalAdd(TextEdit.java:778) at org.eclipse.text.edits.TextEdit.addChild(TextEdit.java:333) at org.eclipse.jdt.internal.corext.refactoring.changes.TextChangeCompatibility.insert(TextChangeCompatibility.java:85) at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.mergeTextChanges(CleanUpRefactoring.java:768) at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.access$2(CleanUpRefactoring.java:724) at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring$CleanUpASTRequestor.calculateSolutions(CleanUpRefactoring.java:219) at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring$CleanUpASTRequestor.acceptAST(CleanUpRefactoring.java:186) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:712) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:466) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:707) at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring$CleanUpParser.createASTs(CleanUpRefactoring.java:304) at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring$CleanUpFixpointIterator.next(CleanUpRefactoring.java:383) at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.cleanUpProject(CleanUpRefactoring.java:598) at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.checkFinalConditions(CleanUpRefactoring.java:552) at org.eclipse.ltk.core.refactoring.Refactoring.checkAllConditions(Refactoring.java:160) at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper$Operation.run(RefactoringExecutionHelper.java:76) at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:720) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4022) at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java