[
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]