You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Mark Combellack (JIRA)" <tu...@ws.apache.org> on 2007/09/28 17:34:51 UTC

[jira] Commented: (TUSCANY-1819) RequestContext.getCallback() throws NullPointerException when there is no call back

    [ https://issues.apache.org/jira/browse/TUSCANY-1819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12531047 ] 

Mark Combellack commented on TUSCANY-1819:
------------------------------------------

The problem is in the RequestContextImpl class of the tuscany-core module. The offending code is:

    public <CB> CB getCallback() {
        return (CB) getCallbackReference().getService();
    }


When there is no call back, the result from getCallbackReference() will be null so when getService() is called, it will throw a NullPointerException.

The code should be updated to check for null before calling getService()


> RequestContext.getCallback() throws NullPointerException when there is no call back
> -----------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1819
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1819
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core Runtime
>    Affects Versions: Java-SCA-1.0
>            Reporter: Mark Combellack
>            Priority: Minor
>             Fix For: Java-SCA-Next
>
>
> If you call the getCallback() method on the RequestContext for a Component that does not have a call back, the code throws a NullPointerException:
> java.lang.NullPointerException
>   at org.apache.tuscany.sca.core.context.RequestContextImpl.getCallback(RequestContextImpl.java:77)
>   at net.ubiquity.sipsoa.compliance.requestcontext.basic.RequestContextPojoImpl.testGetCallback(RequestContextPojoImpl.java:95) 
>   .....
> This is different behaviour to the RequestContext.getCallbackReference() method that will just return null.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org