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.
Summary: | Package name can be renamed to a name that contains a space | ||
---|---|---|---|
Product: | java | Reporter: | John Baker <jbaker> |
Component: | Unsupported | Assignee: | issues@java <issues> |
Status: | CLOSED FIXED | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Windows ME/2000 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
John Baker
2002-01-30 02:09:44 UTC
It is not possible to prevent from renaming folders to the names with spaces. I would suggest to change the dialog message when invalid Java package name is used for folder name. The warning could say something like: "The new name of package is not a valid Java package name. .... ". As the implementation of this dialog is in Java module, I am changing the component: core -> java. I would expect NB to recognize that I'm renaming a package, not a folder. Regardless, I think renaming a folder to a name that contains a space is a bad thing, it doesn't make any sense. The reason why it's bad is that I don't know of any Java programs that could compile. For a Web Module, if this type of folder is created in the WEB-INF/Classes directory then the Web module cannot compile. If any Java program resides in this type of package in the name then it can't compile either. I disagree that renaming a folder to have a space in the name is pointless. Under well-behaved OSes, a filename has no restriction on characters it can contain (except the path separator and sometimes null char - terminator). On Windows, giving spaced names is convenient for users, since folder names can be descriptive. The current IDE's design does not permit checking for valid package name, preventing the rename operation. I will implement Petr's suggestion to issue a warning afterwards. Note that there can be free-named folders (not packages) underneath the package structure - resources can be here, since ClassLoaders survive spaces in resource names, but classes can't be in such folders (since they are not packages). Fixed in trunk - a warning is issued after the package name has been changed to a non-identifier. /cvs/java/src/org/netbeans/modules/java/PackageHandler.java,v <-- PackageHandler.java new revision: 1.2; previous revision: 1.1 VERIFIED Resolved for 3.4.x or earlier, no new info since then -> closing. |