ClassCastException in LayoutFocusTraversalPolicy

Elmar Frerichs java at
Sun Oct 24 16:18:04 UTC 2021


I am new to the whole process of java development and bug reporting, and 
I hope this is the right place for my request - if not please tell me :-)

A project I am currently working on uses custom implementations of 
ButtonModel as a model for javax.swing.JToggleButton. Until JRE 
8u301-b09, this worked fine, but with the latest version (JRE 8u311-b11, 
especially the build by for Windows x64) the app in some 
occasions crashes with a ClassCastException. I dug through the source 
code and the OpenJDK bug tracker to find out more about it, and found 
the following bug report:

As it turns out, the stack trace matches the one of my project, and the 
Snippet for reproducing the bug now also fails in JRE 8u311-b11.

If I understood the connections correctly, the bug of JDK-8182577 was 
introduced to JRE 9 by the fix from JDK-8154043 
( This bug has a 
backport ticket for JDK 8u311, but without a hg changeset attached 

I am a bit confused that the source code in hg for 
does not mention the ToggleButtonModel at all - it seems that at least 
in hg the backport was never applied? Or is hg out of date here? Or did 
I miss a switch somewhere?

Anyways, I would appreciate any feedback on whether others can reproduce 
the bug with the snippet of JDK-8182577 in JRE 8u311-b11 as well or if I 
might have done something else wrong.


More information about the jdk8u-dev mailing list