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 226498

Summary: StringIndexOutOfBoundsException: String index out of range: -4
Product: java Reporter: alied <alied>
Component: SourceAssignee: Svata Dedic <sdedic>
Status: REOPENED ---    
Severity: normal CC: dbcurtis, sdedic, stefan79
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 198881
Attachments: stacktrace

Description alied 2013-02-22 04:41:37 UTC
Build: NetBeans IDE 7.3 (Build 201302132200)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_15-b03
OS: Windows 7

User Comments:
alied: Editing a JUnit test




Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -4
   at java.lang.String.substring(String.java:1875)
   at org.netbeans.modules.java.source.save.CasualDiff.diffTopLevel(CasualDiff.java:313)
   at org.netbeans.modules.java.source.save.CasualDiff.diffTreeImpl(CasualDiff.java:3263)
   at org.netbeans.modules.java.source.save.CasualDiff.diffTree(CasualDiff.java:3208)
   at org.netbeans.modules.java.source.save.CasualDiff.diff(CasualDiff.java:234)
   at org.netbeans.api.java.source.WorkingCopy.processCurrentCompilationUnit(WorkingCopy.java:610)
Comment 1 alied 2013-02-22 04:41:39 UTC
Created attachment 131711 [details]
stacktrace
Comment 2 Svata Dedic 2013-07-31 14:42:10 UTC
There were changes made in the reported code location as part of issue #218495; might affected the behaviour and fix the defect. I could not reproduce it in NB 7.4 dev (but I was not able to reproduce in 7.3.1 either)

It seems that a specific content or reordering causes the defect. I put a diagnostic log to the place; please use a recent dev build to test the issue further - send logs through exception reporter.

Logs added in rev. http://hg.netbeans.org/jet-main/rev/80cdb96c8a5b
Comment 3 Quality Engineering 2013-08-03 02:07:27 UTC
Integrated into 'main-silver', will be available in build *201308022300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/80cdb96c8a5b
User: Svata Dedic <sdedic@netbeans.org>
Log: #226498: diagnostic output added
Comment 4 Svata Dedic 2016-04-26 13:10:48 UTC
*** Bug 256688 has been marked as a duplicate of this bug. ***
Comment 5 Quality Engineering 2016-04-28 02:02:42 UTC
Integrated into 'main-silver', will be available in build *201604280002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f1cb612082e7
User: Svata Dedic <sdedic@netbeans.org>
Log: #226498, #256688: diagnostic output added
Comment 6 alied 2017-11-10 15:40:06 UTC
Reopening this bug based on new exception report: http://statistics.netbeans.org/exceptions/exception.do?id=865291