Bug 312958 - Moving an interface or class to a different package doesn't change it's package statement
Summary: Moving an interface or class to a different package doesn't change it's packa...
Status: CLOSED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P5 normal (vote)
Target Milestone: 3.6 RC1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 14:32 EDT by Dean Schulze CLA
Modified: 2010-05-18 12:18 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.