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 218505 - StringIndexOutOfBoundsException: String index out of range: -1
Summary: StringIndexOutOfBoundsException: String index out of range: -1
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-18 07:35 UTC by Vladimir Riha
Modified: 2012-09-18 09:40 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 192516


Attachments
stacktrace (3.06 KB, text/plain)
2012-09-18 07:35 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2012-09-18 07:35:44 UTC
Build: NetBeans IDE Dev (Build web-main-8558-on-20120917)
VM: Java HotSpot(TM) Client VM, 23.3-b01, Java(TM) SE Runtime Environment, 1.7.0_07-b10
OS: Linux

User Comments:
vriha: Debugging Jasmine JavaScript tests.

What caused it:
- open SampleApp/tests/unit/jasmine.js and add breakpoint to line 12 (with var calc)
- run tests in Chrome with debugger
- once it paused on the breakpoint, keep pressing Step Into

The exception was thrown when code execution stops in sampleApp/tests/lib/jasmine/jasmine.js:118




Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
   at java.lang.String.substring(String.java:1911)
   at org.netbeans.modules.javascript2.editor.index.IndexedElement.getAssignments(IndexedElement.java:180)
   at org.netbeans.modules.javascript2.editor.index.IndexedElement.decodeProperty(IndexedElement.java:277)
   at org.netbeans.modules.javascript2.editor.index.IndexedElement.createProperties(IndexedElement.java:165)
   at org.netbeans.modules.javascript2.editor.index.JsIndex.getProperties(JsIndex.java:133)
   at org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.findPrototypeChain(ModelUtils.java:569)
Comment 1 Vladimir Riha 2012-09-18 07:35:46 UTC
Created attachment 124487 [details]
stacktrace
Comment 2 Petr Pisl 2012-09-18 09:23:46 UTC
Vlado, do you have reproducible case?
Comment 3 Petr Pisl 2012-09-18 09:31:57 UTC
Anyway should be fixed in the web-main.
http://hg.netbeans.org/web-main/rev/8f8f27efcfef
Comment 4 Vladimir Riha 2012-09-18 09:40:44 UTC
Only information I have are the steps above but unfortunately I can't reproduce it with them...