Project: JDT
Bug 50904 IllegalArgumentException during refactoring
Reported: 2004-01-29 15:01:51 | Status: resolved fixed

build i0129, winxp, j9sc20031212 - create package /org.eclipse.core.runtime.compatibility/src-runtime/org.eclipse.core.runtime - in packages explorer, select org.eclipse.core.runtime.Preferences - Refactor -> move - destination is new package - Preview In the Preview, there were a lot (maybe 12?) classes selected but there wasn't any differences in the compare. I expanded one class and it had "updated imports". I selected that line (not sure if it was the line or the checkbox) and I got the following error in my log file. !ENTRY org.eclipse.core.runtime 4 2 Jan 29, 2004 14:50:25.641 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.runtime". !STACK 0 java.lang.IllegalArgumentException: at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java) at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java) at org.eclipse.core.runtime.Status.setMessage(Status.java:156) at org.eclipse.core.runtime.Status.<init>(Status.java:75) at org.eclipse.jdt.internal.corext.refactoring.changes.Changes.asCoreException(Changes.java:25) at org.eclipse.jdt.internal.corext.refactoring.changes.TextChange.getContent(TextChange.java:655) at org.eclipse.jdt.internal.corext.refactoring.changes.TextChange.getCurrentContent(TextChange.java:402) at org.eclipse.jdt.internal.ui.refactoring.TextChangePreviewViewer.setInput(TextChangePreviewViewer.java:155) at org.eclipse.jdt.internal.ui.refactoring.TextEditChangeElement.feedInput(TextEditChangeElement.java:68) at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.showPreview(PreviewWizardPage.java:387) at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.access$2(PreviewWizardPage.java:366) at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage$2.selectionChanged(PreviewWizardPage.java:357) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java) at org.eclipse.core.runtime.Platform.run(Platform.java) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1310) at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:666) at org.eclipse.jface.viewers.CheckboxTreeViewer.handleSelect(CheckboxTreeViewer.java:261) at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:690) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:178) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java) at org.eclipse.jface.window.Window.runEventLoop(Window.java) at org.eclipse.jface.window.Window.open(Window.java:566) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:56) at org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgMoveAction.startRefactoring(ReorgMoveAction.java:135) at org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgMoveAction.run(ReorgMoveAction.java:119) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:212) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:188) at org.eclipse.jdt.ui.actions.MoveAction.run(MoveAction.java:123) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:212) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:188) at org.eclipse.jface.action.Action.runWithEvent(Action.java:881) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:536) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1530) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1506) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:265) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:47) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:221) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:101) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41) at java.lang.reflect.Method.invoke(Method.java:386) at org.eclipse.core.launcher.Main.basicRun(Main.java:279) at org.eclipse.core.launcher.Main.run(Main.java:742) at org.eclipse.core.launcher.Main.main(Main.java:581)

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/Changes.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/TextChange.java org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PreviewWizardPage.java