Bug 578878

Summary: [Refactoring] Move package in Project Explorer with hierarchical package presentation does not move subpackages
Product: [Eclipse Project] JDT Reporter: Dirk Steinkamp <Dirk.Steinkamp>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 Keywords: ui, usability
Version: 4.23   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard: stalebug

Description Dirk Steinkamp CLA 2022-02-21 14:40:43 EST
Given 
* Project Explorer in hierarchical package presentation
* a package structure like the following

  a +
    + b +
    |   + X.java
    |   + c +
    |       + Y.java
    |
    + d

When
* selecting package "b" 
* invoking the refactoring "Move"
* chosing "d" as destination

Then
all subpackages should be moved, and the resulting package structure should look like this:

  a +
    |
    + d +
        + b +
            + X.java
            + c +
                + Y.java


Instead 
the resulting package structure looks like this:

  a +
    + b +
    |   + c +
    |       + Y.java
    |
    + d +
        + b +
            + X.java

---------------------------------------------

Only the package "a.b" with all classes directly residing in it (here: X) gets moved to "a.d.b". This kind of makes sense when invoking the move-operation from a flat package presentation. But it confuses if used from a hierarchical package presentation.

Use case: we are currently moving a couple of classes/packages away from a project into a separate project for easier reuse. The behavior was quite confusing for us, and at first we didn't have a clue, so we took rescue to some Windows Explorer drag & drop-operation.



I think the move operation for packages should have a checkbox reading something like "also move subpackages", which should be checked by default when invoked from the package explorer with hierarchical package presentation (or maybe be the default anyhow). When this checkbox is checked all subpackages should be processed accordingly.


A workaround so far would be to select all subpackages that contain classes individually in the tree (which seems not intuitive to me), or switch to the flat presentation and select the individual packages there.
Comment 1 Eclipse Genie CLA 2024-02-21 19:04:32 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.