cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/6] cxf git commit: [CXF-7454] fixed NullPointerException during wsdl validation
Date Fri, 28 Jul 2017 16:20:59 GMT
[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/12b364c1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/12b364c1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/12b364c1

Branch: refs/heads/3.0.x-fixes
Commit: 12b364c1ae7ea14afde77eceeec3bd7bff6dfbf0
Parents: 397cffd
Author: Dennis Kieselhorst <deki@apache.org>
Authored: Wed Jul 26 13:58:46 2017 +0200
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Jul 28 12:19:10 2017 -0400

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/12b364c1/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 d2e4e11..6c8e643 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
@@ -985,14 +985,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