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 239045 - ArrayIndexOutOfBoundsException: 3
Summary: ArrayIndexOutOfBoundsException: 3
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2013-12-02 14:54 UTC by nerdknight
Modified: 2014-07-31 08:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 205725


Attachments
stacktrace (5.11 KB, text/plain)
2013-12-02 14:54 UTC, nerdknight
Details
Possible fix (2.77 KB, patch)
2014-01-07 11:42 UTC, Jaroslav Havlin
Details | Diff
stacktrace (6.37 KB, text/plain)
2014-07-07 11:10 UTC, Ondrej Vrabec
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nerdknight 2013-12-02 14:54:09 UTC
This bug was originally marked as duplicate of bug 234207, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.4 (Build 201310111528)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b18
OS: Linux

User Comments:
nerdknight: It happens sometimes when I have multiple projects in subversion window and I reoder the changes by repository location and then select some files to commit and commit them




Stacktrace: 
java.lang.ArrayIndexOutOfBoundsException: 3
   at org.openide.explorer.view.NodeTableModel.getValueAt(NodeTableModel.java:610)
   at org.netbeans.swing.etable.ETable$RowMapping.getModelObject(ETable.java:2308)
   at org.netbeans.swing.etable.ETable$RowMapping.getTransformedValue(ETable.java:2329)
   at org.netbeans.swing.etable.ETableColumn$RowComparator.compare(ETableColumn.java:526)
   at org.netbeans.swing.etable.ETableColumn$RowComparator.compare(ETableColumn.java:518)
   at org.netbeans.swing.etable.ETableColumn$FlippingComparator.compare(ETableColumn.java:506)
Comment 1 nerdknight 2013-12-02 14:54:10 UTC
Created attachment 142783 [details]
stacktrace
Comment 2 Ondrej Vrabec 2013-12-16 13:23:51 UTC
Was able to reproduce:
1) Get a subversion project with at least 2 modified files, one from trunk and one from a branch
2) Subversion -> Show Changes
3) In the Subversion view select all rows (the two files) and sort the table by the last column
4) Subversion -> Revert Modifications... on the file from trunk
5) In a few seconds the view is refreshed, the BRANCH column is removed from the table and the exception is thrown. See the stacktrace of the first exception in the messages.log, that belongs to this exception. All the other exception stacktraces (as the one pasted to this issue) are irrelevant and follow this first one.

The problem can be reduced to the following steps:
1) Have table sorted by the last col
2) Have a selected row
3) Remove a column
4) ETable removes the selection and as part of this repaints its rows and calls a renderer.
5) Our renderer in turn converts rowToModel
6) Which triggers resort in ETable earlier than the sorting model is refreshed (still keeps the old column index) -> bang
Comment 3 Jaroslav Havlin 2014-01-07 11:42:18 UTC
Created attachment 143665 [details]
Possible fix

Possible fix (check the column index in RowMapping.getTransformedValue) and a test case.

Please review the patch. Thank you.
Comment 4 Ondrej Vrabec 2014-07-07 11:10:14 UTC
Created attachment 147912 [details]
stacktrace

ETable does not seem to respect a model change and sticks to the old number of columns
Comment 5 Martin Entlicher 2014-07-29 14:38:40 UTC
The patch is applied:
http://hg.netbeans.org/core-main/rev/bad33ce2bf15
Comment 6 Quality Engineering 2014-07-31 08:57:16 UTC
Integrated into 'main-silver', will be available in build *201407310738* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/bad33ce2bf15
User: mentlicher@netbeans.org
Log: #239045: Applied a patch fixing ArrayIndexOutOfBoundsException.