This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 42238 - Rename package works incorrectly
Summary: Rename package works incorrectly
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords:
: 43541 45298 (view as bug list)
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-04-21 09:51 UTC by Jaromir Uhrik
Modified: 2007-04-03 18:02 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaromir Uhrik 2004-04-21 09:51:59 UTC
[2004041918; j2sdk1.4.2_03]
1. Create new J2SE Project
2. Main.java is created in com.myapp by default
3. Invoke popup menu on com.myapp and select Rename...
4. It is not possible to change 'com', only
'myapp' is editable.

It is not possible to change the prefix of the
package anymore, that is why P2.
Comment 1 Jesse Glick 2004-04-21 16:33:20 UTC
Should presumably be fixed as part of the PackageChildren rewrite.

Petr please make sure there are *thorough* unit tests for this class.
It is very important; and it should be simple to test it.
Comment 2 Petr Hrebejk 2004-05-03 13:30:56 UTC
Currently works as designed. We may change it later. However lowering
to P3 - does not need change in APIs and has simple workaround. Go to
files tab and rename the folder.
Comment 3 Petr Hrebejk 2004-05-21 11:03:57 UTC
Currently disabled
Comment 4 Petr Hrebejk 2004-05-21 11:04:29 UTC
*** Issue 43541 has been marked as a duplicate of this issue. ***
Comment 5 Petr Hrebejk 2004-06-10 11:10:18 UTC
OK the rename action was repaced by the refactoring operation but it
seems to suffer the same bug. User is only allowed to rename the last
part of the packagename.
Comment 6 Jan Becicka 2004-06-10 13:05:19 UTC
It is correct behavior.
Rename refactoring of e.g. "org.openide.filesystems" to
"com.tonda.franta.alois" is hardly definable operation. What to do
with files in "org" package? What to do with files in "org.openide"
package?

Closing as wontfix. If you still request such feature, please reopen
this issue as feature.
Comment 7 Jan Becicka 2004-06-21 17:00:04 UTC
*** Issue 45298 has been marked as a duplicate of this issue. ***
Comment 8 ehucka 2004-06-22 08:45:38 UTC
I think you are not right Honza. If I have classes e.g.
org.openide.fs.File, org.Data, org.openide.Main and I invoke Rename
package refactoring on org.openide.fs (change to com.netbeans.fs) I
assume that the class org.openide.fs.File will be repackaged (moved to
com.netbeans.fs.File) and classes org.Data and org.openide.Main will
stay as they are. It is easy.
Packages "org" and "org.openide" don't have any logical association
with "org.openide.fs". If we have fully logical view - Project View we
should have fully logical actions on it.

Users will be very confused. They will see full named package nodes
and they can only change their "suffixies".

Switching to file view is not solution. I can say to all editor bugs
that workaround is to switch to plain text or to vi.:)
Comment 9 Jan Becicka 2004-06-29 17:34:11 UTC
Fixed.
Checking in org/netbeans/modules/refactoring/api/Bundle.properties;
/cvs/refactoring/src/org/netbeans/modules/refactoring/api/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.5; previous revision: 1.4
done
Checking in org/netbeans/modules/refactoring/api/ChangeParameters.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/api/ChangeParameters.java,v
 <--  ChangeParameters.java
new revision: 1.5; previous revision: 1.4
done
Checking in
org/netbeans/modules/refactoring/api/MoveClassRefactoring.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/api/MoveClassRefactoring.java,v
 <--  MoveClassRefactoring.java
new revision: 1.7; previous revision: 1.6
done
Checking in org/netbeans/modules/refactoring/api/RenameRefactoring.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/api/RenameRefactoring.java,v
 <--  RenameRefactoring.java
new revision: 1.11; previous revision: 1.10
done
Checking in org/netbeans/modules/refactoring/api/WhereUsedQuery.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/api/WhereUsedQuery.java,v
 <--  WhereUsedQuery.java
new revision: 1.7; previous revision: 1.6
done
Processing log script arguments...
More commits to come...
Checking in org/netbeans/modules/refactoring/api/ui/ParametersPanel.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/api/ui/ParametersPanel.java,v
 <--  ParametersPanel.java
new revision: 1.10; previous revision: 1.9
done
Processing log script arguments...
More commits to come...
Checking in
org/netbeans/modules/refactoring/ui/RefactoringOperationListener.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/ui/RefactoringOperationListener.java,v
 <--  RefactoringOperationListener.java
new revision: 1.6; previous revision: 1.5
done
Checking in org/netbeans/modules/refactoring/ui/RenameAction.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/ui/RenameAction.java,v
 <--  RenameAction.java
new revision: 1.8; previous revision: 1.7
done
Checking in org/netbeans/modules/refactoring/ui/RenameRefactoringUI.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/ui/RenameRefactoringUI.java,v
 <--  RenameRefactoringUI.java
new revision: 1.7; previous revision: 1.6
done
Comment 10 Jaromir Uhrik 2004-08-16 16:53:07 UTC
Verified - in 200408161051; jdk1.5.0-rc-b63.
Comment 11 Jaromir Uhrik 2004-08-16 17:05:40 UTC
v