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.
Traditionally the module naming rules follow the Java package naming conventions. This works fine when building modules from scratch. However when one converts existing OSGi bundles, there are outstanding issues. The OSGi specification allows more relaxed names to be used. While some of these relaxed names clearly conflict with existing assumptions in the NetBeans Module System code (e.g. having "-" in the name will confuse the system), other restrictions are more than artificial. I propose to remove following: 1. allow java keywords. E.g. "org.myapp.import.other" shall be allowed in spite it contains a java keyword. 2. allow identifiers to start with number. E.g. "org.myapp.345.bundle" should be allowed
Created attachment 100848 [details] Allow Java keywords and numbers in module names
#1 seems harmless; #2 sounds dangerous to me - existing code might be looking for numbers. Anyway we cannot solve the '-' case, and there are sure to be other minor variants in what OSGi accepts vs. what NB accepts. So I suggest these relatively rare special cases be handled the same way as '-', by creating a NB-safe name using '_' in the OSGi compatibility layer. By the way, any change would need to be made in parallel at least in nb-module-project2.xsd and in BasicConfVisualPanel.
In apichanges, this is not an addition="yes".
OK, I'll do #1 only for now.
Created attachment 100876 [details] Allow Java keywords
Created attachment 100894 [details] Simpler patch
Oh, regexp magic. OK, let's integrate tomorrow.
core-main #2cd0a243339e
Integrated into 'main-golden', will be available in build *201007230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/2cd0a243339e User: Jesse Glick <jglick@netbeans.org> Log: #188686: permit Java identifiers as path components in module code name bases.
Backported to release691 clone as http://hg.netbeans.org/release691/rev/1943a57403ac