You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Luciano Resende <lu...@gmail.com> on 2012/06/07 04:07:34 UTC

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

On Wed, Jun 6, 2012 at 4:15 AM,  <an...@apache.org> wrote:
> Author: antelder
> Date: Wed Jun  6 11:15:29 2012
> New Revision: 1346827
>
> URL: http://svn.apache.org/viewvc?rev=1346827&view=rev
> Log:
> Fix NPE with widget sample
>
> Modified:
>    tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java
>
> Modified: tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java?rev=1346827&r1=1346826&r2=1346827&view=diff
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java (original)
> +++ tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java Wed Jun  6 11:15:29 2012
> @@ -56,7 +56,8 @@ class WidgetImplementationInvoker implem
>     public Message invoke(Message msg) {
>
>         // Get the resource id from the request message
> -        String id = (String)((Object[])msg.getBody())[0];
> +
> +        String id = msg.getBody() == null ? "" : (String)((Object[])msg.getBody())[0];
>         try {
>
>             if (id.length() == 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.


-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Re: 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

Posted by ant elder <an...@gmail.com>.
On Thu, Jun 7, 2012 at 3:07 AM, Luciano Resende <lu...@gmail.com> wrote:
> On Wed, Jun 6, 2012 at 4:15 AM,  <an...@apache.org> wrote:
>> Author: antelder
>> Date: Wed Jun  6 11:15:29 2012
>> New Revision: 1346827
>>
>> URL: http://svn.apache.org/viewvc?rev=1346827&view=rev
>> Log:
>> Fix NPE with widget sample
>>
>> Modified:
>>    tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java
>>
>> Modified: tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java
>> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java?rev=1346827&r1=1346826&r2=1346827&view=diff
>> ==============================================================================
>> --- tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java (original)
>> +++ tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java Wed Jun  6 11:15:29 2012
>> @@ -56,7 +56,8 @@ class WidgetImplementationInvoker implem
>>     public Message invoke(Message msg) {
>>
>>         // Get the resource id from the request message
>> -        String id = (String)((Object[])msg.getBody())[0];
>> +
>> +        String id = msg.getBody() == null ? "" : (String)((Object[])msg.getBody())[0];
>>         try {
>>
>>             if (id.length() == 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.
>

Just samples\applications\store running with mvn exec:java in trunk.

   ...ant