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 216024 - ArrayIndexOutOfBoundsException: -1
Summary: ArrayIndexOutOfBoundsException: -1
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
: 219694 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-07-26 18:34 UTC by everflux
Modified: 2012-10-10 14:18 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 189167


Attachments
stacktrace (2.66 KB, text/plain)
2012-07-26 18:34 UTC, everflux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description everflux 2012-07-26 18:34:06 UTC
Build: NetBeans IDE 7.2 (Build 201207171143)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.1-b03, Java(TM) SE Runtime Environment, 1.7.0_05-b05
OS: Linux

User Comments:
everflux: Tried to show annotation from git for existing javascript file.
This may be the root cause of the NPE in Bug 216023

boonedox: git annotate




Stacktrace: 
java.lang.ArrayIndexOutOfBoundsException: -1
   at org.netbeans.libs.git.jgit.commands.BlameCommand$WAComparator.trimTrailingEoL(BlameCommand.java:141)
   at org.netbeans.libs.git.jgit.commands.BlameCommand$WAComparator.hashRegion(BlameCommand.java:124)
   at org.eclipse.jgit.diff.RawTextComparator.hash(RawTextComparator.java:262)
   at org.eclipse.jgit.diff.RawTextComparator.hash(RawTextComparator.java:54)
   at org.eclipse.jgit.diff.SubsequenceComparator.hash(SubsequenceComparator.java:77)
   at org.eclipse.jgit.diff.SubsequenceComparator.hash(SubsequenceComparator.java:56)
Comment 1 everflux 2012-07-26 18:34:09 UTC
Created attachment 122424 [details]
stacktrace
Comment 2 Ondrej Vrabec 2012-07-27 07:31:36 UTC
is your project open-source? Could i try and debug myself?
Comment 3 everflux 2012-07-27 08:54:02 UTC
The project can not be made public, I am afraid.
If there is any way I could help diagnosing the problem or testing a special build/run a nightly build, I am happy to do so.
Comment 4 Ondrej Vrabec 2012-08-01 08:44:21 UTC
blindly fixing: http://hg.netbeans.org/core-main/rev/d212ee5f8984
Comment 5 Quality Engineering 2012-08-02 02:32:43 UTC
Integrated into 'main-golden', will be available in build *201208020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d212ee5f8984
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #216024 - ArrayIndexOutOfBoundsException: -1
Comment 6 Ondrej Vrabec 2012-10-08 10:34:51 UTC
*** Bug 219694 has been marked as a duplicate of this bug. ***
Comment 7 Ondrej Vrabec 2012-10-08 10:35:16 UTC
apparently not fixed
Comment 8 Ondrej Vrabec 2012-10-08 10:39:29 UTC
fix: http://hg.netbeans.org/core-main/rev/a561fa0a870e
Comment 9 everflux 2012-10-08 14:19:46 UTC
Confirmed, no longer crashes for me now using custom build from core-main. Thanks!

The last line of the file has no annotation, though. Removing the line (a blank line) the line then becoming the last line is missing the annotation information.
Does not happen with other files, only with the one triggering the problem in previous builds.
Comment 10 Quality Engineering 2012-10-09 02:05:54 UTC
Integrated into 'main-golden', will be available in build *201210090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a561fa0a870e
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #216024 - ArrayIndexOutOfBoundsException: -1
fixing wrong condition
Comment 11 Stepan Zebra 2012-10-09 11:17:56 UTC
please backport to 7.2
Comment 12 Ondrej Vrabec 2012-10-09 11:43:29 UTC
release72: http://hg.netbeans.org/releases/rev/754f48956135
Comment 13 Quality Engineering 2012-10-10 14:18:15 UTC
Integrated into 'releases', will be available in build *201210100934* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/754f48956135
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #216024 - ArrayIndexOutOfBoundsException: -1
fixing wrong condition
(transplanted from a561fa0a870ef7e1c5623c647ae061481dd9f014)