JDK-5040513 : ArrayIndexOutOfBoundsException in JColorChooser when clicking in the bottom of S
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.5.1
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-04-30
  • Updated: 2004-10-12
  • Resolved: 2004-09-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 betaFixed
Related Reports
Relates :  
Description
Name: ibR10256			Date: 04/30/2004


STEPS TO REPRODUCE:
1. Open the Default swatches panel in JColorChooser
2. Move the mouse cursor to the space between the bottommost row of
   the color squares and the border in the swatches or recent colors
   table and press any of the mouse buttons. An exception is thrown.

REPRODUCIBILITY:
This bug can be reproduced always.

THE EXCEPTION THROWN:
java.lang.ArrayIndexOutOfBoundsException: 299
        at javax.swing.colorchooser.SwatchPanel.getColorForCell(DefaultSwatchChooserPanel.java:289)
        at javax.swing.colorchooser.SwatchPanel.getColorForLocation(DefaultSwatchChooserPanel.java:285)
        at javax.swing.colorchooser.DefaultSwatchChooserPanel$MainSwatchListener.mousePressed(DefaultSwatchChooserPanel.java:200)
        at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
        at java.awt.Component.processMouseEvent(Component.java:5462)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3121)
        at java.awt.Component.processEvent(Component.java:5230)
        at java.awt.Container.processEvent(Container.java:1961)
        at java.awt.Component.dispatchEventImpl(Component.java:3933)
        at java.awt.Container.dispatchEventImpl(Container.java:2019)
        at java.awt.Component.dispatchEvent(Component.java:3781)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4203)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3880)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3813)
        at java.awt.Container.dispatchEventImpl(Container.java:2005)
        at java.awt.Window.dispatchEventImpl(Window.java:1764)
        at java.awt.Component.dispatchEvent(Component.java:3781)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
        at java.awt.Dialog$1.run(Dialog.java:514)
        at java.awt.Dialog.show(Dialog.java:535)
        at javax.swing.ColorChooserDialog.show(JColorChooser.java:695)
        at javax.swing.JColorChooser.showDialog(JColorChooser.java:121)
        at ColorChooser$1.actionPerformed(ColorChooser.java:25)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1851)
        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.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
        at java.awt.Component.processMouseEvent(Component.java:5465)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3121)
        at java.awt.Component.processEvent(Component.java:5230)
        at java.awt.Container.processEvent(Container.java:1961)
        at java.awt.Component.dispatchEventImpl(Component.java:3933)
        at java.awt.Container.dispatchEventImpl(Container.java:2019)
        at java.awt.Component.dispatchEvent(Component.java:3781)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4203)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3883)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3813)
        at java.awt.Container.dispatchEventImpl(Container.java:2005)
        at java.awt.Window.dispatchEventImpl(Window.java:1764)
        at java.awt.Component.dispatchEvent(Component.java:3781)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
        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)
---------------------------------------------

======================================================================
###@###.### 10/12/04 18:21 GMT

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang FIXED IN: mustang INTEGRATED IN: mustang
23-09-2004

EVALUATION Name: ibR10256 Date: 04/30/2004 The index calculated in SwatchPanel.getColorForLocation() is not within the bounds in the described situation, and there is no bounds check in getColorForCell(). ###@###.### 2004-04-30 ====================================================================== Name: ibR10256 Date: 04/30/2004 The bug can be reproduced only in dragon, because in tiger since b16 the swatches panel is flattened (seems it's a result of the fix for 4887836) so it's impossible to click on the swatches to produce the exception as described. ###@###.### 2004-04-30 ====================================================================== Fixed for mustang by re-working the layout in DefaultSwatchChooserPanel. ###@###.### 2004-09-02
02-09-2004