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]
Oh, regexp magic. OK, let's integrate tomorrow.
Integrated into 'main-golden', will be available in build *201007230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jesse Glick <email@example.com>
Log: #188686: permit Java identifiers as path components in module code name bases.
Backported to release691 clone as