Project: JDT
Bug 38480 Delete: AssertionFailedException when deleting field in code with errors
Reported: 2003-06-05 06:24:28 | Status: resolved fixed

20030604 1. Create Java project with Junit source 2. Open 'VectorTest.java' and remove the opening bracket from the compilation unit 3. select the first field in the outliner and press delete java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:313) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:263) at org.eclipse.jdt.internal.ui.refactoring.PerformRefactoringUtil.performRefactoring(PerformRefactoringUtil.java:53) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:371) at org.eclipse.jdt.internal.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:119) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:434) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog2.okPressed(RefactoringWizardDialog2.java:395) at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:256) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:423) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:848) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2034) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1741) at org.eclipse.jface.window.Window.runEventLoop(Window.java:583) at org.eclipse.jface.window.Window.open(Window.java:563) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:55) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteAction.startRefactoring(DeleteAction.java:124) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteAction.run(DeleteAction.java:109) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:191) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:169) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage.handleKeyReleased(JavaOutlinePage.java:1132) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage.access$6(JavaOutlinePage.java:1121) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$5.keyPressed(JavaOutlinePage.java:959) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:120) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:848) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2034) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1741) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1399) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1382) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:291) at org.eclipse.core.launcher.Main.run(Main.java:747) at org.eclipse.core.launcher.Main.main(Main.java:583) Caused by: org.eclipse.jdt.internal.corext.Assert$AssertionFailedException: assertion failed; at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:136) at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:121) at org.eclipse.jdt.internal.corext.textmanipulation.TextRange.<init>(TextRange.java:47) at org.eclipse.jdt.internal.corext.textmanipulation.SimpleTextEdit.<init>(SimpleTextEdit.java:37) at org.eclipse.jdt.internal.corext.textmanipulation.SimpleTextEdit.createDelete(SimpleTextEdit.java:33) at org.eclipse.jdt.internal.corext.dom.ASTRewriteAnalyzer.doTextRemove(ASTRewriteAnalyzer.java:144) at org.eclipse.jdt.internal.corext.dom.ASTRewriteAnalyzer.doTextRemoveAndVisit(ASTRewriteAnalyzer.java:153) at org.eclipse.jdt.internal.corext.dom.ASTRewriteAnalyzer$ListRewriter.rewriteList(ASTRewriteAnalyzer.java:305) at org.eclipse.jdt.internal.corext.dom.ASTRewriteAnalyzer.rewriteParagraphList(ASTRewriteAnalyzer.java:496) at org.eclipse.jdt.internal.corext.dom.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:926) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:154) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:1353) at org.eclipse.jdt.internal.corext.dom.ASTRewriteAnalyzer.doVisit(ASTRewriteAnalyzer.java:163) at org.eclipse.jdt.internal.corext.dom.ASTRewriteAnalyzer.visitList(ASTRewriteAnalyzer.java:616) at org.eclipse.jdt.internal.corext.dom.ASTRewriteAnalyzer.rewriteParagraphList(ASTRewriteAnalyzer.java:486) at org.eclipse.jdt.internal.corext.dom.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:846) at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:154) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:1353) at org.eclipse.jdt.internal.corext.dom.ASTRewrite.rewriteNode(ASTRewrite.java:124) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2$DeleteChangeCreator.addTextEditFromRewrite(DeleteRefactoring2.java:564) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2$DeleteChangeCreator.createDeleteChange(DeleteRefactoring2.java:497) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2$DeleteChangeCreator.createDeleteChange(DeleteRefactoring2.java:467) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2.checkInput(DeleteRefactoring2.java:152) at org.eclipse.jdt.internal.ui.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:65) at org.eclipse.jdt.internal.ui.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:100) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:138) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:302) ... 40 more

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTRewriteAnalyzer.java