Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6536864

JFileChooser: ArrayIndexOutOfBoundsException on Details view while changing the 'Show hidden Files'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • 8
    • 6, 6u1
    • client-libs

      On windows, while displaying the JFileChooser, the Windows Explorer's setting 'Folder Options -> View -> Hidden Files and Folders' was changed from 'Show Hidden Files' to 'Do not show hidden files' throws the following exception. This exception is thrown only for the 'Details View', for all the LAF.

      Steps to reproduce this bug...

      1. Set the Window Explorer's - Folder Options -> View -> Hidden Files and Folders to 'Show Hidden Files'

      2. Open the JFileChooser

      3. Go to a directory which has a hidden dir or files in that

      4. Click on the 'Details View' button, and the display file contents using any column. Make sure the hidden files or folders in that directory got displayed.

      5. Now change the Windows Explorer's - Folder Options -> View -> Hidden Files and Folders to 'Don't show Hidden Files and Folders'

      6. Apply the change. You can see the following exception.

      java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 20
              at java.util.Vector.get(Vector.java:694)
              at javax.swing.plaf.basic.BasicDirectoryModel.getElementAt(BasicDirectoryModel.java:166)
              at sun.swing.FilePane$SortableListModel.getElementAt(FilePane.java:525)
              at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1341)
              at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1292)
              at javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(BasicListUI.java:2605)
              at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
              at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:147)
              at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:194)
              at javax.swing.DefaultListSelectionModel.setAnchorSelectionIndex(DefaultListSelectionModel.java:719)
              at javax.swing.JTable.clearSelectionAndLeadAnchor(JTable.java:2032)
              at javax.swing.JTable.tableChanged(JTable.java:4307)
              at sun.swing.FilePane$5.tableChanged(FilePane.java:968)
              at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
              at javax.swing.table.AbstractTableModel.fireTableStructureChanged(AbstractTableModel.java:200)
              at sun.swing.FilePane$DetailsTableModel.updateColumnInfo(FilePane.java:580)
              at sun.swing.FilePane$DetailsTableModel.contentsChanged(FilePane.java:673)
              at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:100)
              at javax.swing.plaf.basic.BasicDirectoryModel.fireContentsChanged(BasicDirectoryModel.java:150)
              at javax.swing.plaf.basic.BasicDirectoryModel$DoChangeContents.run(BasicDirectoryModel.java:480)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
              at java.awt.Dialog$1.run(Dialog.java:1039)
              at java.awt.Dialog$3.run(Dialog.java:1091)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.awt.Dialog.show(Dialog.java:1089)
              at javax.swing.JFileChooser.showDialog(JFileChooser.java:723)
              at JFileChooserTest.jButton1ActionPerformed(JFileChooserTest.java:122)
              at JFileChooserTest.access$000(JFileChooserTest.java:12)
              at JFileChooserTest$1.actionPerformed(JFileChooserTest.java:79)
              at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
              at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
              at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
              at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242
      )
              at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
              at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
              at java.awt.Component.processMouseEvent(Component.java:6038)
              at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
              at java.awt.Component.processEvent(Component.java:5803)
              at java.awt.Container.processEvent(Container.java:2058)
              at java.awt.Component.dispatchEventImpl(Component.java:4410)
              at java.awt.Container.dispatchEventImpl(Container.java:2116)
              at java.awt.Component.dispatchEvent(Component.java:4240)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
              at java.awt.Container.dispatchEventImpl(Container.java:2102)
              at java.awt.Window.dispatchEventImpl(Window.java:2429)
              at java.awt.Component.dispatchEvent(Component.java:4240)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

      java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 20
              at java.util.Vector.get(Vector.java:694)
              at javax.swing.plaf.basic.BasicDirectoryModel.getElementAt(BasicDirector
      yModel.java:166)
              at sun.swing.FilePane$SortableListModel.getElementAt(FilePane.java:525)
              at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java
      :1341)
              at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI
      .java:1292)
              at javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(BasicListUI.j
      ava:2605)
              at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSel
      ectionModel.java:167)
              at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSel
      ectionModel.java:147)
              at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSel
      ectionModel.java:194)
              at javax.swing.DefaultListSelectionModel.setAnchorSelectionIndex(Default
      ListSelectionModel.java:719)
              at sun.swing.FilePane.clearSelection(FilePane.java:1538)
              at sun.swing.FilePane.setFileSelected(FilePane.java:1389)
              at sun.swing.FilePane$DelayedSelectionUpdater.run(FilePane.java:1120)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
      ad.java:273)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
      java:183)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
      java:177)
              at java.awt.Dialog$1.run(Dialog.java:1039)
              at java.awt.Dialog$3.run(Dialog.java:1091)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.awt.Dialog.show(Dialog.java:1089)
              at javax.swing.JFileChooser.showDialog(JFileChooser.java:723)
              at JFileChooserTest.jButton1ActionPerformed(JFileChooserTest.java:122)
              at JFileChooserTest.access$000(JFileChooserTest.java:12)
              at JFileChooserTest$1.actionPerformed(JFileChooserTest.java:79)
              at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:19
      95)
              at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
      a:2318)
              at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
      .java:387)
              at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242
      )
              at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
      istener.java:236)
              at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:2
      72)
              at java.awt.Component.processMouseEvent(Component.java:6038)
              at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
              at java.awt.Component.processEvent(Component.java:5803)
              at java.awt.Container.processEvent(Container.java:2058)
              at java.awt.Component.dispatchEventImpl(Component.java:4410)
              at java.awt.Container.dispatchEventImpl(Container.java:2116)
              at java.awt.Component.dispatchEvent(Component.java:4240)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322
      )
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)

              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
              at java.awt.Container.dispatchEventImpl(Container.java:2102)
              at java.awt.Window.dispatchEventImpl(Window.java:2429)
              at java.awt.Component.dispatchEvent(Component.java:4240)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
      ad.java:273)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
      java:183)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:173)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

      This is reproducible on 6.0(tried with 6.0 b104) and 7.0 build too. This works fine in 5.0. Hence this is a regression.

            rupashka Pavel Porvatov (Inactive)
            esubramasunw Elancheran Subramanian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: