The method isAncestorOf in java.awt.Container should return true if the supplied argument is an ancestor of the container. However, the GNU Classpath implementation also returns true for the container itself i.e. Container c = new Container(); c.isAncestorOf(c); returns true.
Created attachment 14822 [details] Test Case Test case for this bug. Also committed to Mauve.
Subject: Bug 34576 CVSROOT: /cvsroot/classpath Module name: classpath Changes by: Andrew John Hughes <gnu_andrew> 07/12/25 00:21:02 Modified files: . : ChangeLog java/awt : Container.java Log message: 2007-12-25 Andrew John Hughes <gnu_andrew@member.fsf.org> PR classpath/34576: * java/awt/Container.java: (isAncestorOf(Component)): Swap ordering so that the parent is retrieved prior to checking against this, thus preventing a component being an ancestor of itself. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.9450&r2=1.9451 http://cvs.savannah.gnu.org/viewcvs/classpath/java/awt/Container.java?cvsroot=classpath&r1=1.112&r2=1.113
Created attachment 14823 [details] Committed patch.
Fixed in CVS. Closing.