Bug 563749 - [inline renaming] Renaming a resource to an already existing name logs an internal error
Summary: [inline renaming] Renaming a resource to an already existing name logs an int...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.16   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-30 08:04 EDT by Thomas Wolf CLA
Modified: 2020-05-30 15:00 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wolf CLA 2020-05-30 08:04:50 EDT
Error logged after trying inline rename in the project explorer on org.eclipse.jdt/notice.html trying to rename it to about.html:

org.eclipse.core.internal.resources.ResourceException(/org.eclipse.jdt/about.html)[374]: java.lang.Exception: Resource '/org.eclipse.jdt/about.html' already exists.
	at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
	at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
	at org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:309)
	at org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:296)
	at org.eclipse.core.internal.resources.Resource.checkMoveRequirements(Resource.java:385)
	at org.eclipse.core.internal.resources.Resource.assertMoveRequirements(Resource.java:195)
	at org.eclipse.core.internal.resources.Resource.move(Resource.java:1486)
	at org.eclipse.ltk.core.refactoring.resource.RenameResourceChange.perform(RenameResourceChange.java:118)
	at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281)
	at org.eclipse.ltk.internal.ui.refactoring.actions.RenameResourceHandler.performRename(RenameResourceHandler.java:108)
	at org.eclipse.ltk.internal.ui.refactoring.actions.RenameResourceHandler.execute(RenameResourceHandler.java:57)

Eclipse IDE for Eclipse Committers

Version: 2020-06 (4.16.0)
Build id: 20200507-0346
Comment 1 Thomas Wolf CLA 2020-05-30 08:09:31 EDT
RenameResourceAction only checks whether the new file name per se is valid and shows a dialog if not, but it doesn't check whether a resource with the new name already exists.

In the project explorer, the error is only logged; the rename fails (the resource is not renamed), but there's no other user feedback.

Just as a hint: the inline rename in the git repositories view for repository groups validates the user input on the fly, shows errors in a popup, and refuses to even try to execute the renaming if the input isn't valid.