Author: dkulp
Date: Tue Jul 15 17:53:47 2014
New Revision: 1610773

URL: http://svn.apache.org/r1610773
Log:
[XMLSCHEMA-32] Lookup base types for ComplexContentRestriction 
Patch from Dmitry Repchevsky applied

Modified:
    
webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexType.java
    
webservices/xmlschema/trunk/xmlschema-core/src/test/java/tests/ComplexContentRestrictionTest.java

Modified: 
webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexType.java
URL: 
http://svn.apache.org/viewvc/webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexType.java?rev=1610773&r1=1610772&r2=1610773&view=diff
==============================================================================
--- 
webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexType.java
 (original)
+++ 
webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexType.java
 Tue Jul 15 17:53:47 2014
@@ -138,12 +138,13 @@ public class XmlSchemaComplexType extend
             return null;
         }
 
-        if (!(content instanceof XmlSchemaComplexContentExtension)) {
-            return null;
+        if (content instanceof XmlSchemaComplexContentExtension) {
+            return 
((XmlSchemaComplexContentExtension)content).getBaseTypeName();
         }
-
-        XmlSchemaComplexContentExtension ext = 
(XmlSchemaComplexContentExtension)content;
-        return ext.getBaseTypeName();
+        if (content instanceof XmlSchemaComplexContentRestriction) {
+            return 
((XmlSchemaComplexContentRestriction)content).getBaseTypeName();
+        }
+        return null;
     }
 
     void setAttributeWildcard(XmlSchemaAnyAttribute attributeWildcard) {

Modified: 
webservices/xmlschema/trunk/xmlschema-core/src/test/java/tests/ComplexContentRestrictionTest.java
URL: 
http://svn.apache.org/viewvc/webservices/xmlschema/trunk/xmlschema-core/src/test/java/tests/ComplexContentRestrictionTest.java?rev=1610773&r1=1610772&r2=1610773&view=diff
==============================================================================
--- 
webservices/xmlschema/trunk/xmlschema-core/src/test/java/tests/ComplexContentRestrictionTest.java
 (original)
+++ 
webservices/xmlschema/trunk/xmlschema-core/src/test/java/tests/ComplexContentRestrictionTest.java
 Tue Jul 15 17:53:47 2014
@@ -67,6 +67,9 @@ public class ComplexContentRestrictionTe
 
         XmlSchemaComplexType cType = 
(XmlSchemaComplexType)schemaCol.getTypeByQName(typeQName);
         assertNotNull(cType);
+        
+        QName baseName = cType.getBaseSchemaTypeName();
+        assertEquals(new QName("http://soapinterop.org/types";, 
"AssemblyRequiredProduct"), baseName);
 
         XmlSchemaContentModel xscm = cType.getContentModel();
         assertNotNull(xscm);


Reply via email to