Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329534 - [rename] Rename packages should remove empty parent packages
Summary: [rename] Rename packages should remove empty parent packages
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-05 08:29 EDT by Marvin Fröhlich CLA
Modified: 2010-12-08 09:24 EST (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 Marvin Fröhlich CLA 2010-11-05 08:29:33 EDT
Build Identifier: 20100617-1415

I have a pacakge called
com.blah.blub

The pacakge "com.blah.blub" contains classes, "com" and "com.blah" are empty.

Now I refactor/rename the pacakge "com.blah.blub" to "org.blah.blub".

After the renaming the package "com" and "com.blah" will still exist and be empty.

It would be very useful, if these packages would be deleted, if they are empty AND I have enabled an appropriate checkbox in the refactoring dialog similar to the "rename subpacakges" option (e.g. "delete empty parent packages").

Additionally if I want to delete the package "com.blah" and have enabled hierarchical package representation in the Package Explorer, only the sub package "blah" is deleted while the package "com" remains untoughed.

Here it would be good to delete the whole package "com" including all subpackages, since I have selected this package subtree entry in the Package Explorer. At least make it an option in the delete dialog. Otherwise I have no chance to delete the whole package in one step without temporarily switching to another package representation or another view (like the Navigator).

These two issues are especially important, if I am using a version control system like SVN. If only part of what I actually wanted is performed in one step, I will need several commits/revisions, which is very annoying.

Reproducible: Always
Comment 1 Markus Keller CLA 2010-12-08 09:24:23 EST
Source to reproduce the setup:

package org.blah.blub;
public class Test {}


All of what you request works out of the box in an unshared project and in a CVS project.

It sounds like your team provider doesn't properly mark team-private resources with org.eclipse.core.resources.IResource.setTeamPrivateMember(boolean).