JDK-6501741 : Adding JDK/libary causes ArrayIndexOutOfBoundsException in Netbeans
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2006-12-07
  • Updated: 2011-02-16
  • Resolved: 2006-12-11
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)
Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Windows Vista RC1 Build 5600 64bit

A DESCRIPTION OF THE PROBLEM :
In NetBeans 5.5:

Trying to add a library (folder/JAR) to the project, either by right clicking on
Libraries in the Project panel and selecting 'Add JAR/Folder' or 'Add Project' ('Add Library' is OK), or going through the
Project properties window, causes an ArrayIndexOutOfBoundsException immediatly, i.e. no file browser pops up first.

The same exception is thrown when trying to add a new JDK in NetBeans, by clicking the Add Platform button in the Platform Manager window, leading me to suspect that the error is in the file browser or something related, see exception details below:

java.lang.ArrayIndexOutOfBoundsException: 3184
	at sun.awt.shell.Win32ShellFolder2.getFileChooserIcon(Win32ShellFolder2.java:748)
...
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Not known if this was working in prior release.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
In NetBeans:

Go to 'Tools' - 'Java Platform Manager' and click'Add Platform...'

OR

With a project open right click on 'Libraries' in the 'Projects' pane and select 'Add JAR/folder' or 'Add Project'.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
See a file browser for selecting the JDK location or library location.
ACTUAL -
No file browser pops up, but a red stop sign icon appears in the bottom right, which brigns up an error message.  Note this is the second exception in the enclosed log file.  I don't know if the first exception, which appears to be during module load is anything to do with it, nor do I know why the log states the OS as NT on X86 - the system is actualy Vista RC1 on x64.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Log:

java.lang.ArrayIndexOutOfBoundsException: 3184
	at sun.awt.shell.Win32ShellFolder2.getFileChooserIcon(Win32ShellFolder2.java:748)
	at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.java:248)
	at sun.awt.shell.ShellFolder.get(ShellFolder.java:221)
	at com.sun.java.swing.plaf.windows.WindowsLookAndFeel$LazyWindowsIcon.createValue(WindowsLookAndFeel.java:1873)
	at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:185)
	at javax.swing.UIDefaults.get(UIDefaults.java:130)
	at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
	at javax.swing.UIDefaults.getIcon(UIDefaults.java:411)
	at javax.swing.UIManager.getIcon(UIManager.java:613)
	at javax.swing.plaf.basic.BasicFileChooserUI.installIcons(BasicFileChooserUI.java:237)
	at javax.swing.plaf.basic.BasicFileChooserUI.installDefaults(BasicFileChooserUI.java:219)
	at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:135)
	at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(WindowsFileChooserUI.java:126)
	at javax.swing.JComponent.setUI(JComponent.java:652)
	at javax.swing.JFileChooser.updateUI(JFileChooser.java:1755)
	at javax.swing.JFileChooser.setup(JFileChooser.java:366)
	at javax.swing.JFileChooser.<init>(JFileChooser.java:332)
	at javax.swing.JFileChooser.<init>(JFileChooser.java:285)
	at org.netbeans.modules.web.project.ui.LibrariesNode$AddFolderAction.actionPerformed(LibrariesNode.java:658)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
	at java.awt.Component.processMouseEvent(Component.java:5488)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
	at java.awt.Component.processEvent(Component.java:5253)
	at java.awt.Container.processEvent(Container.java:1966)
	at java.awt.Component.dispatchEventImpl(Component.java:3955)
	at java.awt.Container.dispatchEventImpl(Container.java:2024)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	at java.awt.Window.dispatchEventImpl(Window.java:1778)
	at java.awt.Component.dispatchEvent(Component.java:3803)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION Duplicate of 6449933.
11-12-2006