Share

DrJava

Tracker: Bugs

5 OS X FileChooser ArrayIndexOutOfBoundsException - ID: 992525
Last Update: Settings changed ( mgricken )

I generate the following exception frequently (maybe 80% of
the time) when I request the Open or Save dialog. This is in
Mac OS X version 10.2.8, Java 1.4.1.

java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
at java.util.Vector.elementAt(Vector.java:427)
at
javax.swing.DefaultListModel.get(DefaultListModel.java:428)
at
apple.laf.AquaFileChooserUI$FilterComboBoxModel.getSelect
edItem(AquaFileChooserUI.java:1312)
at
javax.swing.JComboBox.contentsChanged(JComboBox.java:1
263)
at
javax.swing.AbstractListModel.fireContentsChanged(Abstract
ListModel.java:100)
at
apple.laf.AquaFileChooserUI$FilterComboBoxModel.propertyC
hange(AquaFileChooserUI.java:1278)
at
javax.swing.event.SwingPropertyChangeSupport.fireProperty
Change(SwingPropertyChangeSupport.java:264)
at
javax.swing.event.SwingPropertyChangeSupport.fireProperty
Change(SwingPropertyChangeSupport.java:232)
at
javax.swing.JComponent.firePropertyChange(JComponent.jav
a:3814)
at
javax.swing.JFileChooser.addChoosableFileFilter(JFileChooser
.java:1073)
at
javax.swing.JFileChooser.resetChoosableFileFilters(JFileChoo
ser.java:1114)
at
edu.rice.cs.drjava.ui.MainFrame$3.getFiles(MainFrame.java:
326)
at
edu.rice.cs.drjava.ui.MainFrame._openFileOrProject(MainFra
me.java:2025)
at
edu.rice.cs.drjava.ui.MainFrame.access$1200(MainFrame.jav
a:101)
at
edu.rice.cs.drjava.ui.MainFrame$11.actionPerformed(MainFr
ame.java:436)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButt
on.java:1797)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerfo
rmed(AbstractButton.java:1850)
at
javax.swing.DefaultButtonModel.fireActionPerformed(Default
ButtonModel.java:419)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonMo
del.java:257)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(B
asicButtonListener.java:247)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMul
ticaster.java:227)
at
java.awt.Component.processMouseEvent(Component.java:50
93)
at
java.awt.Component.processEvent(Component.java:4890)
at
java.awt.Container.processEvent(Container.java:1566)
at
java.awt.Component.dispatchEventImpl(Component.java:359
8)
at
java.awt.Container.dispatchEventImpl(Container.java:1623)
at
java.awt.Component.dispatchEvent(Component.java:3439)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Containe
r.java:3450)
at
java.awt.LightweightDispatcher.processMouseEvent(Containe
r.java:3165)
at
java.awt.LightweightDispatcher.dispatchEvent(Container.java
:3095)
at
java.awt.Container.dispatchEventImpl(Container.java:1609)
at
java.awt.Window.dispatchEventImpl(Window.java:1585)
at
java.awt.Component.dispatchEvent(Component.java:3439)
at
java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(E
ventDispatchThread.java:230)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Eve
ntDispatchThread.java:183)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThr
ead.java:177)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThr
ead.java:169)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java
:99)


Dan Smith ( dlsmith ) - 2004-07-16 19:23

5

Closed

None

Nobody/Anonymous

UI: MacOS X-specific

4: Serious

Public


Comments ( 5 )

Date: 2010-01-27 03:00
Sender: nobody

