directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Faiz <n...@atlassian.com>
Subject patch - fixed ClassCastException issuing from ValueNormalizingVisitor.java in core
Date Thu, 15 Sep 2005 09:09:19 GMT
Hi,

I found a ClassCastException being issued on 
ValueNormalizingVisitor.java in core.

It looks like an easy fix; wrap the cast in a type check.

       if (node instanceof BranchNode)
         {
             BranchNode bnode = ( BranchNode ) node;
             final int size = bnode.getChildren().size();
             for ( int ii = 0; ii < size ; ii++ )
             {
                 visit( ( ExprNode ) bnode.getChildren().get( ii ) );
             }
         }

I think this is okay because it was trying to cast a PresenceNode 
(LeafNode) into a branch node. This looks like normal tree traversal, so 
I assume it's okay to not visit any further nodes if the node is a LeafNode.

Cheers,
Nick

-- 
ATLASSIAN - http://www.atlassian.com/

Confluence - the enterprise wiki - tried it yet?
http://www.atlassian.com/confluence/
--

Mime
View raw message