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 188686

Summary: Relax module naming restrictions
Product: platform Reporter: Jaroslav Tulach <jtulach>
Component: Module SystemAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: normal CC: apireviews, jglick
Priority: P3 Keywords: API, API_REVIEW_FAST
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Allow Java keywords and numbers in module names
Allow Java keywords
Simpler patch

Description Jaroslav Tulach 2010-07-15 08:18:19 UTC
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
Comment 1 Jaroslav Tulach 2010-07-15 08:24:35 UTC
Created attachment 100848 [details]
Allow Java keywords and numbers in module names
Comment 2 Jesse Glick 2010-07-15 13:41:33 UTC
#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.
Comment 3 Jesse Glick 2010-07-15 13:42:14 UTC
In apichanges, this is not an addition="yes".
Comment 4 Jaroslav Tulach 2010-07-15 14:46:51 UTC
OK, I'll do #1 only for now.
Comment 5 Jaroslav Tulach 2010-07-16 09:18:59 UTC
Created attachment 100876 [details]
Allow Java keywords
Comment 6 Jesse Glick 2010-07-16 20:50:59 UTC
Created attachment 100894 [details]
Simpler patch
Comment 7 Jaroslav Tulach 2010-07-21 08:02:15 UTC
Oh, regexp magic. OK, let's integrate tomorrow.
Comment 8 Jesse Glick 2010-07-22 13:10:50 UTC
core-main #2cd0a243339e
Comment 9 Quality Engineering 2010-07-23 03:06:30 UTC
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.
Comment 10 Jaroslav Tulach 2010-08-30 15:15:08 UTC
Backported to release691 clone as
http://hg.netbeans.org/release691/rev/1943a57403ac