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 186115 - NPE from CreatedModifiedFilesFactory$AddModuleDependency.<init>
Summary: NPE from CreatedModifiedFilesFactory$AddModuleDependency.<init>
Status: RESOLVED WORKSFORME
Alias: None
Product: apisupport
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P4 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-13 16:06 UTC by cappicard
Modified: 2015-02-04 03:22 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 169565


Attachments
stacktrace (6.44 KB, text/plain)
2010-05-13 16:06 UTC, cappicard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cappicard 2010-05-13 16:06:56 UTC
Build: NetBeans IDE 6.9 Beta (Build 201004200117)
VM: Java HotSpot(TM) Client VM, 16.0-b13, Java(TM) SE Runtime Environment, 1.6.0_18-b07
OS: Windows XP

User Comments:
cappicard: Attempting to add a TopComponent to my Maven-based NetBeans Application.




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.apisupport.project.CreatedModifiedFilesFactory$AddModuleDependency.<init>(CreatedModifiedFilesFactory.java:466)
   at org.netbeans.modules.apisupport.project.CreatedModifiedFilesFactory.addModuleDependency(CreatedModifiedFilesFactory.java:122)
   at org.netbeans.modules.apisupport.project.CreatedModifiedFiles.addModuleDependency(CreatedModifiedFiles.java:338)
   at org.netbeans.modules.apisupport.project.CreatedModifiedFiles.addModuleDependency(CreatedModifiedFiles.java:349)
   at org.netbeans.modules.apisupport.project.ui.wizard.winsys.NewTCIterator.generateFileChanges(NewTCIterator.java:282)
   at org.netbeans.modules.apisupport.project.ui.wizard.winsys.NameAndLocationPanel.updateData(NameAndLocationPanel.java:99)
Comment 1 cappicard 2010-05-13 16:06:59 UTC
Created attachment 98967 [details]
stacktrace
Comment 2 Jesse Glick 2010-05-13 19:09:28 UTC
The root problem is that your project is invalid:

org.codehaus.plexus.util.dag.CycleDetectedException: Edge between 'Vertex{label='com.mycompany:MavenWordEngine'}' and 'Vertex{label='com.mycompany:MavenWordEngine'}' introduces to cycle in the graph com.mycompany:MavenWordEngine --> com.mycompany:MavenWordEngine

This appears to be making the Maven project lose its NbModuleProvider between the time the NewTCIterator.DataModel is constructed and the time generateFileChanges is called on it. Not sure exactly how this happens, but the NPE is coming from the call to .addModuleDependency("org.openide.windows"), and the CycleDetectedException is also produced by some call to addModuleDependency.

Without knowledge of the internals of the Maven project's lookup, all I could do is make CreatedModifiedFiles fail earlier if there is no NbModuleProvider, but this is still open to a similar race condition.
Comment 3 Quality Engineering 2015-02-04 03:22:20 UTC
Reported for 7.3.x or earlier, no new info since then -> closing as worksforme, please reopen in case you see it.