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", "t...@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,
> "t...@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

Reply via email to