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 242799 - StringIndexOutOfBoundsException: String index out of range: -2
Summary: StringIndexOutOfBoundsException: String index out of range: -2
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: CSS Editor (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-11 15:37 UTC by Sam.MIT
Modified: 2014-08-19 12:17 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 208318


Attachments
stacktrace (2.18 KB, text/plain)
2014-03-11 15:37 UTC, Sam.MIT
Details
stacktrace (2.18 KB, text/plain)
2014-03-11 15:40 UTC, Sam.MIT
Details
stacktrace (2.18 KB, text/plain)
2014-04-08 10:46 UTC, Ondrej Vrabec
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam.MIT 2014-03-11 15:37:24 UTC
Build: NetBeans IDE Dev (Build 201403100001)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.0-b70, Java(TM) SE Runtime Environment, 1.8.0-b132
OS: Windows 8

User Comments:
Sam.MIT: AsyncRequest web app default CSS file -> url tag access




Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -2
   at java.lang.String.substring(String.java:1954)
   at org.netbeans.modules.css.editor.csl.CssCompletion.getPrefix(CssCompletion.java:629)
   at org.netbeans.modules.css.editor.csl.CssCompletion.getPrefix(CssCompletion.java:505)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider$JavaCompletionQuery.getCompletionEnvironment(GsfCompletionProvider.java:708)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider$JavaCompletionQuery.resolveCompletion(GsfCompletionProvider.java:591)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider$JavaCompletionQuery.access$400(GsfCompletionProvider.java:248)
Comment 1 Sam.MIT 2014-03-11 15:37:25 UTC
Created attachment 145955 [details]
stacktrace
Comment 2 Sam.MIT 2014-03-11 15:40:08 UTC
Created attachment 145956 [details]
stacktrace

AsyncRequest web app default CSS file -> url tag access
Comment 3 Ondrej Vrabec 2014-04-08 10:46:41 UTC
Created attachment 146622 [details]
stacktrace

editing css:

.diff-popup-button-previous {
    display: inline;
    content: url("drop_arrow-ena.png");
}

and Ctrl+click on url function because it is highlighted as a string
Comment 4 Exceptions Reporter 2014-07-24 20:52:42 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=208318
Comment 5 Marek Fukala 2014-07-28 08:22:54 UTC
reproducible case:

div {
    content: url("image.png");
}

and invoke completion somewhere inside the 'url' token
Comment 6 Marek Fukala 2014-07-28 08:32:19 UTC
changeset:   276187:bc2cb92116fa
summary:     #242799 - StringIndexOutOfBoundsException: String index out of range: -2
Comment 7 Quality Engineering 2014-07-29 02:33:11 UTC
Integrated into 'main-silver', will be available in build *201407290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/bc2cb92116fa
User: Marek Fukala <mfukala@netbeans.org>
Log: #242799 - StringIndexOutOfBoundsException: String index out of range: -2
Comment 8 Vladimir Riha 2014-08-19 12:17:12 UTC
Verified, thanks

Product Version: NetBeans IDE 8.0.1 (Build 201408142300)
Java: 1.7.0_65; Java HotSpot(TM) Client VM 24.65-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_65-b17
System: Linux version 3.13.0-32-generic running on i386; UTF-8; en_US (nb)