Return-Path: X-Original-To: apmail-tuscany-dev-archive@www.apache.org Delivered-To: apmail-tuscany-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1FDE79C2F for ; Thu, 7 Jun 2012 02:08:01 +0000 (UTC) Received: (qmail 40089 invoked by uid 500); 7 Jun 2012 02:08:01 -0000 Delivered-To: apmail-tuscany-dev-archive@tuscany.apache.org Received: (qmail 39969 invoked by uid 500); 7 Jun 2012 02:08:00 -0000 Mailing-List: contact dev-help@tuscany.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tuscany.apache.org Delivered-To: mailing list dev@tuscany.apache.org Received: (qmail 39960 invoked by uid 99); 7 Jun 2012 02:08:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2012 02:08:00 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of luckbr1975@gmail.com designates 209.85.220.181 as permitted sender) Received: from [209.85.220.181] (HELO mail-vc0-f181.google.com) (209.85.220.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2012 02:07:55 +0000 Received: by vcbf1 with SMTP id f1so90516vcb.26 for ; Wed, 06 Jun 2012 19:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=mS8taxBjIIzq9PpoQLf4QJEAbCCFBrsnYpW1b13CBFE=; b=MOFYeeGLQ5zHt1a7hYB3KiARYK8WQZG5Yz8nC+WZcr9Y+9R2WmGw3HWVzYlT/Magt4 Eo1O5tCTVBCQ1f37jC19/ReCk52O+lPLXopa+TWHBLv6VhBTTrvDQ6pihpdJZ3SgXQJZ XjAATQuLk/sfZromYC1PeJk4uyoJfu1GVL5gjtwodVxP7QzzcFNbVGfq/fl7ORkAvbOQ Qn1kQmCkjtmwUuvcg0VuFxEMMh0zS6ym4tl1XZBL1lEWYqmfOlN+Pq4bepZhDUNVBwk5 wwAK+F26fFMJGCwa44YnsXAaOvrcRB0r2HesmkQCx1TmdPkGWtrDO+bAxSYI8DQVJi9f kCJg== MIME-Version: 1.0 Received: by 10.52.98.39 with SMTP id ef7mr258733vdb.131.1339034854264; Wed, 06 Jun 2012 19:07:34 -0700 (PDT) Received: by 10.52.115.71 with HTTP; Wed, 6 Jun 2012 19:07:34 -0700 (PDT) Date: Wed, 6 Jun 2012 19:07:34 -0700 Message-ID: Subject: NPE in Widget, Re: svn commit: r1346827 - /tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java From: Luciano Resende To: dev@tuscany.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Jun 6, 2012 at 4:15 AM, wrote: > Author: antelder > Date: Wed Jun =C2=A06 11:15:29 2012 > New Revision: 1346827 > > URL: http://svn.apache.org/viewvc?rev=3D1346827&view=3Drev > Log: > Fix NPE with widget sample > > Modified: > =C2=A0 =C2=A0tuscany/sca-java-2.x/trunk/modules/implementation-widget-run= time/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/Wi= dgetImplementationInvoker.java > > Modified: tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtim= e/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/Widge= tImplementationInvoker.java > URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/impl= ementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementati= on/widget/provider/WidgetImplementationInvoker.java?rev=3D1346827&r1=3D1346= 826&r2=3D1346827&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/= main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImple= mentationInvoker.java (original) > +++ tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/= main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImple= mentationInvoker.java Wed Jun =C2=A06 11:15:29 2012 > @@ -56,7 +56,8 @@ class WidgetImplementationInvoker implem > =C2=A0 =C2=A0 public Message invoke(Message msg) { > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 // Get the resource id from the request messa= ge > - =C2=A0 =C2=A0 =C2=A0 =C2=A0String id =3D (String)((Object[])msg.getBody= ())[0]; > + > + =C2=A0 =C2=A0 =C2=A0 =C2=A0String id =3D msg.getBody() =3D=3D null ? ""= : (String)((Object[])msg.getBody())[0]; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 try { > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (id.length() =3D=3D 0) { > > Have you seen this using the store application or some other sample ? Just asking because I noticed that there is a bug on the binding.http + widget together which I'm trying to fix by making the widget more independent.. and I want to make sure I cover all the scenarios that it is being used. --=20 Luciano Resende http://people.apache.org/~lresende http://twitter.com/lresende1975 http://lresende.blogspot.com/