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 271676

Summary: StackOverflowError at java.lang.Math.min
Product: javascript Reporter: _ tboudreau <tboudreau>
Component: EditorAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal CC: tboudreau
Priority: P3    
Version: Dev   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 230643
Attachments: stacktrace
Patch to avoid recursively trying to resolve the same element

Description _ tboudreau 2017-10-20 08:06:15 UTC
Build: NetBeans IDE Dev (Build 20171012-8fbff2d899d9)
VM: OpenJDK 64-Bit Server VM, 9+181, OpenJDK Runtime Environment, 9+181
OS: Linux

User Comments:
tboudreau: Editing a js source




Stacktrace: 
java.lang.StackOverflowError
   at java.lang.Math.min(Math.java:1512)
   at java.util.Arrays.copyOf(Arrays.java:3722)
   at java.util.Arrays.copyOf(Arrays.java:3688)
   at java.util.ArrayList.toArray(ArrayList.java:381)
   at java.util.ArrayList.addAll(ArrayList.java:598)
   at org.netbeans.modules.javascript2.model.JsObjectImpl.getAssignments(JsObjectImpl.java:351)
Comment 1 _ tboudreau 2017-10-20 08:06:18 UTC
Created attachment 165327 [details]
stacktrace
Comment 2 _ tboudreau 2017-10-23 17:07:46 UTC
Okay, something is haywire in Bugzilla's spam filter and it's not letting me post the clone message.

I have a github project in which simply opening one file reproduces this bug 100% of the time.  Link is here:  https://timboudreau.com/files/nb_bug_271676.txt
Comment 3 _ tboudreau 2017-11-27 17:24:35 UTC
100% reproducible if you clone https://github.com/timboudreau/cfig and open cfig.js

I will attach a simple patch that fixes the problem.
Comment 4 _ tboudreau 2017-11-27 17:26:06 UTC
Created attachment 165500 [details]
Patch to avoid recursively trying to resolve the same element

Simply tests to see if the method is going to call itself with the same arguments as it is currently called with.