You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by ra...@apache.org on 2006/02/10 01:25:43 UTC

svn commit: r376503 - /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java

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