directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: shared.ldap.ldif.LdifEntry.equals not logic
Date Thu, 20 May 2010 09:54:46 GMT
Sorry for the delay, was busy on other side of the project :)

I fixed the issue : the inner entry filed can't be null, as we 
initialize it in the constructor, and there is no way to set it to 
anything else in the code. I removed the checks for entry nullity in the 
equals method.

Thanks for the heads up !

(tests are currently running, as soon as I get all of them passing, I 
will commit).


On 5/20/10 10:21 AM, Felix Knecht wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ping
>
> Sorry, but I don't know how to solve and if my suggestion is fitting.
>
> Felix
>
> On 05/17/10 18:45, Felix Knecht wrote:
>    
>> On 05/17/10 18:42, Felix Knecht wrote:
>>      
>>> Sorry, it's me again ...
>>>        
>>      
>>> On line 764 [1] we do 'entry.getDn()' and further down 784 [2] we check
>>> if entry==null.
>>> This check is not necessary, because line 764 will throw a NPE in this
>>> case what is very bad for an equals method. Maybe I'm wrong, but could
>>> line 764 also look like
>>>        
>>      
>>> if(getEntry()==null) return false;
>>> DN thisDn = getEntry().getDn();
>>>        
>>      
>>> and then remove the if from line 784?
>>>        
>> There's a similar problem in the hashCode method (lines 672 / 686)
>>
>>
>>
>>      
>>> [1]
>>> http://people.apache.org/~felixk/shared-docs/xref/org/apache/directory/shared/ldap/ldif/LdifEntry.html#764
>>> [2]
>>> http://people.apache.org/~felixk/shared-docs/xref/org/apache/directory/shared/ldap/ldif/LdifEntry.html#784
>>>        
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.15 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkv08QYACgkQ2lZVCB08qHEtBwCfcx0+SBO3OCiBYOGGthVVrCfG
> dVQAoNrZVMFMDjaodMG802kWiRt5E+/W
> =w3Gr
> -----END PGP SIGNATURE-----
>
>    


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



Mime
View raw message