directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: svn commit: r952239 - /directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java
Date Mon, 07 Jun 2010 15:19:30 GMT
On 6/7/10 4:19 PM, felixk@apache.org wrote:
> Author: felixk
> Date: Mon Jun  7 14:19:51 2010
> New Revision: 952239
>
> URL: http://svn.apache.org/viewvc?rev=952239&view=rev
> Log:
> instanceof will always return true since all jdbm.helper.Serializer are instances of
java.io.Serializable
>
> Modified:
>      directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java
>
> Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java
> URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java?rev=952239&r1=952238&r2=952239&view=diff
> ==============================================================================
> --- directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java (original)
> +++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java Mon Jun  7 14:19:51
2010
> @@ -206,7 +206,7 @@ public class BTree<K, V>  implements Exte
>               throw new IllegalArgumentException( I18n.err( I18n.ERR_519 ) );
>           }
>
> -        if ( keySerializer != null&&  !( keySerializer instanceof Serializable
) )
> +        if ( keySerializer != null )
>    


This is wrong ! Actually, the previous test was covering (extra 
cautiously, I agree) that we can't pass a serializer which is not an 
instance of Serializer. If this is not the case, then we should remove 
the test and the exception.

Atm, the simple test for a keySerializer not being null ends with an 
IllegalArgumentException in almost all cases, which is bad...

I will revert the commit.

-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.nextury.com



Mime
View raw message