Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 85815 invoked from network); 21 Dec 2006 12:56:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Dec 2006 12:56:56 -0000 Received: (qmail 48205 invoked by uid 500); 21 Dec 2006 12:57:03 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 48161 invoked by uid 500); 21 Dec 2006 12:57:03 -0000 Mailing-List: contact cxf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-dev@incubator.apache.org Received: (qmail 48142 invoked by uid 99); 21 Dec 2006 12:57:03 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Dec 2006 04:57:03 -0800 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,SUBJECT_ENCODED_TWICE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of Ning.Jiang@iona.com designates 65.223.216.181 as permitted sender) Received: from [65.223.216.181] (HELO amereast-smg1.iona.com) (65.223.216.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Dec 2006 04:56:53 -0800 Received: from amer-ems1.IONAGLOBAL.COM ([10.65.6.25]) by amereast-smg1.iona.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id kBLCuAEg008380 for ; Thu, 21 Dec 2006 07:56:10 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C724FF.6F10ADB3" Subject: =?gb2312?B?tPC4tDogUE1EIGlzc3VlIFt3YXMgUmU6IHN2biBjb21taXQ6IHI0OA==?= =?gb2312?B?ODk0OCBbMS8zXV0=?= Date: Thu, 21 Dec 2006 07:55:16 -0500 Message-ID: <9A4696F35B459043970EE4A85A31739002549F@amer-ems1.IONAGLOBAL.COM> X-MS-Has-Attach: X-MS-TNEF-Correlator: <9A4696F35B459043970EE4A85A31739002549F@amer-ems1.IONAGLOBAL.COM> Thread-Topic: PMD issue [was Re: svn commit: r488948 [1/3]] Thread-Index: Acck4AIqvEtfoJ61T8uYk3qdWV6lHwAH0DLd References: <7b774c950612200024n78bfab1dm8ffbbd3fbdc27247@mail.gmail.com> <458A4291.9010707@iona.com> <458A4F2C.8010506@iona.com> From: "Jiang, Ning \(Willem\)" To: X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C724FF.6F10ADB3 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable The question is exception build need to call the Message's toString() = method. :) -----Original Message----- From: James Mao [mailto:james.mao@iona.com] Sent: 12/21/2006 (=D0=C7=C6=DA=CB=C4) 17:09 To: cxf-dev@incubator.apache.org Subject: Re: PMD issue [was Re: svn commit: r488948 [1/3]] =20 Question is why not throw the exception when you trying to retrieve the=20 opName? > Hi Dan, > > I just looked into this PMD error in Eclipse, find this is your code's = > error :) > > OperationInfo(InterfaceInfo it, QName n) { > intf =3D it; > setName(n); > } > OperationInfo(OperationInfo op) { > intf =3D op.getInterface(); > setName(op.getName()); > } > ... public final void setName(QName name) { > if (name =3D=3D null) { > throw new NullPointerException( > new Message("OPERATION.NAME.NOT.NULL", = LOG).toString()); > } opName =3D name; > } > > The code is looked like this, the setName(QName name) is called in the = > OperationInfo, and if the name is null the setName() will call the=20 > Messsage. toString() which can be overridden. So the PMD think your=20 > code violated the rule of not calling overridden methods. > > I tried to set the Message.toString to be final, but PMD error still=20 > there, so I changed the throw new NullPointerException(...) to throw=20 > new NullPointerException("Operation Name cannot be null."); > > So I commited these change , and change the PMD rule back. > > Cheers, > > Willem. > > Dan Diephouse wrote: > >> On 12/20/06, dandiep@apache.org wrote: >> >>> >>> >>> =20 >>> = incubator/cxf/trunk/buildtools/src/main/resources/cxf-pmd-ruleset.xml >>> >>> >> >> I forgot to add in my commit notes: I had to change this as PMD seems = to >> have a bug in it. It thought I was calling toString() in the=20 >> constructor and >> that violated the rule of not calling overridden methods. However I'm = >> not >> calling it AFAIK. Let me know if I missed something... >> >> - Dan >> > > ------_=_NextPart_001_01C724FF.6F10ADB3--