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 231476 - TopComponent creation wizard does not work in some Maven-based projects
Summary: TopComponent creation wizard does not work in some Maven-based projects
Status: VERIFIED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Martin Kozeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-18 21:23 UTC by František Mantlík
Modified: 2013-07-16 07:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch to fix the issue. (1.13 KB, application/octet-stream)
2013-06-18 21:23 UTC, František Mantlík
Details

Note You need to log in before you can comment on or make changes to this bug.
Description František Mantlík 2013-06-18 21:23:37 UTC
Created attachment 135998 [details]
Proposed patch to fix the issue.

TopComponent creation wizard (New window) is not working in some Maven-based Netbeans projects containing (direct or indirect) dependencies on artifacts with non-numeric version numbers. The wizard does not allow to select mode for newly created component, list of available modes is empty.

The issue can be reproduced as follows:

1. Create a new Maven Netbeans Application project. Don't check "Allow OSGI bundles as dependencies" option, check "Create Module Project" option. Build the newly created project.
2. In the created mavenproject1-sample module's pom <dependencies> section add the following dependency:

        <dependency>
            <groupId>de.mukis</groupId>
            <artifactId>de.mukis.jama</artifactId>
            <version>2.0.0.M1</version>
        </dependency>

3. Clear and build the modified project. Dependencies will be downloaded.
4. Run the application. Main window will open. This is an important step!
5. Close the main window.
6. Right-click the "Source packages" node of the mavenproject-sample module and select New-Window...
7. The New window wizard opens with empty "Window position" combo box.Next and Finish buttons are disabled. The only possible action is to cancel the wizard. At the same time the following exception is thrown:

java.lang.NumberFormatException: For input string: "0-RC2"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:492)
	at java.lang.Integer.parseInt(Integer.java:527)
	at org.netbeans.modules.apisupport.project.api.ManifestManager.just3dots(ManifestManager.java:535)
	at org.netbeans.modules.apisupport.project.api.ManifestManager.getOSGiInstance(ManifestManager.java:509)
	at org.netbeans.modules.apisupport.project.api.ManifestManager.getInstance(ManifestManager.java:243)
	at org.netbeans.modules.apisupport.project.api.ManifestManager.getInstanceFromJAR(ManifestManager.java:202)
	at org.netbeans.modules.apisupport.project.spi.LayerUtil.layersOf(LayerUtil.java:97)
	at org.netbeans.modules.maven.apisupport.MavenNbModuleImpl.getEffectiveSystemFilesystem(MavenNbModuleImpl.java:649)
	at org.netbeans.modules.apisupport.project.ui.wizard.winsys.DesignSupport.existingModes(DesignSupport.java:159)
	at org.netbeans.modules.apisupport.project.ui.wizard.winsys.BasicSettingsPanel$1.construct(BasicSettingsPanel.java:139)
	at org.openide.util.AsyncInitSupport.run(AsyncInitSupport.java:168)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2042)

As can be seen from the exception report, when trying to find available modes, the NumberFormatException is thrown because of non-numeric part of the version number. 

Attached patch fixes the problem. When the exception is thrown, invalid part of the version number is replaced by zero.
Comment 1 Milos Kleint 2013-06-19 06:19:43 UTC
mantlik: I cannot find your name in http://www.oracle.com/technetwork/community/oca-486395.html. Before we can apply the patch you need to sign the contributor agreement - http://wiki.netbeans.org/FaqHowDoIFileACA
Comment 2 František Mantlík 2013-06-19 13:16:19 UTC
Done!
Comment 3 Martin Kozeny 2013-06-20 08:15:08 UTC
https://hg.netbeans.org/core-main/rev/9ff032c71657
Comment 4 Quality Engineering 2013-06-22 02:05:39 UTC
Integrated into 'main-golden', will be available in build *201306212301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/9ff032c71657
User: Frantisek Mantlik <mantlik@netbeans.org>
Log: #231476:  TopComponent creation wizard fix in Maven-based projects.