On Dec 14, 2007, at 12:49, Andreas L Delmelle wrote:

Slight correction:
On Dec 14, 2007, at 11:55, Vincent Hennebert wrote:

Hi Andreas,

+        while (!(ancestor instanceof Flow)
+                && ancestor instanceof Wrapper) {

Might be wrong, but isn’t that the very same as:
    while (!(ancestor instanceof Wrapper))
<snip />
Your version will run indefinitely, unless there is a Wrapper somewhere in the ancestry...

Your version will throw a NullPointerException:
when ancestor becomes the Root,
ancestor.getParent() will return null,
'ancestor instanceof Wrapper' will still return false, so the loop will be entered one more time,
and then ancestor.getParent() will throw a NPE.



Reply via email to