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 253065 - ArrayIndexOutOfBoundsException: -1
Summary: ArrayIndexOutOfBoundsException: -1
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-18 15:58 UTC by Exceptions Reporter
Modified: 2015-08-05 01:19 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 218038


Attachments
stacktrace (3.46 KB, text/plain)
2015-06-18 15:58 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2015-06-18 15:58:56 UTC
This bug was originally marked as duplicate of bug 138906, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 8.0.2 (Build 201411181905)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.79-b02, Java(TM) SE Runtime Environment, 1.7.0_79-b15
OS: Windows 7

User Comments:
GUEST: Error with autosuggestion changing StringBuilder with string concatenations to chain of appends.




Stacktrace: 
java.lang.ArrayIndexOutOfBoundsException: -1
   at org.netbeans.modules.java.source.pretty.CharBuffer.eatAwayChars(CharBuffer.java:271)
   at org.netbeans.modules.java.source.pretty.VeryPretty.eatChars(VeryPretty.java:2573)
   at org.netbeans.modules.java.source.save.CasualDiff.copyTo(CasualDiff.java:5378)
   at org.netbeans.modules.java.source.save.CasualDiff.copyTo(CasualDiff.java:5362)
   at org.netbeans.modules.java.source.save.CasualDiff.diffBinary(CasualDiff.java:2114)
   at org.netbeans.modules.java.source.save.CasualDiff.diffTreeImpl(CasualDiff.java:4999)
Comment 1 Exceptions Reporter 2015-06-18 15:58:58 UTC
Created attachment 154288 [details]
stacktrace
Comment 2 Jaroslav Havlin 2015-07-30 15:02:41 UTC
Reassigning to java/Source. Please evaluate.
Comment 3 Svata Dedic 2015-07-31 09:22:14 UTC
great, reproducble using data from ER 782653
Comment 4 Svata Dedic 2015-07-31 13:24:17 UTC
The issue was caused by incorrectly assigned comments. A comment from some deep of + binary tree operator was assigned to the outermost op, so when the code changed to append(x), the 'x' attempted to copy wrong offsets.

Fixed in jet-main#c35d8f62b9d3
Comment 5 Quality Engineering 2015-08-05 01:19:07 UTC
Integrated into 'main-silver', will be available in build *201508050002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c35d8f62b9d3
User: Svata Dedic <sdedic@netbeans.org>
Log: #253065: properly assign comments when infix and postfix trees are nested