Repository: cxf Updated Branches: refs/heads/3.1.x-fixes ac9fa2417 -> 62b79cc46
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/62b79cc4 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/62b79cc4 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/62b79cc4 Branch: refs/heads/3.1.x-fixes Commit: 62b79cc4630569bb970e3f168fba0188615f574b Parents: ac9fa24 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:31:22 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/62b79cc4/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 be0d02e..152bf8f 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 (Map.Entry<QName, PortType> entry : portTypes.entrySet()) {
