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 249036 - ArrayIndexOutOfBoundsException: 7
Summary: ArrayIndexOutOfBoundsException: 7
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: TestNG (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords: SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2014-12-01 14:31 UTC by Vladimir Riha
Modified: 2015-08-20 01:26 UTC (History)
15 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 213820


Attachments
stacktrace (6.31 KB, text/plain)
2014-12-01 14:31 UTC, Vladimir Riha
Details
stacktrace (6.31 KB, text/plain)
2015-01-15 15:42 UTC, Vladimir Riha
Details
stacktrace (6.43 KB, text/plain)
2015-02-25 05:24 UTC, NukemBy
Details
stacktrace (5.42 KB, text/plain)
2015-03-13 01:26 UTC, jdavidbakr
Details
stacktrace (6.46 KB, text/plain)
2015-06-05 07:35 UTC, _ tboudreau
Details
stacktrace (6.49 KB, text/plain)
2015-06-11 14:30 UTC, Tomas Stupka
Details
stacktrace (7.20 KB, text/plain)
2015-07-14 09:20 UTC, Tomas Stupka
Details
stacktrace (6.37 KB, text/plain)
2015-07-25 03:20 UTC, manikantannaren
Details
stacktrace (6.49 KB, text/plain)
2015-07-29 13:44 UTC, Tomas Stupka
Details
stacktrace (6.49 KB, text/plain)
2015-07-31 08:57 UTC, -Silver-
Details
The projects panel (15.81 KB, image/png)
2015-07-31 09:03 UTC, -Silver-
Details
A stacktrace related to this issue a bit different from the ones automatically reported. (6.35 KB, text/plain)
2015-07-31 09:11 UTC, -Silver-
Details
stacktrace (6.49 KB, text/plain)
2015-07-31 23:09 UTC, ytn01
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2014-12-01 14:31:30 UTC
Build: NetBeans IDE Dev (Build web-main-1624-on-20141130)
VM: Java HotSpot(TM) Client VM, 24.71-b01, Java(TM) SE Runtime Environment, 1.7.0_71-b14
OS: Linux

User Comments:
vriha: sorry, no idea. I had opened Maven Web and PHP projects and pressed (I think) Ctrl+/




Stacktrace: 
java.lang.ArrayIndexOutOfBoundsException: 7
   at org.netbeans.modules.gsf.testrunner.ui.api.UICommonUtils.getFileObjectsFromNodes(UICommonUtils.java:84)
   at org.netbeans.modules.selenium2.RunSeleniumTestsAction.enable(RunSeleniumTestsAction.java:82)
   at org.openide.util.actions.NodeAction$DelegateAction.resultChanged(NodeAction.java:615)
   at sun.reflect.GeneratedMethodAccessor63.invoke(GeneratedMethodAccessor63.java:0)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
Comment 1 Vladimir Riha 2014-12-01 14:31:32 UTC
Created attachment 150814 [details]
stacktrace
Comment 2 Vladimir Riha 2015-01-15 15:42:41 UTC
Created attachment 151527 [details]
stacktrace

selecting all in Projects window using Ctrl+A. The window contains several projects (maven web, HTML/JS, PHP with Selenium Test Files node expanded)
Comment 3 Exceptions Reporter 2015-02-24 22:54:56 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=213820
Comment 4 NukemBy 2015-02-25 05:24:55 UTC
Created attachment 152193 [details]
stacktrace

While manipulating MAVEN modules in Projects view
Comment 5 jdavidbakr 2015-03-13 01:26:26 UTC
Created attachment 152589 [details]
stacktrace

Not sure,  I think it was on a file change and an auto-upload to remote when the file changed.
Comment 6 Exceptions Reporter 2015-03-23 16:46:11 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=213820
Comment 7 Exceptions Reporter 2015-03-23 16:49:09 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=213820
Comment 8 _ tboudreau 2015-06-05 07:35:27 UTC
Created attachment 154066 [details]
stacktrace

Expanded a Maven module project, and all child project nodes (including children of children - using this Git checkout git@github.com:timboudreau/mastfrog-parent.git - run submodule init/update).  Selected the last project with all project nodes expanded.  Held down shift-up-arrow to select going upward.
Comment 9 Tomas Stupka 2015-06-11 14:30:57 UTC
Created attachment 154167 [details]
stacktrace

- multiselection in projects (via shift-click)
- select many different types of nodes at once
- plain java projects
Comment 10 _ tboudreau 2015-06-11 17:51:56 UTC
The bug is pretty obvious:

 - The method can assign the result array to new FileObject[0] in a loop, and then loop again and try to add an element to it
 - On the next loop, the method will test if the array is null, but not if it's length is 0, and it will attempt to assign an element of it

Solution:  Use an ArrayList and toArray() to get the return value.
Comment 11 Tomas Stupka 2015-07-14 09:20:27 UTC
Created attachment 154608 [details]
stacktrace

sdf
Comment 12 manikantannaren 2015-07-25 03:20:33 UTC
Created attachment 154877 [details]
stacktrace

1. Created project as per test spec http://services.netbeans.org/synergy/client/app/#/case/3905/suite/1928/v/1
2. Collapsed all Projects
3. Main project Expanded
4. Ctrl-A (Cmd A on mac)
Comment 13 Tomas Stupka 2015-07-29 13:44:51 UTC
Created attachment 155011 [details]
stacktrace

asd
Comment 14 Exceptions Reporter 2015-07-29 13:44:58 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=213820
Comment 15 -Silver- 2015-07-31 08:57:06 UTC
Created attachment 155073 [details]
stacktrace

In the project left panel I have 2 projects opened.
I want to close both so I clicked on the first and then pressing SHIFT clicked on the second to select all.
The exception is thrown.
Comment 16 -Silver- 2015-07-31 09:03:05 UTC
I added a screenshot of the projects panel status when the exception has been thrown. Considering that it is ArrayIndexOutOfBoundsException maybe can be useful to see the number of selected elements and of the collapsed/uncollapsed folds.
Comment 17 -Silver- 2015-07-31 09:03:13 UTC
Created attachment 155074 [details]
The projects panel
Comment 18 -Silver- 2015-07-31 09:11:21 UTC
Created attachment 155075 [details]
A stacktrace related to this issue a bit different from the ones automatically reported.
Comment 19 ytn01 2015-07-31 23:09:07 UTC
Created attachment 155103 [details]
stacktrace

Reproducing steps:
1. Close all opened projects, and Created a JEE Sample project - "Absolute Ordering"
2. Selected Expanded the "absolute-ordering-web-fragments" maven project module
3. Clean-Build project using toolbar button
4. Run "absolute-ordering-web-fragments-war" project
5. (while "absolute-ordering-web-fragments" project node is expanded, and other project trees are collapsed),... clicked on "absolute-ordering-web-fragments" project and Shift+click "fragments3" project which was at the bottom to select all projects

exception got thrown
Comment 20 Theofanis Oikonomou 2015-08-18 09:59:28 UTC
Changeset: e1b49383cc4f
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2015-08-18 12:58
Message:
Comment 21 Theofanis Oikonomou 2015-08-18 10:00:49 UTC
Thank you for the hints and screen-shot. It made it easier to fix this.
Comment 22 Quality Engineering 2015-08-20 01:26:23 UTC
Integrated into 'main-silver', will be available in build *201508200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e1b49383cc4f
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #249036 - ArrayIndexOutOfBoundsException: 7