Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329534

Summary: [rename] Rename packages should remove empty parent packages
Product: [Eclipse Project] JDT Reporter: Marvin Fröhlich <eclipse>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.6.1   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

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).