Bug in Classes.java

Shawn Wilson <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Last night I discovered a potentially fatal bug in 
org.enhydra.barracuda.plankton.Classes that can prevent a document from 
rendering properly depending on the structure of the DOM implementation 
classes.

Basically the Classes.getAllInterfaces() method was only searching the 
interface hierarchy of the given class but not searching the interface 
hierarchies of the class's parent classes. This causes problems when 
AbstractBComponent tries to determine the renderer for a given DOM element.

Depending on the DOM implementation used, when AbstractBComponent would 
look for a renderer for the current DOM element it could potentially not 
find a renderer even though the element implements the Node interface. 
Apparently DOM elements in the lazydom implementation implement the Node 
interface directly (because Christian noted the HelloWorld3 example 
worked), however when I compiled without using lazydom the implementing 
class apparently extended another class that implemented Node so 
Barracuda wasn't able to find any renderer for it (because it didn't 
search the interfaces of the parent classes).

I have attached a patched version of Classes.java so that Barracuda will 
now properly locate the renderer for any XML Node element independent of 
the specific DOM implementation. Search for saw_082603_1 to see what I 
changed (+2 lines).

-shawn
Classes.zip (application/zip, 2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.