directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Broadhead <matthew.broadh...@nbmlaw.co.uk>
Subject Re: DefaultAttribute NPE
Date Thu, 05 Oct 2017 15:19:31 GMT
thanks Emmanuel that worked fine.  if the error was down to me misusing 
the API then there is no need to fill a JIRA?

On 03/10/2017 18:27, Emmanuel Lécharny wrote:
> 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.


Mime
View raw message