Exception while opening the file selection dialog
scop opened this issue · 9 comments
The following Exception is shown when I use the menu File->Open Keystore File. I use java 1.6. The problem occures also under windows as under Linux Ubuntu 10.10. The file chooser is not opened.
Exception in thread "Thread-3" java.lang.IndexOutOfBoundsException: Invalid index
at javax.swing.DefaultRowSorter.convertRowIndexToModel(Unknown Source)
at sun.swing.FilePane$SortableListModel.getElementAt(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.getCellBounds(Unknown Source)
at javax.swing.JList.getCellBounds(Unknown Source)
at javax.swing.JList.ensureIndexIsVisible(Unknown Source)
at sun.swing.FilePane.ensureIndexIsVisible(Unknown Source)
at sun.swing.FilePane.doDirectoryChanged(Unknown Source)
at sun.swing.FilePane.propertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.awt.Component.firePropertyChange(Unknown Source)
at javax.swing.JFileChooser.setCurrentDirectory(Unknown Source)
at net.sf.portecle.FPortecle.openKeyStoreFile(FPortecle.java:1782)
at net.sf.portecle.FPortecle.access$4200(FPortecle.java:143)
at net.sf.portecle.FPortecle$OpenKeyStoreFileAction.act(FPortecle.java:6183)
at net.sf.portecle.FPortecle$AbstractAction$1.run(FPortecle.java:6558)
at java.lang.Thread.run(Unknown Source)
Reported by: gurumaker
Which version of Portecle is this, and which exact Java version from which vendor are you using? Portecle works only with Java 1.6, and I don't see this problem in Fedora 13 with OpenJDK.
Anyway, I have a hunch what might be causing this, please try this build on both machines that showed the error before and report back if it makes a difference: http://scop.fedorapeople.org/tmp/portecle-1.6-dev.zip
Original comment by: scop
Thanks for the test version. It works perfectly now. My java version: java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.2) (6b20-1.9.2-0ubuntu1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
Original comment by: gurumaker
Thanks for testing. But you mentioned problems in Windows as well, did you test with it too? I assume it's your Ubuntu that's running OpenJDK, not Windows, right?
Original comment by: scop
I've tried it with windows and the file dialog appears. But the dialog is very slow. The dialog need around five seconds to open. Clicking to the Home directory button takes also abou five seconds and so on with the other actions.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
Original comment by: gurumaker
Ok, how about this test build, how does it work in Windows and Ubuntu?
http://scop.fedorapeople.org/tmp/portecle-1.6-dev2.zip
Original comment by: scop
The file chooser is still slow in windows. I've taken a look at the source and it seems the !f.isFile() line 447 in the FileChooserFactory.PortecleFileView always hang for some seconds if the windows specific folder "Arbeitsplatz" (I don't know the english localization.. something like Workplace) is requested. After I've replaces the !f.isFile() with f.isdirectory it works without any delay.
Original comment by: gurumaker
Does the "Arbeitsplatz" folder exist, and is a normal local folder?
Changing !f.isFile() to simply f.isDirectory() changes the semantics a bit, but changing it to "f.isDirectory() || !f.isFile()" should be fine and should also work around the delay if plain f.isDirectory() does, I've done that now in git. Could you try the current git version of Portecle and verify that the delay and the initially reported Exceptions are gone in both Ubuntu and Windows?
Original comment by: scop
I've testet the latest git version with my Ubuntu 10.10 and Windows. Anything's fine.
Original comment by: gurumaker
The right translation for "Arbeitsplatz" is "My Computer". This folder always exists and is not a regular folder. It's part of the virtual file system part at windows.
Original comment by: gurumaker