[jira] [Commented] (DIRAPI-302) DefaultAttribute NPE

2018-04-09 Thread Matthew Broadhead (JIRA)

[ 
https://issues.apache.org/jira/browse/DIRAPI-302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16431020#comment-16431020
 ] 

Matthew Broadhead commented on DIRAPI-302:
--

thanks



> DefaultAttribute NPE
> 
>
> Key: DIRAPI-302
> URL: https://issues.apache.org/jira/browse/DIRAPI-302
> Project: Directory Client API
>  Issue Type: Bug
>Affects Versions: 1.0.0
>Reporter: Matthew Broadhead
>Priority: Major
> Fix For: 2.0.0
>
>
> 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. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DIRAPI-302) DefaultAttribute NPE

2017-12-26 Thread Emmanuel Lecharny (JIRA)

[ 
https://issues.apache.org/jira/browse/DIRAPI-302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16303747#comment-16303747
 ] 

Emmanuel Lecharny commented on DIRAPI-302:
--

The error you get is 'normal' (although not very explicit).

When you create an {{AtttributeType}}, it's supposed to be a valid instance, ie 
it should contain a {{Syntax}} instance. 

You probably want to do something like :

{code:java}
Value address = new Value( "t...@test.com" );
Attribute mail = new DefaultAttribute( "mail", address );
{code}

or even simpler :

{code:java}
Attribute mail = new DefaultAttribute( "mail", "t...@test.com" );
{code}

> DefaultAttribute NPE
> 
>
> Key: DIRAPI-302
> URL: https://issues.apache.org/jira/browse/DIRAPI-302
> Project: Directory Client API
>  Issue Type: Bug
>Affects Versions: 1.0.0
>Reporter: Matthew Broadhead
>
> 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. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)