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.
<apidef name="modules">Modules API</apidef>
</apidefs>
<changes>
<change id="Allow.Keywords">
<api name="modules"/>
<summary>Module names can contain java keywords</summary>
<version major="7" minor="19"/>
<date day="23" month="7" year="2010"/>
<author login="jtulach"/>
<compatibility semantic="compatible" modification="yes"/>
<description>
<p>
Naming rules for module code name bases are now relaxed.
The name of a module can contain a Java keyword like
<code>org.mysite.import.something</code>, etc.
</p>
</description>
<class package="org.openide.modules" name="Dependency"/>
<issue number="188686"/>
</change>
<change id="ClassLoader.findLibrary">
<summary>New native library lookup mechanism</summary>
Manifest-Version: 1.0
OpenIDE-Module: org.openide.modules
OpenIDE-Module-Localizing-Bundle: org/openide/modules/Bundle.properties
OpenIDE-Module-Specification-Version: 7.18
OpenIDE-Module-Specification-Version: 7.19
}
boolean expectingPath = true;
while (tok.hasMoreTokens()) {
if (expectingPath) {
expectingPath = false;
String nt = tok.nextToken();
if (!Utilities.isJavaIdentifier(nt) && !"enum".equals (nt)) { // NOI18N
if (!isJavaIdentifierOrNumber(nt, true)) {
throw new IllegalArgumentException("Bad package component in " + base); // NOI18N
} else {
private static boolean isJavaIdentifierOrNumber(String id, boolean requireLetter) {
if (id == null) {
return false;
if (id.equals("")) {
if (requireLetter) {
if (!(java.lang.Character.isJavaIdentifierStart(id.charAt(0)))) {
for (int i = 0; i < id.length(); i++) {
if (!(java.lang.Character.isJavaIdentifierPart(id.charAt(i)))) {
return true;
/** Parse dependencies from tags.
* @param type like Dependency.type
* @param body actual text of tag body; if <code>null</code>, returns nothing
super(name);
public void testAllowJavaKeywordsInModuleNames() throws Exception {
Set<Dependency> single = Dependency.create(Dependency.TYPE_MODULE, "acme.j2ee.webapp.import");
assertEquals("One item created: " + single, 1, single.size());
public void testForNumbersInModuleNamesAreDisallowed() throws Exception {
try {
Set<Dependency> single = Dependency.create(Dependency.TYPE_MODULE, "acme.2.webapp.importing");
fail("Shall throw an exception: " + single);
} catch (IllegalArgumentException ex) {
// fine
public void testForNumbersInModuleNamesAreDisallowed2() throws Exception {
Set<Dependency> single = Dependency.create(Dependency.TYPE_MODULE, "acme.2xyz.webapp.importing");
public void testParseModule() throws Exception {
Set singleton = Dependency.create(Dependency.TYPE_MODULE, "org.foo.bar/1 > 1.1");
assertTrue(singleton.size() == 1);