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 213848 - NullPointerException at org.netbeans.api.autoupdate.OperationContainer.add
Summary: NullPointerException at org.netbeans.api.autoupdate.OperationContainer.add
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Autoupdate (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-08 16:10 UTC by javydreamercsw
Modified: 2012-12-17 12:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 189236


Attachments
stacktrace (1.27 KB, text/plain)
2012-06-08 16:10 UTC, javydreamercsw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description javydreamercsw 2012-06-08 16:10:10 UTC
Build: NetBeans IDE Dev (Build 201206080001)
VM: Java HotSpot(TM) Client VM, 23.0-b21, Java(TM) SE Runtime Environment, 1.7.0_04-b20
OS: Windows 7

User Comments:
javydreamercsw: Opening a Maven project




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.api.autoupdate.OperationContainer.add(OperationContainer.java:304)
   at org.netbeans.api.autoupdate.OperationContainer.add(OperationContainer.java:268)
   at org.netbeans.modules.ide.ergonomics.fod.FindComponentModules.getAllForEnable(FindComponentModules.java:258)
   at org.netbeans.modules.ide.ergonomics.fod.FindComponentModules.findComponentModules(FindComponentModules.java:193)
   at org.netbeans.modules.ide.ergonomics.fod.FindComponentModules.access$000(FindComponentModules.java:71)
   at org.netbeans.modules.ide.ergonomics.fod.FindComponentModules$1.run(FindComponentModules.java:179)
Comment 1 javydreamercsw 2012-06-08 16:10:18 UTC
Created attachment 120573 [details]
stacktrace
Comment 2 Jiri Rechtacek 2012-06-19 07:47:12 UTC
Invalid calling AU API org.netbeans.api.autoupdate.OperationContainer.add(OperationContainer.java:304) with null parameter.
Comment 3 Jaroslav Tulach 2012-08-28 14:49:28 UTC
Well, the null comes from AU, I think. This is the ergonomics code:

OperationContainer.OperationInfo<OperationSupport> inf = ocForEnable.add (el);
Set<UpdateElement> reqs = inf.getRequiredElements ();
ocForEnable.add (reqs);

The null must be in reqs set. I bet getRequiredElements should not return set which contains null, right?
Comment 5 Jaroslav Tulach 2012-11-05 14:36:13 UTC
The javadoc of inf.getRequiredElements() does not mention it can return null. Either the Javadoc needs to say that, or the inf.getRequiredElements () needs to be fixed not to return null (or an element of null in the array). 

As far as I can say FoD is doing nothing wrong.
Comment 6 Jiri Rechtacek 2012-11-06 09:19:41 UTC
inf.getRequiredElements() should not return a collection with 'null' elements - I  will fix it
Comment 7 Jiri Rechtacek 2012-12-13 14:17:43 UTC
http://hg.netbeans.org/core-main/rev/303eb8c29a11
Comment 8 Quality Engineering 2012-12-17 12:38:52 UTC
Integrated into 'main-golden', will be available in build *201212170919* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/303eb8c29a11
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #213848: NPE at org.netbeans.api.autoupdate.OperationContainer.add