tags:

views:

510

answers:

1

I'm getting a random unreproducible Error when initializing a JSplitPane in with JDK 1.5.0_08. Note that this does not occur every time, but about 80% of the time:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.KeyStroke
at java.util.TreeMap.compare(TreeMap.java:1093)
at java.util.TreeMap.put(TreeMap.java:465)
at java.util.TreeSet.add(TreeSet.java:210)
at javax.swing.plaf.basic.BasicSplitPaneUI.installDefaults(BasicSplitPaneUI.java:364)
at javax.swing.plaf.basic.BasicSplitPaneUI.installUI(BasicSplitPaneUI.java:300)
at javax.swing.JComponent.setUI(JComponent.java:652)
at javax.swing.JSplitPane.setUI(JSplitPane.java:350)
at javax.swing.JSplitPane.updateUI(JSplitPane.java:378)
at javax.swing.JSplitPane.<init>(JSplitPane.java:332)
at javax.swing.JSplitPane.<init>(JSplitPane.java:287)
    ...

Thoughts? I've tried cleaning and rebuilding my project so as to minimize the probability of corrupted class files.

Edit #1 See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434148 - seems to be a JDK bug. Any known workarounds? None are listed on the bug entry page.

+1  A: 

After doing some Googling on bugs.sun.com, this looks like this might be a JDK bug that was only fixed in JDK 6.

See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434148

Epaga