cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r806620 - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/common/xmlschema/ rt/javascript/src/main/java/org/apache/cxf/javascript/
Date Fri, 21 Aug 2009 16:12:29 GMT
Author: bimargulies
Date: Fri Aug 21 16:12:28 2009
New Revision: 806620

URL: http://svn.apache.org/viewvc?rev=806620&view=rev
Log:
CXF-2400: better diagnosis of elements with no specified type.

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java
    cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/Messages.properties
    cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/ParticleInfo.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java?rev=806620&r1=806619&r2=806620&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java
Fri Aug 21 16:12:28 2009
@@ -662,7 +662,7 @@
     }
 
     public static String cleanedUpSchemaSource(XmlSchemaObject subject) {
-        if (subject.getSourceURI() == null) {
+        if (subject == null || subject.getSourceURI() == null) {
             return "";
         } else {
             return subject.getSourceURI() + ":" + subject.getLineNumber(); 

Modified: cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/Messages.properties?rev=806620&r1=806619&r2=806620&view=diff
==============================================================================
--- cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/Messages.properties (original)
+++ cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/Messages.properties Fri
Aug 21 16:12:28 2009
@@ -33,3 +33,4 @@
 ATTRIBUTE_DANGLING_REFERENCE=Attribute {0} refers to undefined attribute {1}.
 ELEMENT_DANGLING_REFERENCE= Element {0} refers to undefined element {1}.
 UNSUPPORTED_ATTRIBUTE_ITEM= Unsupported {0} in {1}.
+ELEMENT_WITH_NO_TYPE=Element {0} has no type.

Modified: cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/ParticleInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/ParticleInfo.java?rev=806620&r1=806619&r2=806620&view=diff
==============================================================================
--- cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/ParticleInfo.java (original)
+++ cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/ParticleInfo.java Fri
Aug 21 16:12:28 2009
@@ -205,6 +205,12 @@
                                          ParticleInfo elementInfo) {
         elementInfo.type = element.getSchemaType();
         if (elementInfo.type == null) {
+            if (element.getSchemaTypeName() == null) {
+                Message message = new Message("ELEMENT_WITH_NO_TYPE", LOG, XmlSchemaUtils
+                                              .cleanedUpSchemaSource(elementInfo.getParticle()));
+                LOG.severe(message.toString());
+                throw new UnsupportedConstruct(message);
+            }
             if (element.getSchemaTypeName().equals(XmlSchemaConstants.ANY_TYPE_QNAME)) {
                 elementInfo.anyType = true;
             } else {



Mime
View raw message