cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [3/3] cxf git commit: [CXF-6090] Add some NPE guards in xmlbeans tooling.
Date Fri, 07 Nov 2014 18:54:49 GMT
[CXF-6090] Add some NPE guards in xmlbeans tooling.


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

Branch: refs/heads/master
Commit: 7845fa85e7640bad0e7bd42d1a2ac77873def0ac
Parents: bd5fad7
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Nov 7 13:16:39 2014 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Nov 7 13:54:35 2014 -0500

----------------------------------------------------------------------
 .../cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java  | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7845fa85/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
index a1a99ba..3bbedcf 100644
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
+++ b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
@@ -42,6 +42,7 @@ import org.w3c.dom.Document;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
 
+import org.apache.cxf.common.jaxb.JAXBUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.tools.common.ToolConstants;
@@ -50,6 +51,7 @@ import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.DefaultValueWriter;
 import org.apache.cxf.tools.util.ClassCollector;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
+import org.apache.ws.commons.schema.constants.Constants;
 import org.apache.xmlbeans.SchemaGlobalElement;
 import org.apache.xmlbeans.SchemaProperty;
 import org.apache.xmlbeans.SchemaType;
@@ -144,6 +146,9 @@ public class XMLBeansToolingDataBinding implements DataBindingProfile
{
             if (type == null)  {
                 type = typeLoader.findDocumentType(qn);
             }
+            if (type == null) {
+                return null;
+            }
 
             ret = type.getFullJavaName();
             if (ret.contains("$")) {
@@ -157,6 +162,13 @@ public class XMLBeansToolingDataBinding implements DataBindingProfile
{
             type = typeLoader.findType(qn);
         }
 
+        if (type == null
+            && Constants.URI_2001_SCHEMA_XSD.equals(qn.getNamespaceURI())) {
+            return JAXBUtils.builtInTypeToJavaType(qn.getLocalPart());
+        }
+        if (type == null) {
+            return null;
+        }
         ret = type.getFullJavaName();
         return ret.replace('$', '.');
     }


Mime
View raw message