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 246957 - StringIndexOutOfBoundsException: String index out of range: -1
Summary: StringIndexOutOfBoundsException: String index out of range: -1
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 8.0
Hardware: All All
: P1 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
: 244878 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-09-09 22:26 UTC by ent38
Modified: 2015-07-23 16:33 UTC (History)
17 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 211252


Attachments
stacktrace (3.00 KB, text/plain)
2014-09-09 22:26 UTC, ent38
Details
stacktrace (4.07 KB, text/plain)
2014-09-09 22:29 UTC, ent38
Details
stacktrace (4.07 KB, text/plain)
2014-09-09 22:32 UTC, ent38
Details
A file that always throw the exception. (2.49 KB, text/plain)
2014-09-09 22:51 UTC, ent38
Details
stacktrace (3.00 KB, text/plain)
2014-09-12 09:38 UTC, Exceptions Reporter
Details
stacktrace (3.07 KB, text/plain)
2014-11-10 22:24 UTC, cwt137
Details
stacktrace (3.32 KB, text/plain)
2014-12-10 17:58 UTC, cwt137
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ent38 2014-09-09 22:26:21 UTC
Build: NetBeans IDE 8.0.1 (Build 201408251540)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.65-b04, Java(TM) SE Runtime Environment, 1.7.0_67-b01
OS: Windows 8

User Comments:
GUEST: tgedfgdfgdfgdf

GUEST: <Please provide a description of the problem or the steps to reproduce>ee

ent38: opened scss (SASS), jsp and jspf files




Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
   at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:868)
   at java.lang.StringBuilder.substring(StringBuilder.java:72)
   at java.lang.AbstractStringBuilder.subSequence(AbstractStringBuilder.java:849)
   at java.lang.StringBuilder.subSequence(StringBuilder.java:72)
   at org.netbeans.modules.html.editor.hints.Nesting.getSPIHintFixes(Nesting.java:130)
   at org.netbeans.modules.html.editor.hints.Nesting.getExtraHintFixes(Nesting.java:109)
Comment 1 ent38 2014-09-09 22:26:23 UTC
Created attachment 149095 [details]
stacktrace
Comment 2 ent38 2014-09-09 22:29:06 UTC
Created attachment 149096 [details]
stacktrace

Showing the "Actions Items" panel
Comment 3 ent38 2014-09-09 22:32:06 UTC
Created attachment 149097 [details]
stacktrace

opened a project with scss, jsp and jspf files
Comment 4 Exceptions Reporter 2014-09-09 22:32:10 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=211252
Comment 5 ent38 2014-09-09 22:38:41 UTC
For information, I had previously deleted the NetBeans cache, so Maven Repositories Index cache didn't exist yet (the stacktrace seems to be about Maven Repositories).
I have recreated/downloaded the Maven Repositories Index caches, but the exception still occurs. More precisely, it happens when I develop the "Maven Repositories" node in the Services panel. Bug 100% reproducible.
Comment 6 ent38 2014-09-09 22:48:58 UTC
I also happens every time I open a JSPF file with this line : 
"<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>".
If I remove it, the exception is not thrown.
Comment 7 ent38 2014-09-09 22:51:34 UTC
Created attachment 149098 [details]
A file that always throw the exception.

A file that always throw the exception. Remove line 3 ("<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>") and the exception is gone.
I'm on a Maven3 project with JDK7 and Tomcat8.
Comment 8 Exceptions Reporter 2014-09-12 09:38:07 UTC
Created attachment 149165 [details]
stacktrace

Don't know
Comment 9 Exceptions Reporter 2014-09-16 11:12:06 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=211252
Comment 10 cwt137 2014-11-10 22:24:43 UTC
Created attachment 150409 [details]
stacktrace

just opened a php file with a lot of html in it
Comment 11 cwt137 2014-12-10 17:58:52 UTC
Created attachment 151020 [details]
stacktrace

was trying to close an if block in php when this error happened
Comment 12 Marian Mirilovic 2015-02-04 10:28:33 UTC
209 duplicates -> P1
Comment 13 Milutin Kristofic 2015-02-04 10:44:15 UTC
http://hg.netbeans.org/web-main/rev/db83c5303606
Comment 14 Vladimir Riha 2015-02-24 07:42:45 UTC
Fixed seems safe, verified
Comment 15 Marian Mirilovic 2015-02-24 13:47:52 UTC
This is a candidate for NB 8.0.2 Patch 1 , so please integrate the bugfix into releases/release801 branch today by 10pm CET, for more information see 
http://wiki.netbeans.org/NetBeansPatchesProcess
Comment 17 Vladimir Riha 2015-02-25 16:21:00 UTC
Cannot reproduce, verified

Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 1
Java: 1.7.0_71; Java HotSpot(TM) Client VM 24.71-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_71-b14
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 18 Milutin Kristofic 2015-07-23 16:33:50 UTC
*** Bug 244878 has been marked as a duplicate of this bug. ***