Bug 7221 - IllegalArgumentException renaming package
Summary: IllegalArgumentException renaming package
Status: RESOLVED DUPLICATE of bug 7920
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-02 15:14 EST by John Arthorne CLA
Modified: 2006-06-19 09:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2002-01-02 15:14:38 EST
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)"
Comment 1 John Arthorne CLA 2002-01-02 15:16:43 EST
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.
Comment 2 rolarenfan CLA 2002-01-02 16:27:31 EST
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?). 
Comment 3 Philipe Mulet CLA 2002-01-16 09:16:08 EST
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.
Comment 4 Philipe Mulet CLA 2002-01-23 06:59:49 EST
Paul - was this on Linux ?
Comment 5 rolarenfan CLA 2002-01-23 16:24:13 EST
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)
Comment 6 Jerome Lanneluc CLA 2002-01-24 06:56:15 EST

*** This bug has been marked as a duplicate of 7920 ***