bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug swing/27651] ClassCastException via javax.swing.tree.TreePath.isDes


From: david dot gilbert at object-refinery dot com
Subject: [Bug swing/27651] ClassCastException via javax.swing.tree.TreePath.isDescendant()
Date: 18 May 2006 09:36:54 -0000


------- Comment #4 from david dot gilbert at object-refinery dot com  
2006-05-18 09:36 -------
>       public static class LayerNode implements TreeNode, Comparable {
>       [...]
>           public boolean equals(Object o) {
>               //Needed for the #contains check in MapLayerPanel, as well as
> #getIndex. [Jon Aquino]
>               LayerNode other = (LayerNode) o;
> 
>               return layer == other.layer;
>           }
>       [...]
>       }
>   }

So TreeNode.equals(LayerNode) presumably is OK, but LayerNode.equals(TreeNode)
will throw a ClassCastException.  This made me wonder if our implementation of
TreePath.isDescendant() has the equals() test around the opposite way to the
reference implementation.  So I wrote a Mauve test to check this implementation
detail...but (unfortunately) it shows that this isn't the problem (the checks
pass on both GNU Classpath and Sun's JRE 1.5.0_06).  Anyway, I'll commit the
test to Mauve now in case anyone wants to look at it - the file is:

gnu/testlet/javax/swing/tree/TreePath/PR27651.java


-- 

david dot gilbert at object-refinery dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |david dot gilbert at object-
                   |                            |refinery dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27651





reply via email to

[Prev in Thread] Current Thread [Next in Thread]