Bug 312958

Summary: Moving an interface or class to a different package doesn't change it's package statement
Product: [Eclipse Project] JDT Reporter: Dean Schulze <dean_w_schulze>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P5 CC: Olivier_Thomann, remy.suen
Version: 3.6   
Target Milestone: 3.6 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dean Schulze CLA 2010-05-14 14:32:20 EDT
Build Identifier: 20100318-1801

Move an interface or class to a different package.  It's package declaration keeps the old value.

Reproducible: Always

Steps to Reproduce:
1.  See Details.
2.
3.
Comment 1 Remy Suen CLA 2010-05-14 14:40:25 EDT
(In reply to comment #0)
> Move an interface or class to a different package.  It's package declaration
> keeps the old value.

I just tried this on I20100429-1549. It works fine.
Comment 2 Olivier Thomann CLA 2010-05-14 16:59:06 EDT
Obviously we need more details.
Comment 3 Dean Schulze CLA 2010-05-17 09:49:22 EDT
In the Navigator right-click on a class or interface and select Move.  When the class or interface is moved the package definition retains the old (incorrect) package.

I vaguely remember this issue from before.  I believe the solution was to use the Package Explorer instead of the Navigator.

If the Navigator view can't properly move a class or interface the Move functionality should be disabled in Navigator.
Comment 4 Olivier Thomann CLA 2010-05-17 10:00:05 EDT
(In reply to comment #3)
> In the Navigator right-click on a class or interface and select Move.  When the
> class or interface is moved the package definition retains the old (incorrect)
> package.
> 
> I vaguely remember this issue from before.  I believe the solution was to use
> the Package Explorer instead of the Navigator.
> 
> If the Navigator view can't properly move a class or interface the Move
> functionality should be disabled in Navigator.
The nagivator moves files and folders. It has no knowledge of compilation unit or Java.

You do need to use the package explorer to do this.
Closing as INVALID.
Comment 5 Dean Schulze CLA 2010-05-17 23:14:34 EDT
If the navigator cannot move a class or interface without creating errors the Move functionality should be disabled for .class files in the compilation unit in Navigator.

This functionality is simply broken.
Comment 6 Olivier Thomann CLA 2010-05-18 10:37:19 EDT
(In reply to comment #5)
> If the navigator cannot move a class or interface without creating errors the
> Move functionality should be disabled for .class files in the compilation unit
> in Navigator.
> This functionality is simply broken.
The navigator has nothing to do with Java.
Use the package explorer to do this.
Closing as INVALID. No need to reopen.
Comment 7 Olivier Thomann CLA 2010-05-18 12:18:06 EDT
(In reply to comment #3)
> If the Navigator view can't properly move a class or interface the Move
> functionality should be disabled in Navigator.
To make it clear, the "Move" semantic is different in the navigator. There it simply means moving the file, whereas it means update the package declaration inside the package explorer.