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 252231 - StringIndexOutOfBoundsException: String index out of range: -1
Summary: StringIndexOutOfBoundsException: String index out of range: -1
Status: VERIFIED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Extbrowser (show other bugs)
Version: 8.1
Hardware: All All
: P1 normal (vote)
Assignee: Jan Stola
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-04 14:03 UTC by Vladimir Riha
Modified: 2015-05-12 08:08 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 217106


Attachments
stacktrace (2.61 KB, text/plain)
2015-05-04 14:03 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2015-05-04 14:03:49 UTC
Build: NetBeans IDE Dev (Build 201504240001)
VM: Java HotSpot(TM) Client VM, 25.40-b25, Java(TM) SE Runtime Environment, 1.8.0_40-b25
OS: Linux

User Comments:
vriha: Writing snippet in Chrome Dev Tools, please note that CDT were opened from different tab where NetBeans should not be hooked to (in fact, NetBeans are not running any project in browser)




Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
   at java.lang.String.substring(String.java:1919)
   at org.netbeans.modules.web.common.api.WebServer.findFile(WebServer.java:218)
   at org.netbeans.modules.web.common.api.WebServer.fromServer(WebServer.java:208)
   at org.netbeans.modules.web.common.api.WebServer.fromServer(WebServer.java:192)
   at org.netbeans.modules.web.clientproject.ServerURLMappingImpl.fromServer(ServerURLMappingImpl.java:122)
   at org.netbeans.modules.web.common.api.ServerURLMapping.fromServer(ServerURLMapping.java:148)
Comment 1 Vladimir Riha 2015-05-04 14:03:51 UTC
Created attachment 153515 [details]
stacktrace
Comment 2 Vladimir Riha 2015-05-05 14:07:49 UTC
Increasing to P1, it affects functionality of Chrome Dev Tools in really bad way.

Please try to:
 - run HTML5 project in Chrome with NetBeans COnnector
 - close the Chrome's tab
 - open a new tab (so it is not related to NetBeans in any way)
 - navigate to e.g. netbeans.org
 - open Chrome Dev Tools
 - switch to Sources -> Snippets
 - create a new snippet, type something into it and press Ctrl+S to save it
=> exception


Thank you
Comment 3 Jan Stola 2015-05-06 13:15:29 UTC
I am not able to reproduce this issue, but it seems clear what is the root of this exception. So, I made an attempt to fix it. Feel free to reopen the issue if I screwed something ;-).

Modified file: https://hg.netbeans.org/web-main/rev/a8f3a4f15718
Comment 4 Vladimir Riha 2015-05-06 13:16:43 UTC
I'm sorry, I did not mention Chrome version 42.0.2311.135. I'll give it a try. Thanks
Comment 5 Quality Engineering 2015-05-07 03:27:20 UTC
Integrated into 'main-silver', will be available in build *201505070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a8f3a4f15718
User: Jan Stola <jstola@netbeans.org>
Log: #252231: StringIndexOutOfBoundsException: String index out of range: -1
Comment 6 Vladimir Riha 2015-05-12 08:08:46 UTC
Thanks a lot, verified


Product Version: NetBeans IDE Dev (Build 201505120001)
Java: 1.8.0_40; Java HotSpot(TM) Client VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)