Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D1FDA200D14 for ; Tue, 3 Oct 2017 18:27:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D023E1609DD; Tue, 3 Oct 2017 16:27:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 226551609D2 for ; Tue, 3 Oct 2017 18:27:15 +0200 (CEST) Received: (qmail 61487 invoked by uid 500); 3 Oct 2017 16:27:15 -0000 Mailing-List: contact users-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@directory.apache.org Delivered-To: mailing list users@directory.apache.org Received: (qmail 61471 invoked by uid 99); 3 Oct 2017 16:27:15 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2017 16:27:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 4BD38D2E17 for ; Tue, 3 Oct 2017 16:27:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.473 X-Spam-Level: * X-Spam-Status: No, score=1.473 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_LOW=-0.7, SPF_SOFTFAIL=0.972] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id V8zzBM_zeAQ5 for ; Tue, 3 Oct 2017 16:27:12 +0000 (UTC) Received: from zmcc-5-mx.zmailcloud.com (zmcc-5-mx.zmailcloud.com [52.201.171.122]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id DA31A5F1EE for ; Tue, 3 Oct 2017 16:27:11 +0000 (UTC) Received: from zmcc-5-mta-1.zmailcloud.com (127.37.197.104.bc.googleusercontent.com [104.197.37.127]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zmcc-5-mx.zmailcloud.com (Postfix) with ESMTPS id 3DDBE404FE for ; Tue, 3 Oct 2017 11:30:45 -0500 (CDT) Received: from zmcc-5-mta-1.zmailcloud.com (localhost [127.0.0.1]) by zmcc-5-mta-1.zmailcloud.com (Postfix) with ESMTPS id 3B967C1128 for ; Tue, 3 Oct 2017 11:27:05 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by zmcc-5-mta-1.zmailcloud.com (Postfix) with ESMTP id 2E993C1121 for ; Tue, 3 Oct 2017 11:27:05 -0500 (CDT) X-Virus-Scanned: amavisd-new at zmcc-5-mta-1.zmailcloud.com Received: from zmcc-5-mta-1.zmailcloud.com ([127.0.0.1]) by localhost (zmcc-5-mta-1.zmailcloud.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id e-f8HWUROiMC for ; Tue, 3 Oct 2017 11:27:05 -0500 (CDT) Received: from macbook-pro.home (LFbn-1-817-net.w86-246.abo.wanadoo.fr [86.246.51.0]) by zmcc-5-mta-1.zmailcloud.com (Postfix) with ESMTPSA id BC21AC0573 for ; Tue, 3 Oct 2017 11:27:04 -0500 (CDT) Subject: Re: DefaultAttribute NPE To: "users@directory.apache.org" References: From: =?UTF-8?Q?Emmanuel_L=c3=a9charny?= Message-ID: Date: Tue, 3 Oct 2017 18:27:03 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: quoted-printable archived-at: Tue, 03 Oct 2017 16:27:17 -0000 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 =3D 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 =C3=A0 13:15, Matthew Broadhead a =C3=A9crit=C2=A0: > i am reinvestigating some code that i previously had working and now i > get a NPE > > AttributeType attributeType =3D new AttributeType("mail"); > StringValue stringValue =3D new StringValue(attributeType, > "test@test.com"); > Attribute attribute =3D new DefaultAttribute(attributeType, stringValue= ); > > on the third line i get a NullPointerException and stepping through > the code inside DefaultAttribute at line 1857 isHR =3D > attributeType.getSyntax().isHumanReadable(); attributeType.syntax is > null. --=20 Emmanuel Lecharny Symas.com directory.apache.org