cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cxf git commit: [CXF-7454] fixed NullPointerException during wsdl validation
Date Wed, 26 Jul 2017 11:58:57 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a7126b664 -> 9ef9bc3fd


[CXF-7454] fixed NullPointerException during wsdl validation


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

Branch: refs/heads/master
Commit: 9ef9bc3fdc96ab9b22a3c890cae2d120acb8dbb6
Parents: a7126b6
Author: Dennis Kieselhorst <deki@apache.org>
Authored: Wed Jul 26 13:58:46 2017 +0200
Committer: Dennis Kieselhorst <deki@apache.org>
Committed: Wed Jul 26 13:58:46 2017 +0200

----------------------------------------------------------------------
 .../wsdlto/databinding/jaxb/JAXBDataBinding.java    | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/9ef9bc3f/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
b/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
index 19e4fe5..7e57dc6 100644
--- a/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
+++ b/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
@@ -984,14 +984,18 @@ public class JAXBDataBinding implements DataBindingProfile {
                                            String systemId,
                                            String baseURI) {
                 String s = JAXBDataBinding.mapSchemaLocation(systemId, baseURI, catalog);
-                //System.out.println(namespaceURI + " " + systemId + " " + baseURI + " "
+ s);
+                LOG.fine("validating: " + namespaceURI + " " + systemId + " " + baseURI +
" " + s);
                 if (s == null) {
                     XmlSchema sc = schemaCollection.getSchemaByTargetNamespace(namespaceURI);
-                    StringWriter writer = new StringWriter();
-                    sc.write(writer);
-                    InputSource src = new InputSource(new StringReader(writer.toString()));
-                    src.setSystemId(sc.getSourceURI());
-                    return new LSInputSAXWrapper(src);
+                    if (sc != null) {
+                        StringWriter writer = new StringWriter();
+                        sc.write(writer);
+                        InputSource src = new InputSource(new StringReader(writer.toString()));
+                        src.setSystemId(sc.getSourceURI());
+                        return new LSInputSAXWrapper(src);
+                    } else {
+                        throw new ToolException("Schema not found for namespace: " + namespaceURI);
+                    }
                 }
                 return new LSInputSAXWrapper(new InputSource(s));
             }


Mime
View raw message