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 253024 - StringIndexOutOfBoundsException: String index out of range: -1
Summary: StringIndexOutOfBoundsException: String index out of range: -1
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: CSS Editor (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-16 13:55 UTC by ainos984
Modified: 2015-07-22 04:37 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 206856


Attachments
stacktrace (2.19 KB, text/plain)
2015-06-16 13:55 UTC, ainos984
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ainos984 2015-06-16 13:55:41 UTC
Build: NetBeans IDE 8.0.2 (Build 201411181905)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.55-b03, Java(TM) SE Runtime Environment, 1.7.0_55-b13
OS: Windows 7

User Comments:
ainos984: I'm working on many project, I use less and was testing the import features between some less files.

GUEST: this problem showing when I using Laravel 5

gtzabari: No idea what I did.

GUEST: Editing a style element that had media="screen" and surrounded an @import. Merely typing a space after the import caused the exception.

GUEST: Working with scss file

GUEST: open .less css template file

Accelerate: I'm not sure, but I think that it happend when I importend unexisting file in scss file




Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
   at java.lang.String.substring(String.java:1911)
   at org.netbeans.modules.css.editor.csl.CssCompletion.handleLexicalBasedCompletion(CssCompletion.java:758)
   at org.netbeans.modules.css.editor.csl.CssCompletion.complete(CssCompletion.java:155)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider$JavaCompletionQuery.addCodeCompletionItems(GsfCompletionProvider.java:615)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider$JavaCompletionQuery.resolveCompletion(GsfCompletionProvider.java:602)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider$JavaCompletionQuery.access$400(GsfCompletionProvider.java:248)
Comment 1 ainos984 2015-06-16 13:55:43 UTC
Created attachment 154247 [details]
stacktrace
Comment 2 Milutin Kristofic 2015-06-16 14:20:03 UTC
Hi, thank for reports. Can you paste a code, where this happened? Probably something with @import
Comment 3 Milutin Kristofic 2015-07-21 12:53:46 UTC
I created reproducible steps to press Ctrl+space in 
@import |""

This should fix it: http://hg.netbeans.org/web-main/rev/d4df1633ec6e
Comment 4 Quality Engineering 2015-07-22 04:37:53 UTC
Integrated into 'main-silver', will be available in build *201507220303* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d4df1633ec6e
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #253024 - StringIndexOutOfBoundsException: String index out of range: -1