Project: JDT
Bug 106127 [ccp] [refactoring] AssertionFailedException copying compilation unit
Reported: 2005-08-04 23:35:38 | Status: verified fixed

When copying a compilation unit i am getting an assertion failed exception. The error went away when i restarted eclipse. Spooky. Here is what i was doing at the time to get the error: 1. Copy compilation unit 2. Paste into the same package 3. Change the name when the rename dialog comes up org.eclipse.jdt.internal.corext.Assert$AssertionFailedException: assertion failed; at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:139) at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:124) at org.eclipse.jdt.internal.corext.refactoring.reorg.CreateCopyOfCompilationUnitChange.getReferences(CreateCopyOfCompilationUnitChange.java:160) at org.eclipse.jdt.internal.corext.refactoring.reorg.CreateCopyOfCompilationUnitChange.createChangeManager(CreateCopyOfCompilationUnitChange.java:132) at org.eclipse.jdt.internal.corext.refactoring.reorg.CreateCopyOfCompilationUnitChange.getCopiedFileSource(CreateCopyOfCompilationUnitChange.java:122) at org.eclipse.jdt.internal.corext.refactoring.reorg.CreateCopyOfCompilationUnitChange.getOldFile(CreateCopyOfCompilationUnitChange.java:104) at org.eclipse.jdt.internal.corext.refactoring.nls.changes.CreateFileChange.perform(CreateFileChange.java:132) at org.eclipse.jdt.internal.corext.refactoring.reorg.CreateCopyOfCompilationUnitChange.perform(CreateCopyOfCompilationUnitChange.java:69) at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:279) at org.eclipse.jdt.internal.corext.refactoring.changes.DynamicValidationStateChange.access$0(DynamicValidationStateChange.java:1) at org.eclipse.jdt.internal.corext.refactoring.changes.DynamicValidationStateChange$1.run(DynamicValidationStateChange.java:92) at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:718) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1719) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:3760) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:3717) at org.eclipse.jdt.internal.corext.refactoring.changes.DynamicValidationStateChange.perform(DynamicValidationStateChange.java:95) at org.eclipse.jdt.internal.corext.refactoring.reorg.JavaCopyProcessor$1.perform(JavaCopyProcessor.java:159) at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:279) at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:232) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1719) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1739) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:280) at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:106) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:197) at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper$Operation.run(RefactoringExecutionHelper.java:82) at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:718) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1719) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:3760) at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:346) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:291) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:447) at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper.perform(RefactoringExecutionHelper.java:131) at org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgCopyStarter.run(ReorgCopyStarter.java:70) at org.eclipse.jdt.internal.ui.refactoring.reorg.PasteAction$JavaElementAndResourcePaster.paste(PasteAction.java:435) at org.eclipse.jdt.internal.ui.refactoring.reorg.PasteAction.run(PasteAction.java:178) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:222) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:198) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:222) at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:117) at org.eclipse.core.commands.Command.execute(Command.java:311) at org.eclipse.core.commands.ParameterizedCommand.execute(ParameterizedCommand.java:396) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:459) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:781) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:828) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:550) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:493) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:117) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:917) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:867) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:852) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:880) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:876) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1190) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3135) at org.eclipse.swt.widgets.Tree.WM_CHAR(Tree.java:2431) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3038) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:2391) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3706) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1656) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2711) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/CreateCopyOfCompilationUnitChange.java