You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Nick Faiz (JIRA)" <di...@incubator.apache.org> on 2005/09/16 02:51:54 UTC

[jira] Commented: (DIREVE-252) patch - fixed ClassCastException issuing from ValueNormalizingVisitor.java in core

    [ http://issues.apache.org/jira/browse/DIREVE-252?page=comments#action_12329503 ] 

Nick Faiz commented on DIREVE-252:
----------------------------------

Please note - someone should look this over. I have assumed that it's okay to only traverse with branch nodes, ignoring all other node types - this should be verified.

> patch - fixed ClassCastException issuing from ValueNormalizingVisitor.java in core
> ----------------------------------------------------------------------------------
>
>          Key: DIREVE-252
>          URL: http://issues.apache.org/jira/browse/DIREVE-252
>      Project: Directory Server
>         Type: Bug
>   Components: server main
>     Versions: 0.9.2
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>  Attachments: ValueNormalizingVisitor.java
>
> This is a five minute task.
>  
> > Nick Faiz wrote:
> > 
> >> 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
> >>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira