directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Knecht <fel...@apache.org>
Subject Re: shared.ldap.ldif.LdifEntry.equals not logic
Date Mon, 17 May 2010 16:45:32 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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/

iEYEARECAAYFAkvxcqwACgkQ2lZVCB08qHHI7ACgrw9mfB6+y6qaTC0uXJA4aeka
rZUAn3hyEE2dMFStdDpEOCICdUH78msy
=0IcE
-----END PGP SIGNATURE-----

Mime
View raw message