diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-11-18 15:12:18 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-11-18 15:12:18 +0000 |
commit | 628701e626a0fbf4b345396f1bfbf22aa640ae13 (patch) | |
tree | 86e8995de42e59a0fc9fbec355e9902a75b3f3dd /sca-java-2.x/trunk/modules | |
parent | 14ed14d267f56ff5a89959c2afef265a162daafc (diff) |
Fix a couple of NPE and index out of bound exceptions for async operations with void return types
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1203688 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r-- | sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java b/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java index 315054fc82..daa0bebd81 100644 --- a/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java +++ b/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java @@ -101,7 +101,10 @@ public class JAXWSAsyncInterfaceProcessor implements JavaInterfaceVisitor { } //a return type of Response<R> where R is the return type of M - DataType<?> operationOutputType = operation.getOutputType().getLogical().get(0); + DataType<?> operationOutputType = null; + if (operation.getOutputType()!= null && operation.getOutputType().getLogical() != null && operation.getOutputType().getLogical().size() > 0) { + operationOutputType = operation.getOutputType().getLogical().get(0); + } DataType<?> asyncOperationOutputType = asyncOperation.getOutputType().getLogical().get(0); if (operationOutputType != null && asyncOperationOutputType != null) { @@ -173,7 +176,6 @@ public class JAXWSAsyncInterfaceProcessor implements JavaInterfaceVisitor { Class<?> asyncLastParameterTypeClass = asyncOperationInputType.get(size).getPhysical(); if (asyncLastParameterTypeClass == AsyncHandler.class) { //now check the actual type of the AsyncHandler<R> with R - Class<?> returnType = operation.getOutputType().getLogical().get(0).getPhysical(); Class<?> asyncActualLastParameterTypeClass = Object.class; if (genericParamType instanceof ParameterizedType) { ParameterizedType asyncLastParameterType = (ParameterizedType)genericParamType; @@ -188,12 +190,17 @@ public class JAXWSAsyncInterfaceProcessor implements JavaInterfaceVisitor { } } - if (returnType == asyncActualLastParameterTypeClass || returnType.isPrimitive() - && primitiveAssignable(returnType, asyncActualLastParameterTypeClass)) { - return true; - } else { - return false; + Class<?> returnType = null; + if (operation.getOutputType() != null && operation.getOutputType().getLogical() != null && operation.getOutputType().getLogical().size() > 0) { + returnType = operation.getOutputType().getLogical().get(0).getPhysical(); + } + if (returnType != null) { + if (returnType == asyncActualLastParameterTypeClass || returnType.isPrimitive() + && primitiveAssignable(returnType, asyncActualLastParameterTypeClass)) { + return true; + } } + return false; } return true; |