You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Felix Knecht <fe...@otego.com> on 2010/06/04 14:58:19 UTC

[Shared] AddRequestCodec

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A NPE may be thrown at line 280 if 'entry==null'. As the method doesn't
declares a thrown exception I suppose that a default length (like -1)
should be returned if the coumputing fails?

The method endProtocolOp lacks the same problem (entry==null) but
declares a thrown exception, so the NPE can be avoided and a specific
error can be thrown.

http://people.apache.org/~felixk/shared-docs/xref/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.html#280
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwI+GsACgkQ2lZVCB08qHFB/wCdFu5zXAjz+avMycSZ2B7T5lnu
fBMAoJxb//IVhqPCMuIiAebZcwNR0jaZ
=xQQc
-----END PGP SIGNATURE-----

Re: [Shared] AddRequestCodec

Posted by Stefan Seelmann <se...@apache.org>.
Emmanuel Lecharny wrote:
> On 6/4/10 2:58 PM, Felix Knecht wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> A NPE may be thrown at line 280 if 'entry==null'. As the method doesn't
>> declares a thrown exception I suppose that a default length (like -1)
>> should be returned if the coumputing fails?
>>    
> Good point. I think we can test that the entry is not null, and if so,
> throw an IllegalArgumentException (IAE in the next ten mails, as i'm
> fedup of typing it everytime in extenso ;)

Isn't there a mail plugin for Eclipse that provides code completion?



Re: [Shared] AddRequestCodec

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 6/4/10 2:58 PM, Felix Knecht wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> A NPE may be thrown at line 280 if 'entry==null'. As the method doesn't
> declares a thrown exception I suppose that a default length (like -1)
> should be returned if the coumputing fails?
>    
Good point. I think we can test that the entry is not null, and if so, 
throw an IllegalArgumentException (IAE in the next ten mails, as i'm 
fedup of typing it everytime in extenso ;)


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com