cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r536971 - /incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Date Thu, 10 May 2007 19:20:36 GMT
Author: dkulp
Date: Thu May 10 12:20:35 2007
New Revision: 536971

URL: http://svn.apache.org/viewvc?view=rev&rev=536971
Log:
CXF-641 - patch from Rick applied

Modified:
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?view=diff&rev=536971&r1=536970&r2=536971
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Thu May 10 12:20:35 2007
@@ -217,14 +217,21 @@
         } else {
             schema = schemaInfo.getSchema();
         }
+
+        XmlSchemaComplexType ct = new XmlSchemaComplexType(schema);
+        ct.setName(part.getElementQName().getLocalPart());
+        // Before updating everything, make sure we haven't added this 
+        // type yet.  Multiple methods that throw the same exception 
+        // types will cause duplicates. 
+        if (schema.getTypeByName(ct.getQName()) != null) {
+            return; 
+        }
         
         XmlSchemaElement el = new XmlSchemaElement();
         el.setQName(part.getElementQName());
         el.setName(part.getElementQName().getLocalPart());
         schema.getItems().add(el);
         
-        XmlSchemaComplexType ct = new XmlSchemaComplexType(schema);
-        ct.setName(part.getElementQName().getLocalPart());
         schema.getItems().add(ct);
         schema.addType(ct);
         el.setSchemaTypeName(part.getElementQName());



Mime
View raw message