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 229708

Summary: NullPointerException at org.netbeans.modules.websvc.rest.editor.AsynchronousGenerator.invoke
Product: webservices Reporter: Jiri Skrivanek <jskrivanek>
Component: RESTAssignee: David Konecny <dkonecny>
Status: VERIFIED FIXED    
Severity: normal CC: marfous, phejl, pjiricka
Priority: P1    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 200629
Attachments: stacktrace

Description Jiri Skrivanek 2013-05-14 10:02:08 UTC
Build: NetBeans IDE 7.3.1 (Build 201305122200)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_17-b02
OS: Windows 7

User Comments:
jskrivanek: Create REST service in web project (EE 7, GlassFish 4) and call  Insert Code... -> Convert Method to Asynchronous. I don't know where is appropirate to use this function.




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.websvc.rest.editor.AsynchronousGenerator.invoke(AsynchronousGenerator.java:150)
   at org.netbeans.modules.editor.codegen.GenerateCodePanel.invokeSelected(GenerateCodePanel.java:197)
   at org.netbeans.modules.editor.codegen.GenerateCodePanel.listMouseReleased(GenerateCodePanel.java:137)
   at org.netbeans.modules.editor.codegen.GenerateCodePanel.access$000(GenerateCodePanel.java:66)
   at org.netbeans.modules.editor.codegen.GenerateCodePanel$2.mouseReleased(GenerateCodePanel.java:110)
   at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
Comment 1 Jiri Skrivanek 2013-05-14 10:02:09 UTC
Created attachment 134411 [details]
stacktrace
Comment 2 David Konecny 2013-05-14 22:23:27 UTC
This Code Insert is meant to be triggered only on method declaration or more specifically only on class method name. And the method must be a REST producer method. If those conditions are met then the code insert converts the method into asynchronous one.

The fix is simple and save. I also changed the code so that Code Insert now does show up only on method names and nowhere else. If selected method is not REST producer method then error is shown in status bar saying "Only REST method is subject to convert".

While testing it I discovered a problem which I filed as issue 229754.

76b555d3f89a
Comment 3 David Konecny 2013-05-14 22:33:49 UTC
Btw. I just noticed that there are two ways to turn method into async one: via Insert Code and also via hint in editor gutter. I wonder if we need both.
Comment 4 Quality Engineering 2013-05-16 02:29:34 UTC
Integrated into 'main-golden', will be available in build *201305152300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/76b555d3f89a
User: David Konecny <dkonecny@netbeans.org>
Log: #229708 - NullPointerException at org.netbeans.modules.websvc.rest.editor.AsynchronousGenerator.invoke
Comment 5 Jiri Skrivanek 2013-05-16 07:48:56 UTC
Verified in NetBeans IDE Dev (Build 201305152300).
Comment 6 Petr Hejl 2013-05-16 11:51:32 UTC
The patch seems to be ok.
Comment 7 Petr Jiricka 2013-05-16 13:17:05 UTC
Transplanted to 7.3.1: 
http://hg.netbeans.org/releases/rev/d3d2d0fc6caf
Comment 8 Quality Engineering 2013-05-17 00:05:04 UTC
Integrated into 'releases', will be available in build *201305162200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/d3d2d0fc6caf
User: David Konecny <dkonecny@netbeans.org>
Log: #229708 - NullPointerException at org.netbeans.modules.websvc.rest.editor.AsynchronousGenerator.invoke
Comment 9 Milan Kuchtiak 2013-07-01 14:08:41 UTC
*** Bug 225840 has been marked as a duplicate of this bug. ***