Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 188686 - Relax module naming restrictions
Relax module naming restrictions
Product: platform
Classification: Unclassified
Component: Module System
All All
: P3 (vote)
: 6.x
Assigned To: Jesse Glick
Depends on:
  Show dependency treegraph
Reported: 2010-07-15 08:18 UTC by Jaroslav Tulach
Modified: 2010-10-29 07:07 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT

Allow Java keywords and numbers in module names (4.33 KB, patch)
2010-07-15 08:24 UTC, Jaroslav Tulach
Details | Diff
Allow Java keywords (4.59 KB, patch)
2010-07-16 09:18 UTC, Jaroslav Tulach
Details | Diff
Simpler patch (4.74 KB, patch)
2010-07-16 20:50 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 (upload may still be in progress)
User: Jesse Glick <>
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

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo