Re: Bug in Classes.java

Jacob Kjome <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Hi Shawn,

I just wanted to say thanks for finding this.  I was experiencing this bug 
when using "-dom xerces" for XML files such as HelloWorld3.xml in the 
tutorials (as mentioned below).  The result returned to the browser 
included unprocessed BTemplate directives.  I found it worked fine when 
using "-dom lazydom" or not specifying "-dom" at all (which, I believe, 
defaults to lazydom).  I tried it after this patch was committed and "-dom 
xerces" works just fine now.  The directives are processed and the result 
is what I expect.  I'm changing the options.xmlc in the tutorials/xmlc back 
to "-dom xerces" since Barracuda doesn't benefit from the lazydom.  I had 
thought this might be an XMLC bug.  Thanks again for tracking this down!

Jake

At 08:30 AM 8/26/2003 -0600, you wrote:
>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
>
>
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.