Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 3dfac9202 -> d189a7cc5


Fix null pointer exception when importing a WSDL. This closes #78.

PartialWSDLProcessor.isPortTypeExisted() checks against 
definition.getAllPortTypes() (line 64), while the loop in WSDLServiceFactory 
iterates only over definition.getPortTypes() (line 136). This causes a null 
pointer exception in cases when addition WSDLs containing port type definitions 
are imported, but none are defined in the parent WSDL.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d189a7cc
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d189a7cc
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d189a7cc

Branch: refs/heads/3.0.x-fixes
Commit: d189a7cc5db6cacd86a80b8e60be169b2a7ca2ae
Parents: 3dfac92
Author: Tobias Goeschel <[email protected]>
Authored: Tue Jun 23 14:05:33 2015 +0200
Committer: Colm O hEigeartaigh <[email protected]>
Committed: Wed Feb 24 11:39:51 2016 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d189a7cc/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
----------------------------------------------------------------------
diff --git 
a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java 
b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
index 1d998ae..60ac705 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
@@ -133,7 +133,7 @@ public class WSDLServiceFactory extends 
AbstractServiceFactoryBean {
                     && (!PartialWSDLProcessor.isBindingExisted(definition, 
serviceName))
                     && (PartialWSDLProcessor.isPortTypeExisted(definition, 
serviceName))) {
                     try {
-                        Map<QName, PortType> portTypes = 
CastUtils.cast(definition.getPortTypes());
+                        Map<QName, PortType> portTypes = 
CastUtils.cast(definition.getAllPortTypes());
                         String existPortName = null;
                         PortType portType = null;
                         for (QName existPortQName : portTypes.keySet()) {

Reply via email to