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 245488 - ClassCastException: org.netbeans.modules.javascript2.editor.model.impl.JsObjectImpl cannot be cast to org.netbeans.modules.javascript2.editor.model.JsFunction
Summary: ClassCastException: org.netbeans.modules.javascript2.editor.model.impl.JsObje...
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.1
Hardware: All All
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-08 13:46 UTC by Vladimir Riha
Modified: 2014-09-19 10:58 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 210604


Attachments
stacktrace (5.36 KB, text/plain)
2014-07-08 13:46 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2014-07-08 13:46:33 UTC
Build: NetBeans IDE Dev (Build 201407080001)
VM: Java HotSpot(TM) Client VM, 25.5-b02, Java(TM) SE Runtime Environment, 1.8.0_05-b13
OS: Linux

User Comments:
vriha: What caused it:
 - download http://services.netbeans.org/synergy/server/api/attachment.php?id=206
 - run npm install from IDE
 - in IDE, move node_modules from project root to site root

=>CCE




Stacktrace: 
java.lang.ClassCastException: org.netbeans.modules.javascript2.editor.model.impl.JsObjectImpl cannot be cast to org.netbeans.modules.javascript2.editor.model.JsFunction
   at org.netbeans.modules.javascript2.editor.model.impl.ModelVisitor.enter(ModelVisitor.java:597)
   at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:291)
   at org.netbeans.modules.javascript2.editor.model.impl.ModelVisitor.enter(ModelVisitor.java:1185)
   at jdk.nashorn.internal.ir.ReferenceNode.accept(ReferenceNode.java:67)
   at jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:178)
   at jdk.nashorn.internal.ir.ExecuteNode.accept(ExecuteNode.java:89)
Comment 1 Vladimir Riha 2014-07-08 13:46:35 UTC
Created attachment 147938 [details]
stacktrace
Comment 2 Petr Pisl 2014-07-09 12:22:08 UTC
It's caused by this construction

var Store = module.exports = function Store () {

};
Comment 3 Petr Pisl 2014-07-09 14:50:03 UTC
Should be fixed in web-main.
Comment 4 Quality Engineering 2014-07-10 02:46:39 UTC
Integrated into 'main-silver', will be available in build *201407100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8684f6de7235
User: Petr Pisl <ppisl@netbeans.org>
Log: #245488 - ClassCastException: org.netbeans.modules.javascript2.editor.model.impl.JsObjectImpl cannot be cast to org.netbeans.modules.javascript2.editor.model.JsFunction
Comment 5 Vladimir Riha 2014-07-11 08:28:22 UTC
Thank you, cannot reproduce, verified


Product Version: NetBeans IDE Dev (Build 201407110001)
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.13.0-30-generic running on i386; UTF-8; en_US (nb)
Comment 6 terje7601 2014-09-16 14:02:04 UTC
There have been 5 new exception reports for NetBeans 8.0.1 already ( http://statistics.netbeans.org/analytics/detail.do?id=210604 ), so apparently there are still cases where this bug occurs.
Comment 7 Petr Pisl 2014-09-16 20:18:08 UTC
It's fixed in dev builds. I checked the 8.0.1 branch and the fix is not there unfortunately. The fix itself is very simple. 

Vlado what do you think. It should be still nominated as NB 8.0.1 patch candidate?

I'm closing this as fixed, because in trunk (dev builds) it's fixed.
Comment 8 Vladimir Riha 2014-09-17 07:32:37 UTC
The patch has been already built but there be could be possible rebuild. Let's wait and in case of rebuild, I'm for transplanting to releases.
Comment 9 Marian Mirilovic 2014-09-18 15:16:23 UTC
Ok Lada, please integrate .... we will start anotherbuild at 10pm CEST
Comment 10 Petr Pisl 2014-09-18 17:06:33 UTC
The fix of this bug is in releases. But I need to also transplant issue #247057.
Comment 11 Vladimir Riha 2014-09-19 10:58:46 UTC
Cannot reproduce using steps in description. Thank you


Product Version: NetBeans IDE 8.0.1 (Build 201408251540)
Updates: NetBeans IDE is updated to version NetBeans 8.0.1 Patch 1
Java: 1.8.0_20; Java HotSpot(TM) Client VM 25.20-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-b26
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)