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 236019

Summary: NullPointerException at org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveAssignments
Product: javascript Reporter: Vladimir Riha <vriha>
Component: EditorAssignee: Petr Pisl <ppisl>
Status: VERIFIED FIXED    
Severity: normal CC: pjiricka, vriha
Priority: P2 Keywords: 7.4_HR_FIX
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 203901
Attachments: stacktrace
sample file
stacktrace

Description Vladimir Riha 2013-09-16 11:24:17 UTC
Build: NetBeans IDE 7.4 RC1 (Build 201309152201)
VM: Java HotSpot(TM) Client VM, 25.0-b49, Java(TM) SE Runtime Environment, 1.8.0-ea-b107
OS: Linux

User Comments:
vriha: happened when editing HTML with KnockoutJS inside




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveAssignments(ModelUtils.java:1085)
   at org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveAssignments(ModelUtils.java:1078)
   at org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveTypeFromExpression(ModelUtils.java:788)
   at org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveTypes(ModelUtils.java:1020)
   at org.netbeans.modules.javascript2.editor.JsCompletionItem$Factory.create(JsCompletionItem.java:532)
   at org.netbeans.modules.javascript2.editor.JsCodeCompletion.complete(JsCodeCompletion.java:213)
Comment 1 Vladimir Riha 2013-09-16 11:24:18 UTC
Created attachment 140119 [details]
stacktrace
Comment 2 Vladimir Riha 2013-09-16 11:25:28 UTC
Created attachment 140120 [details]
sample file

To reproduce, invoke cc on line 19 after text: and make sure to have full type resolution for JS completion unchecked
Comment 3 Vladimir Riha 2013-09-16 11:36:03 UTC
Created attachment 140121 [details]
stacktrace

invoking cc in HTML with Knockout
Comment 4 Vladimir Riha 2013-09-16 11:51:17 UTC
Please evaluate for possibly HR_FIX. I think more duplicates will be coming wrt issue 233815
Comment 5 Petr Pisl 2013-09-16 12:35:26 UTC
The fix is not hard:). Will me available during a while.
Comment 6 Petr Pisl 2013-09-16 12:53:02 UTC
I have fixed it in web-main: http://hg.netbeans.org/web-main/rev/d739b503f7ff
Comment 7 Vladimir Riha 2013-09-16 12:55:15 UTC
Thanks for quick fix, I'll test it in first web-main build.
Comment 8 Petr Pisl 2013-09-16 18:29:49 UTC
Let me know the result. Then I will integrated it into the releases immediately.
Comment 9 Vladimir Riha 2013-09-16 19:51:23 UTC
Cannot reproduce, verified in web-main


Product Version: NetBeans IDE Dev (Build web-main-11616-on-20130916)
Java: 1.7.0_11; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_11-b21
System: Linux version 3.8.0-23-generic running on amd64; UTF-8; en_US (nb)
Comment 10 Petr Pisl 2013-09-17 06:54:27 UTC
Transplanted to the releases: http://hg.netbeans.org/releases/rev/e9a708928327
Comment 11 Vladimir Riha 2013-09-26 11:33:48 UTC
Verified

Product Version: NetBeans IDE 7.4 RC2 (Build 201309252201)
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b13
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)