directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: DefaultAttribute NPE
Date Tue, 03 Oct 2017 16:27:03 GMT
Yes, this is not very user friendly.


You should not define an AttributeType if you don't define teh
associated syntax - and we should check that teh attributeType is valid
in the DefaultAttribute constructor -.


do something like :


Attribute attribute = new DefaultAttribute( "mail", "test@test.com");


That should work.


Feel free to fill a JIRA for the NPE you are facing, we should fix it.


Thanks !



Le 03/10/2017 à 13:15, Matthew Broadhead a écrit :
> i am reinvestigating some code that i previously had working and now i
> get a NPE
>
> AttributeType attributeType = new AttributeType("mail");
> StringValue stringValue = new StringValue(attributeType,
> "test@test.com");
> Attribute attribute = new DefaultAttribute(attributeType, stringValue);
>
> on the third line i get a NullPointerException and stepping through
> the code inside DefaultAttribute at line 1857 isHR =
> attributeType.getSyntax().isHumanReadable(); attributeType.syntax is
> null.

-- 
Emmanuel Lecharny

Symas.com
directory.apache.org


Mime
View raw message