Community
Participate
Working Groups
From a user on the newsgroup. Post title: crash on renaming plugin (R1.0, build137) Author: Paul T. Keyser Date: 2-JAN-2002, 09:22 EST "First, I renamed the project (in Packages View); all fine. Next, I renamed the plugin itself (i.e., in the plugin manifest editor, I changed the "Plugin Name"); all fine. Third, I renamed a package within the plugin: while the rename dialog was active and I was typing, an error-message popped up, directing me to the error log, which contained the following stack traces; trying to rename the project again resulted in the destruction (?) of the package (now it's just listed as a folder). (message: <empty>) java.lang.IllegalArgumentException: at org.eclipse.core.runtime.Path.removeFirstSegments(Path.java(Compiled Code)) at org.eclipse.core.runtime.Path.removeFirstSegments(Path.java(Compiled Code)) at org.eclipse.core.runtime.Path.removeFirstSegments(Path.java(Compiled Code)) at org.eclipse.jdt.internal.core.JavaProject.canonicalizedPath(JavaProject.java(Com piled Code)) at org.eclipse.jdt.internal.core.JavaProject.findPackageFragmentRoot(JavaProject.ja va:299) at org.eclipse.jdt.internal.ui.reorg.PackageFragmentRootNamingPolicy.isValidNewName (PackageFragmentRootNamingPolicy.java:40) at org.eclipse.jdt.internal.ui.reorg.RenameAction$1.isValid(RenameAction.java:144) at org.eclipse.jface.dialogs.InputDialog.validateInput(InputDialog.java:214) at org.eclipse.jface.dialogs.InputDialog$1.modifyText(InputDialog.java:145) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:177) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:1633) at org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:2422) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.CallWindowProc(Native Method) at org.eclipse.swt.widgets.Text.callWindowProc(Text.java:170) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java:536) at org.eclipse.jface.window.Window.open(Window.java:523) at org.eclipse.jdt.internal.ui.reorg.RenameAction.renameElement(RenameAction.java:1 50) at org.eclipse.jdt.internal.ui.reorg.RenameAction.doActionPerformed(RenameAction.ja va:88) at org.eclipse.jdt.internal.ui.reorg.ReorgAction.run(ReorgAction.java:131) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionCont ributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContribu tionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem. java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(Actio nContributionItem.java:47) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:656) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:81 5) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:433) at org.eclipse.core.launcher.Main.main(Main.java:306)"
The IllegalArgumentException from Path is caused if the argument to removeFirstSegments() is negative. The caller (JavaProject#canonicalizedPath), doesn't seem to check for this. May have been fixed since 1.0, but the code in 2.0 doesn't seem to guard against this case.
On the newsgroup, John Arthorne asked: "In particular, it might be interesting to know the project location, and the old and new project/package names involved in the rename operations. " Sorry, don't recall the two names (nothing special about either: I think it might have been OneToolToRuleThemAll ==>> Consoler) -- have blown away and recreated the plugin; Location: eclipse/workspace/<nameofproject> (i.e., default, no?).
rolarenfan: Can you reproduce it with a build 20020115, we released some protection in it for this one problem which we cannot reproduce so far.
Paul - was this on Linux ?
Sorry not to have said before -- Win2K (R1.0, build 137) (BTW, I am using the JDK supplied with the original download of R1.0, build 137, which is 1.3)
*** This bug has been marked as a duplicate of 7920 ***