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.
Build: NetBeans IDE Dev (Build 201002110200) VM: Java HotSpot(TM) 64-Bit Server VM, 14.3-b01-101, Java(TM) SE Runtime Environment, 1.6.0_17-b04-248-10M3025 OS: Mac OS X User Comments: musilt2: created new class via popup on package Stacktrace: java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0 * ^ at java.util.regex.Pattern.error(Pattern.java:1713) at java.util.regex.Pattern.sequence(Pattern.java:1878) at java.util.regex.Pattern.expr(Pattern.java:1752) at java.util.regex.Pattern.compile(Pattern.java:1460) at java.util.regex.Pattern.<init>(Pattern.java:1133) at java.util.regex.Pattern.compile(Pattern.java:823)
Created attachment 94108 [details] stacktrace
Created attachment 94116 [details] stacktrace
Created attachment 94593 [details] stacktrace trying to refactor move class
Created attachment 94597 [details] stacktrace
This bug already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=165175
Created attachment 94820 [details] stacktrace
Created attachment 96039 [details] stacktrace
Created attachment 97175 [details] stacktrace Tried to create class in newly created package. maven osgi bundle project.
This bug already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=165175
The exception shows because of a wrong parsing on Export-Package and Import-Package. There is no conversion from wildcard character to regular expression syntax for the only "*". When you specify "*" in either Export-Package or Import-Package, the RegExp doesn't accept "*" as an argument, and the exception shows. I don't think it is a good reason to use regexp here, since maven-bundle-plugin test the patterns with a very simply wildcard matching logic, and several illegal syntax in regexp should be prevented or this exception could still pop-ups. According to Bnd and maven-bundle-plugin documentation, the settings of Export-Package may contains some directives or even quoted strings, which will bring an extra "," in the directives (Suppose a org.netbeans.*:uses=("org.netbeans.A,org.netbeans.B"), and certainly it would cause a wrong parse result. Also, "!" is accpeted by Bnd to specificy an exclusion pattern (only if it matches to the pattern). I changed the regexp based logic to use a startWith on recursive or equals call for pattern matching. All directives would be omitted before the test. Hope it will help.
Created attachment 98405 [details] <no description>
thanks for patch, reassigning to someone who can/will (hopefully) review.
Created attachment 98499 [details] stacktrace opening the new file wizard
for some reason this is causing errors when i deploy the bundle to glassfish. If i create a bundle with an activator and use the Properties to set the Export Packages, the IDE adds the following to the pom <Private-Package>*</Private-Package> When i deploy the bundle i get an error INFO: Error while starting bundle: file:/Applications/NetBeans/glassfish-3.0.1-b16/glassfish/modules/autostart/MavenHelloService-1.0-SNAPSHOT.jar: org.osgi.framework.BundleException: Activator start error in bundle com.mycompany.MavenHelloService [230]. INFO: org.osgi.framework.BundleException: Activator start error in bundle com.mycompany.MavenHelloService [230]. ... Caused by: java.lang.ClassCastException: com.mycompany.mavenhelloservice.Installer cannot be cast to org.osgi.framework.BundleActivator If i comment out the Private-Package element the bundle deploys and starts without problem
johnsonlau thanks a lot for the patch, reviewing...
Reviewed, code seems OK to me and confirmed it works, exception is no more appearing. Integrated as change set df72495c7546, big thanks.
(In reply to comment #16) > Reviewed, code seems OK to me and confirmed it works, exception is no more > appearing. Integrated as change set df72495c7546, big thanks. Just found some other things that might need to be fixed also. FelixExportPersister does the same way parsing Bnd setting. It might lead to an expected output of exported packages in the project properties window. Should it be open as a new bug or just a further modification on this issue?
As new bug, thanks.
Integrated into 'main-golden', will be available in build *201005122200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/ User: Log: