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:05:54 UTC

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

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
 Assigned to: Alex Karasulu 


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


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

Posted by "Nick Faiz (JIRA)" <di...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/DIREVE-252?page=comments#action_12329760 ] 

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

Yes, sorry - my bad.

I found the bug late at night and fixed it on the fly. 

I know the patch process means creating svn diff patches and opening JIRA issues. I will do so in the future.

Nick

> 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


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

Posted by "Alex Karasulu (JIRA)" <di...@incubator.apache.org>.
     [ 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


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

Posted by "Nick Faiz (JIRA)" <di...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/DIREVE-252?page=all ]

Nick Faiz updated DIREVE-252:
-----------------------------

    Attachment: ValueNormalizingVisitor.java

> 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


[jira] Closed: (DIRSERVER-351) patch - fixed ClassCastException issuing from ValueNormalizingVisitor.java in core

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny closed DIRSERVER-351.
---------------------------------------


Closing all issues created in 2005 and before which are marked resolved

> patch - fixed ClassCastException issuing from ValueNormalizingVisitor.java in core
> ----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-351
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-351
>             Project: Directory ApacheDS
>          Issue Type: Bug
>            Reporter: Nick Faiz
>         Assigned To: 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.
-
You can reply to this email to add a comment to the issue online.


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

Posted by "Nick Faiz (JIRA)" <di...@incubator.apache.org>.
    [ 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