[jdom-interest] Beta 8 ElementFilter Bug

Robertson, Jacob Jacob.Robertson at argushealth.com
Tue Mar 12 12:41:49 PST 2002


Did anyone else catch the coding error in the matches(Object) method of
ElementFilter?

The line that says
 else namespace.equals(element.getNamespace());
Should probably say
 else return namespace.equals(element.getNamespace());

This is the problem with writing code that doesn't use the "else"
portion of the if statement.  Many people think it's a matter of coding
style, but if the entire method had been written with elses for every if
statement then this coding bug would have been caught by the compiler.

Just my 2 cents..



More information about the jdom-interest mailing list