Project: JDT
Bug 80251 AssertionFailedException while creating RefactoringStatusEntry
Reported: 2004-12-06 05:55:28 | Status: resolved fixed

I200412011139 with ZRH plugin-export from 20041203_0932 I tried to 'Move Member Type to New File'. There was a potential match on the type to be moved to a new file in another CU from another package. After using Organize Import in that CU, such that the type reference resolved, the problem was gone. Reproducible with the following two CUs from different packages by invoking 'Move Member Type To New File' on B: package test; public class A { public static class B { } } package test2; public class C { public void foo() { B b= null; } } java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:303) at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.ja va:624) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java :621) at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1919 ) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(Refacto ringWizard.java:565) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSucc essorPage(RefactoringWizard.java:410) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.getStartingPage(Refa ctoringWizard.java:391) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.crea teContents(RefactoringWizardDialog2.java:523) at org.eclipse.jface.window.Window.create(Window.java:375) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:983) at org.eclipse.jface.window.Window.open(Window.java:685) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(R efactoringWizardOpenOperation.java:125) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(Ref actoringWizardOpenOperation.java:138) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.ac tivate(RefactoringStarter.java:40) at org.eclipse.jdt.ui.actions.ConvertNestedToTopAction.startRefactoring( ConvertNestedToTopAction.java:210) at org.eclipse.jdt.ui.actions.ConvertNestedToTopAction.run(ConvertNested ToTopAction.java:166) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(Select ionDispatchAction.java:216) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispa tchAction.java:188) at org.eclipse.jface.action.Action.runWithEvent(Action.java:989) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:555) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContri butionItem.java:505) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionC ontributionItem.java:419) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:814) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2803) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2448) at org.eclipse.jdt.internal.ui.actions.QuickMenuAction.run(QuickMenuActi on.java:77) at org.eclipse.jface.action.Action.runWithEvent(Action.java:989) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:188) at org.eclipse.ui.internal.commands.Command.execute(Command.java:130) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(Workben chKeyboard.java:445) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboar d.java:724) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(Workbe nchKeyboard.java:767) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindi ngs(WorkbenchKeyboard.java:536) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyb oard.java:479) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(Workbenc hKeyboard.java:221) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:752) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:813) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:838) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:823) at org.eclipse.swt.widgets.Control.traverse(Control.java:2734) at org.eclipse.swt.widgets.Control.translateMnemonic(Control.java:2575) at org.eclipse.swt.widgets.Composite.translateMnemonic(Composite.java:78 6) at org.eclipse.swt.widgets.Control.translateMnemonic(Control.java:2593) at org.eclipse.swt.widgets.Display.translateMnemonic(Display.java:3223) at org.eclipse.swt.widgets.Display.filterMessage(Display.java:766) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2444) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1579) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1550) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav a:282) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:10 2) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformAct ivator.java:220) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:185) at org.eclipse.core.launcher.Main.run(Main.java:710) at org.eclipse.core.launcher.Main.main(Main.java:694) Caused by: org.eclipse.ltk.internal.core.refactoring.AssertionFailedException: a ssertion failed: at org.eclipse.ltk.internal.core.refactoring.Assert.isTrue(Assert.java:1 02) at org.eclipse.ltk.internal.core.refactoring.Assert.isTrue(Assert.java:8 9) at org.eclipse.ltk.core.refactoring.RefactoringStatusEntry.<init>(Refact oringStatusEntry.java:108) at org.eclipse.ltk.core.refactoring.RefactoringStatusEntry.<init>(Refact oringStatusEntry.java:93) at org.eclipse.ltk.core.refactoring.RefactoringStatus.addEntry(Refactori ngStatus.java:533) at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine2$ RefactoringSearchCollector.acceptSearchMatch(RefactoringSearchEngine2.java:93) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.report(Mat chLocator.java:1319) at org.eclipse.jdt.internal.core.search.matching.TypeReferenceLocator.ma tchReportReference(TypeReferenceLocator.java:232) at org.eclipse.jdt.internal.core.search.matching.OrLocator.matchReportRe ference(OrLocator.java:195) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatc hing(MatchLocator.java:1588) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatc hing(MatchLocator.java:1797) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatc hing(MatchLocator.java:1655) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(Ma tchLocator.java:1253) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatc hes(MatchLocator.java:830) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatc hes(MatchLocator.java:869) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatc hes(MatchLocator.java:971) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatc hes(JavaSearchParticipant.java:94) at org.eclipse.jdt.internal.core.search.SearchBasicEngine.findMatches(Se archBasicEngine.java:196) at org.eclipse.jdt.internal.core.search.SearchBasicEngine.search(SearchB asicEngine.java:382) at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:512 ) at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine2. searchPattern(RefactoringSearchEngine2.java:311) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInnerToTopR efactoring.createTypeReferencesMapping(MoveInnerToTopRefactoring.java:671) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInnerToTopR efactoring.createChangeManager(MoveInnerToTopRefactoring.java:347) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInnerToTopR efactoring.checkFinalConditions(MoveInnerToTopRefactoring.java:276) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckCo nditionsOperation.java:84) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChan geOperation.java:114) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1676 ) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run( WorkbenchRunnableAdapter.java:58) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(Modal Context.java:105) Root exception: org.eclipse.ltk.internal.core.refactoring.AssertionFailedException: assertion fa iled: at org.eclipse.ltk.internal.core.refactoring.Assert.isTrue(Assert.java:1 02) at org.eclipse.ltk.internal.core.refactoring.Assert.isTrue(Assert.java:8 9) at org.eclipse.ltk.core.refactoring.RefactoringStatusEntry.<init>(Refact oringStatusEntry.java:108) at org.eclipse.ltk.core.refactoring.RefactoringStatusEntry.<init>(Refact oringStatusEntry.java:93) at org.eclipse.ltk.core.refactoring.RefactoringStatus.addEntry(Refactori ngStatus.java:533) at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine2$ RefactoringSearchCollector.acceptSearchMatch(RefactoringSearchEngine2.java:93) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.report(Mat chLocator.java:1319) at org.eclipse.jdt.internal.core.search.matching.TypeReferenceLocator.ma tchReportReference(TypeReferenceLocator.java:232) at org.eclipse.jdt.internal.core.search.matching.OrLocator.matchReportRe ference(OrLocator.java:195) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatc hing(MatchLocator.java:1588) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatc hing(MatchLocator.java:1797) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatc hing(MatchLocator.java:1655) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(Ma tchLocator.java:1253) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatc hes(MatchLocator.java:830) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatc hes(MatchLocator.java:869) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatc hes(MatchLocator.java:971) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatc hes(JavaSearchParticipant.java:94) at org.eclipse.jdt.internal.core.search.SearchBasicEngine.findMatches(Se archBasicEngine.java:196) at org.eclipse.jdt.internal.core.search.SearchBasicEngine.search(SearchB asicEngine.java:382) at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:512 ) at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine2. searchPattern(RefactoringSearchEngine2.java:311) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInnerToTopR efactoring.createTypeReferencesMapping(MoveInnerToTopRefactoring.java:671) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInnerToTopR efactoring.createChangeManager(MoveInnerToTopRefactoring.java:347) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInnerToTopR efactoring.checkFinalConditions(MoveInnerToTopRefactoring.java:276) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckCo nditionsOperation.java:84) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChan geOperation.java:114) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1676 ) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run( WorkbenchRunnableAdapter.java:58) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(Modal Context.java:105)

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