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

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

     [ http://issues.apache.org/jira/browse/DIREVE-252?page=all ]
     
Alex Karasulu resolved DIREVE-252:
----------------------------------

    Fix Version: 0.9.3
     Resolution: Fixed

committed changes in revision 290055 here:

http://svn.apache.org/viewcvs.cgi?view=rev&rev=290055

You rock dude, thanks for the fix!

No biggy but next time please see if you could submit a patch instead of the whole file: helps to quickly see what changed.


> 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
>      Fix For: 0.9.3
>  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