[kaffe] Bug in ThreadGroup
Hervé Roussain
Herve.Roussain at univ-ubs.fr
Tue Apr 8 17:07:04 PDT 2003
Hi!
The 'parentOf' method doesn't work
Here's the output of the test, using JDK 1.3 and Kaffe CVS:
roussain at shiva:~/java-tests$ sun-java ThreadGroupTest
daddy.parentOf(child)=true
child.parentOf(daddy)=false
roussain at shiva:~/java-tests$ kaffe ThreadGroupTest
daddy.parentOf(child)=true
child.parentOf(daddy)=true
The method is
final public boolean parentOf(ThreadGroup g) {
return ((parent == g) || (parentOf(g.getParent())));
}
but should be something like this:
final public boolean parentOf(ThreadGroup g) {
return (g != null && this == g.getParent())
|| parentOf(g.getParent());
}
Best regards,
Hervé
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ThreadGroupTest.java
Type: text/x-java
Size: 329 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20030408/717261db/attachment-0003.java
More information about the kaffe
mailing list