xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r376503 - /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
Date Fri, 10 Feb 2006 00:25:43 GMT
Author: radup
Date: Thu Feb  9 16:25:42 2006
New Revision: 376503

URL: http://svn.apache.org/viewcvs?rev=376503&view=rev
Log:
For the generated code for an array setter where the element is the head of a substitution
group the insertNewXXX() setter in the impl class was being generated incorrectly in that
it did not pass in the QNameSet defining the members of the substitution group. This meant
if you inserted into an array of such things and there were substituted elements already present
they would be ignored in deciding what position to insert. This submission fixes that.

Contributed by Lawrence Jones

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java?rev=376503&r1=376502&r2=376503&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
Thu Feb  9 16:25:42 2006
@@ -2362,7 +2362,15 @@
             emitImplementationPreamble();
             emitDeclareTarget(true, xtype);
             emitPre(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr, "i");
-            emit("target = (" + xtype + ")get_store().insert_element_user(" + identifier
+ ", i);");
+            if (!isSubstGroup)
+            {
+                emit("target = (" + xtype + ")get_store().insert_element_user(" + identifier
+ ", i);");
+            }
+            else // This is a subst group case
+            {
+                emit("target = (" + xtype + ")get_store().insert_element_user(" +
+                        setIdentifier + ", " + identifier + ", i);");
+            }
             emitPost(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr, "i");
             emit("return target;");
             emitImplementationPostamble();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


Mime
View raw message