[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: JLDAP Bug n fixes (ITS#1512)



At 03:37 PM 2002-01-07, dfoster@equitytg.com wrote:
>This message is a follow up to my previous message because I forgot to
>comment on :
>>At 01:01 PM 2002-01-07, vtag@novell.com wrote:
>>It certainly doesn't make sense to do something like
>>  LDAPAttribute("name", new String[]  {"a", "b", null, "c"});
>>This case should probably throw an exception.
>
>> Kurt wrote:
>>I would have to agree.  But,
>
>>LDAPAttribute("mail", new String[]  {"a", "b", "", "c"});
>
>>would be valid (IA5 strings allow empty values), null != empty.
>
>
>LDAPAttribute( "name", new String[]{ "a", "b", null, "c"} );

>I don't think it should throw an Exception for two reasons:
>1 - It does not throw an Exception if you do (assume att was already
>instantiated): att.setValue( null )//cast as a byte[] or String.

That might be an argument for treating the null as an
empty string.  It not a good reason for treating it
otherwise.

>2 - It could potentially introduce a really hard to find bug in people's
>code that uses the API (e.g.,migration scripts, automated scripts).

This is actually a good argument for throwing an exception.
Exceptions are much easier to debug.


>A think the solution should be to ignore null.

I oppose this solution as it would lead to code which would
cause subsequent errors instead of immediate errors.

Kurt