Excellent site. It was pleasant to me., <a href=
http://blog.bakililar.az/fakecoachpurses/ >Cheapest fake coach purses</a>,
[url= http://blog.bakililar.az/fakecoachpurses/ ]Cheapest fake coach
purses[/url], =OO, <a href= http://blog.bakililar.az/replicacoachpurses/
>replica coach purses here</a>, [url=
http://blog.bakililar.az/replicacoachpurses/ ]replica coach purses
here[/url], 8199, <a href= http://blog.bakililar.az/coachpurses/ >coach
purses discount</a>, [url= http://blog.bakililar.az/coachpurses/ ]coach
purses discount[/url], 741, <a href=
http://blog.bakililar.az/knockoffdesignerpurses/ >knock off designer purses
information</a>, [url= http://blog.bakililar.az/knockoffdesignerpurses/
]knock off designer purses information[/url], rptq, <a href=
http://blog.bakililar.az/coachhandbags/ >Only coach handbags</a>, [url=
http://blog.bakililar.az/coachhandbags/ ]Only coach handbags[/url],
572009,


Date: 2010-01-27 00:08
Sender: nobody

I like it so much, <a href= http://blog.bakililar.az/replicacoachpurses/#1
>Only replica coach purses</a>
[url=http://blog.bakililar.az/replicacoachpurses/#1]Only replica coach
purses[/url], 301, <a href= http://blog.bakililar.az/fakecoachpurses/#1
>fake coach purses</a>
[url=http://blog.bakililar.az/fakecoachpurses/#1]fake coach purses[/url],
493486, <a href= http://blog.bakililar.az/coachpurses/#1 >coach purses</a>
[url=http://blog.bakililar.az/coachpurses/#1]coach purses[/url], inhh, <a
href= http://blog.bakililar.az/knockoffdesignerpurses/#1 >knock off
designer purses information</a>
[url=http://blog.bakililar.az/knockoffdesignerpurses/#1]knock off designer
purses information[/url], =PPP, <a href=
http://blog.bakililar.az/coachhandbags/#1 >coach handbags</a>
[url=http://blog.bakililar.az/coachhandbags/#1]coach handbags[/url], >:P,


Date: 2004-11-22 21:45
Sender: dlsmithProject Admin

Logged In: YES
user_id=1060117

I've discovered this to be a bug in my system's implementation of
the JFileChooser. Under the following platform:

Mac OS 10.2.8
Java 1.4.1
Look and feel: apple.laf.AquaLookAndFeel

The methods JFileChooser.removeChoosableFileFilter() and
JFileChooser.resetChoosableFileFilters() cause an
ArrayIndexOutOfBoundsException under most conditions. I've
attached a simple program that breaks on this platform.

Since the JFileChoosers in edu.rice.cs.drjava.ui.MainFrame make
some use of the broken methods, an error occurs whenever a
JFileChooser is opened.

I'd recommend one of the following courses of action:

- Remove the calls to JFileChooser.removeChoosableFileFilter()
and JFileChooser.resetChoosableFileFilters() in MainFrame.java -- I
believe the functionality could be preserved without relying on
those methods.

- Write a test in the DrJava startup sequence that determines, for
each available look and feel (or maybe just the Apple look and
feel), whether the broken methods are implemented correctly. If
not, remove them from the list of available lafs.

- Abandon full support for Mac OS 10.2. The workaround is to
always use one of the Sun lafs.


Date: 2004-08-12 13:18
Sender: dlsmithProject Admin

Logged In: YES
user_id=1060117

The bug is still present in the most recent CVS version, checked
out today. Here's the edu.rice.cs.drjava portion of the stack trace
(the rest is identical):

java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
...
at
edu.rice.cs.drjava.ui.MainFrame$3.getFiles(MainFrame.java:332)
at
edu.rice.cs.drjava.ui.MainFrame._openFileOrProject(MainFrame.jav
a:2426)
at
edu.rice.cs.drjava.ui.MainFrame.access$1500(MainFrame.java:105
)
at
edu.rice.cs.drjava.ui.MainFrame$14.actionPerformed(MainFrame.ja
va:471)
...


Date: 2004-07-16 20:14
Sender: dlsmithProject Admin

Logged In: YES
user_id=1060117

Some experimentation has shown this to be a bug introduced
between the 20040331 and 20040618 development releases.


Attached File ( 1 )

Filename Description Download
AppleFileChooserTest.java Download

Changes ( 5 )

Field Old Value Date By
close_date - 2010-01-27 03:12 mgricken
allow_comments 1 2010-01-27 03:12 mgricken
status_id Open 2010-01-27 03:12 mgricken
File Added 109744: AppleFileChooserTest.java 2004-11-22 21:48 dlsmith
artifact_group_id 5: Makes DrJ unstable 2004-08-12 13:18 dlsmith