Bug 12739 - Exception when cancelling rename of .java file
Summary: Exception when cancelling rename of .java file
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Adam Kiezun CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-03 17:19 EST by Peter Burka CLA
Modified: 2002-04-04 03:36 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Burka CLA 2002-04-03 17:19:35 EST
Build 20020321

I tried to rename a .java file by right clicking on in the Packages view and 
selecting 'Rename'.

I changed the name from 'Foo.java' to 'Foo.txt'.  But this wasn't valid, so an 
error message appeared telling me I couldn't use that name.  So I 
pressed 'Cancel'.

At that point an error dialog appeared with the following exception:

java.lang.IllegalArgumentException: Compilation unit name must end with .java.
	at org.eclipse.jdt.internal.core.CompilationUnit.<init>
(CompilationUnit.java(Compiled Code))
	at org.eclipse.jdt.internal.core.PackageFragment.getCompilationUnit
(PackageFragment.java(Compiled Code))
	at 
org.eclipse.jdt.internal.corext.refactoring.rename.RenameCompilationUnitRefactor
ing.getNewElement(RenameCompilationUnitRefactoring.java:47)
	at 
org.eclipse.jdt.internal.ui.refactoring.RefactoringSupportFactory$RenameSupport.
rename(RefactoringSupportFactory.java:77)
	at org.eclipse.jdt.internal.ui.reorg.RenameAction.run
(RenameAction.java:37)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java(Compiled Code))
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java(Compiled Code))
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java(Compiled Code))
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.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:705)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:777)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:196)
	at org.eclipse.core.launcher.Main.run(Main.java:555)
	at org.eclipse.core.launcher.Main.main(Main.java:396)

It looks like the rename dialog is still trying to do part of the rename 
operation even though I pressed cancel!

This seems to be completely repeatable.
Comment 1 Adam Kiezun CLA 2002-04-04 03:36:25 EST
just checked - it was fixed before 20020326