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 138049 - [Rename] Can't change case of a package name
Summary: [Rename] Can't change case of a package name
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: PC Windows ME/2000
: P4 blocker (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
: 146459 147109 155614 175359 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-24 05:09 UTC by mcaisse
Modified: 2016-07-07 07:17 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 mcaisse 2008-06-24 05:09:36 UTC
Attempting to change the case of a package name in either the Projects or Files window gives the error "Package <name>
already exists". One attempted work-around failed: I closed NB, changed the directory name in Windows, and reopened NB.
The package name was still shown in the wrong case. However, on adding an import that referred to that package, NB
entered the correct case (same case as displayed in the OS).

Changing the case of a file name works.
Comment 1 Jana Maleckova 2008-06-27 09:56:19 UTC
reassign to refactoring for evaluation
Comment 2 Jan Pokorsky 2008-07-29 14:48:55 UTC
It is MS Win related issue or better issue showing on filesystems not fully case sensitive. As a workaround you could
make 2 renames. First rename the package to '<target name>_' and next to '<target name>'.
Comment 3 mcaisse 2008-07-29 14:55:59 UTC
Yes, the issue only applies to Windows. However, NetBeans properly handles changing a file name from one case to another
on Windows. Therefore it should be able to handle changing a package name with similar logic. As the original report
shows, NetBeans is inconsistent in handling the case. In some scenarios, it recognizes the case displayed in the OS, in
others it does not. It should use consistent logic throughout.
Comment 4 Jan Pokorsky 2008-07-29 15:59:01 UTC
It is definitely a defect. In case of a package the new folder is created first, included files are moved and the origin
folder is deleted if there are no other packages using the folder.

Example:
1. You have packages 'a.b.c' and 'a.b.d'.
2. Rename package 'a.b.c' to 'a.B.c'
3. You should get packages 'a.B.c' and 'a.b.d' but it fails now on MS Win.

So on MS Win we should check if the new name is equal ignoring case before renaming.

In order to rename folder 'b' of both packages you can use the rename refactoring inside the Files view not the Packages
view. It will work on all systems since the folder is really renamed. Hopefully it is clearer now.
Comment 5 Peter Pis 2008-09-08 08:25:01 UTC
*** Issue 146459 has been marked as a duplicate of this issue. ***
Comment 6 Jan Pokorsky 2008-09-12 17:45:39 UTC
*** Issue 147109 has been marked as a duplicate of this issue. ***
Comment 7 Jan Pokorsky 2009-10-26 13:13:16 UTC
*** Issue 155614 has been marked as a duplicate of this issue. ***
Comment 8 Jan Pokorsky 2009-10-26 13:14:05 UTC
*** Issue 175359 has been marked as a duplicate of this issue. ***
Comment 9 Martin Balin 2016-07-07 07:17:49 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss