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 248936 - NullPointerException at org.netbeans.modules.websvc.saas.model.WadlSaasResource.compareTo
Summary: NullPointerException at org.netbeans.modules.websvc.saas.model.WadlSaasResour...
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Manager (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Jan Stola
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-27 00:28 UTC by rptmaestro
Modified: 2015-03-27 03:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 213740


Attachments
stacktrace (1.54 KB, text/plain)
2014-11-27 00:28 UTC, rptmaestro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rptmaestro 2014-11-27 00:28:21 UTC
Build: NetBeans IDE 8.0.1 (Build 201408251540)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.25-b02, Java(TM) SE Runtime Environment, 1.8.0_25-b17
OS: Linux

User Comments:
rptmaestro: Attempted to add a REST Web Service from a WADL to the "Web Services" node under the "Services" tab. I entered the WADL URL and then submitted the form.




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.websvc.saas.model.WadlSaasResource.compareTo(WadlSaasResource.java:113)
   at org.netbeans.modules.websvc.saas.model.WadlSaasResource.compareTo(WadlSaasResource.java:54)
   at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:316)
   at java.util.ComparableTimSort.sort(ComparableTimSort.java:184)
   at java.util.Arrays.sort(Arrays.java:1312)
   at java.util.Arrays.sort(Arrays.java:1506)
Comment 1 rptmaestro 2014-11-27 00:28:22 UTC
Created attachment 150740 [details]
stacktrace
Comment 2 Jan Stola 2015-03-26 15:19:28 UTC
I am able to reproduce this exception when I try to add Web Service using a WADL file with at least two resources where at least one of them doesn't have a path specified.

I have no idea how useful and/or frequent it is (not to specify a path for a resource) but it seems to be allowed by the specification. I have fixed this exception but there is probably more problems with support of such Web Services.

Modified file: https://hg.netbeans.org/web-main/rev/9a4f03b66fc7
Comment 3 Quality Engineering 2015-03-27 03:22:00 UTC
Integrated into 'main-silver', will be available in build *201503270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/9a4f03b66fc7
User: Jan Stola <jstola@netbeans.org>
Log: #248936: Avoiding NPE when a resource does not specify a path.