directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Knecht <fel...@apache.org>
Subject Danger of NPE
Date Mon, 17 May 2010 19:49:55 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Following methods may throw an unexpected NPE, but I don't know what to
return as 'default' when testing for NPE.
is done.

Can please somebody with deeper knowledge fix this?

Methods are:

entry.someMethod is called before(!) the first test about entry==null!
http://people.apache.org/~felixk/shared-docs/xref/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.html#277
http://people.apache.org/~felixk/shared-docs/xref/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.html#360
http://people.apache.org/~felixk/shared-docs/xref/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.html#255

This if will NEVER be true because of line 1468!
http://people.apache.org/~felixk/shared-docs/xref/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.html#1474

This piece of code will never be reached because if line 54 - iterators
can't be null at this point!
http://people.apache.org/~felixk/shared-docs/xref/org/apache/directory/shared/ldap/util/JoinIterator.html#64

Thanks
Felix

PS:
I find it the easiest way to point to using links. If it's not ok please
insist.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvxneIACgkQ2lZVCB08qHEdpwCgw5T8qyv7dKNipam7C+RSrfKT
QBcAn08WXxJtx8mlwo4EtVki/mQklKpI
=2TWp
-----END PGP SIGNATURE-----

Mime
View raw message