From commitsjohn56@example.net Wed Aug 02 21:37:24 2006
Return-Path: <commitsjohn56@example.net>
Delivered-To: john56@example.net
Received: (qmail 90303 invoked from network); 2 Aug 2006 21:37:24 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 2 Aug 2006 21:37:24 -0000
Received: (qmail 39752 invoked by uid 500); 2 Aug 2006 21:37:23 -0000
Delivered-To: john56@example.net
Received: (qmail 39735 invoked by uid 500); 2 Aug 2006 21:37:23 -0000
Mailing-List: contact john56@example.net; run by ezmlm
Precedence: bulk
List-Post: <mailto:john56@example.net>
List-Help: <mailto:john56@example.net>
List-Unsubscribe: <mailto:john56@example.net>
Reply-To: john56@example.net
List-Id: <commits.xmlbeans.apache.org>
Delivered-To: mailing list john56@example.net
Received: (qmail 39723 invoked by uid 99); 2 Aug 2006 21:37:23 -0000
Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 14:37:23 -0700
X-ASF-Spam-Status: No, hits=-9.4 required=10.0
	tests=ALL_TRUSTED,NO_REAL_NAME
X-Spam-Check-By: apache.org
Received-SPF: pass (asf.osuosl.org: local policy)
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 14:37:22 -0700
Received: by eris.apache.org (Postfix, from userid 65534)
	id 52EF71A981A; Wed,  2 Aug 2006 14:37:02 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r428159 - in /xmlbeans/trunk/src:
 store/org/apache/xmlbeans/impl/store/Saver.java
 typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java
 typeimpl/org/apache/xmlbeans/impl/schema/StscImporter.java
Date: Wed, 02 Aug 2006 21:37:01 -0000
To: john56@example.net
From: john56@example.net
X-Mailer: svnmailer-1.0.8
Message-Id: <john56@example.net>
X-Virus-Checked: Checked by ClamAV on apache.org
X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N

Author: radup
Date: Wed Aug  2 14:37:01 2006
New Revision: 428159

URL: http://svn.apache.org/viewvc?rev=428159&view=rev
Log:
Fix for JIRA issue XMLBEANS-209.

Modified:
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscImporter.java

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java?rev=428159&r1=428158&r2=428159&view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java Wed Aug  2 14:37:01 2006
@@ -1500,6 +1500,8 @@
             assert _free >= dCch;
             assert getAvailable() > 0;
 
+            int charsToCopy = dCch + 1;
+
             if (_out > _in && i >= _out)
             {
                 System.arraycopy( _buf, _out, _buf, _out - dCch, i - _out );
@@ -1515,23 +1517,33 @@
                     System.arraycopy( _buf, i, _buf, i + dCch, _in - i );
                     _in += dCch;
                 }
-                else
+                else if ( dCch <= availableEndChunk + _in - i - 1 )
                 {
-                    int numToCopyToStart = _in - i - availableEndChunk;
+                    int numToCopyToStart = dCch - availableEndChunk;
                     System.arraycopy( _buf, _in-numToCopyToStart, _buf, 0, numToCopyToStart );
-                    System.arraycopy( _buf, i, _buf, i+dCch, availableEndChunk );
+                    System.arraycopy( _buf, i+1, _buf, i+1+dCch, _in-i-1-numToCopyToStart);
 
                     _in = numToCopyToStart;
                 }
+                else
+                {
+                    int numToCopyToStart = _in - i - 1;
+                    charsToCopy = availableEndChunk + _in - i;
+
+                    System.arraycopy( _buf, _in-numToCopyToStart, _buf, dCch-charsToCopy+1, numToCopyToStart );
+                    replacement.getChars( charsToCopy, dCch + 1, _buf, 0);
+
+                    _in = numToCopyToStart + dCch - charsToCopy + 1;
+                }
             }
 
-            replacement.getChars( 0, dCch + 1, _buf, i );
+            replacement.getChars( 0, charsToCopy, _buf, i );
 
             _free -= dCch;
 
             assert _free >= 0;
 
-            return i + dCch + 1;
+            return (i + dCch + 1) % _buf.length;
         }
         //
         //

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java?rev=428159&r1=428158&r2=428159&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java Wed Aug  2 14:37:01 2006
@@ -298,7 +298,7 @@
             }
 
             // deal with imports and includes
-            StscImporter.SchemaToProcess[] schemasAndChameleons = StscImporter.resolveImportsAndIncludes(startWith);
+            StscImporter.SchemaToProcess[] schemasAndChameleons = StscImporter.resolveImportsAndIncludes(startWith, incremental);
 
             // call the translator so that it may also perform magic
             StscTranslator.addAllDefinitions(schemasAndChameleons);

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscImporter.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscImporter.java?rev=428159&r1=428158&r2=428159&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscImporter.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscImporter.java Wed Aug  2 14:37:01 2006
@@ -34,6 +34,7 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.MalformedURLException;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.Reader;
 import java.io.InputStream;
@@ -59,10 +60,10 @@
 
 public class StscImporter
 {
-    public static SchemaToProcess[] resolveImportsAndIncludes(Schema[] startWith)
+    public static SchemaToProcess[] resolveImportsAndIncludes(Schema[] startWith, boolean forceSrcSave)
     {
         DownloadTable engine = new DownloadTable(startWith);
-        return engine.resolveImportsAndIncludes();
+        return engine.resolveImportsAndIncludes(forceSrcSave);
     }
 
     public static class SchemaToProcess
@@ -596,7 +597,7 @@
                     if (urlToLoad == null)
                         throw new IOException("EntityResolver unable to resolve " + absoluteURL + " (for namespace " + namespace + ")");
 
-                    copySchemaSource(absoluteURL, state);
+                    copySchemaSource(absoluteURL, state, false);
                     XmlOptions options = new XmlOptions();
                     options.setLoadLineNumbers();
                     options.setLoadMessageDigest();
@@ -608,7 +609,7 @@
 
             // no resolver - just use the URL directly, no substitution
             state.addSourceUri(absoluteURL, null);
-            copySchemaSource(absoluteURL, state);
+            copySchemaSource(absoluteURL, state, false);
 
             XmlOptions options = new XmlOptions();
             options.setLoadLineNumbers();
@@ -740,7 +741,7 @@
             }
         }
 
-        public SchemaToProcess[] resolveImportsAndIncludes()
+        public SchemaToProcess[] resolveImportsAndIncludes(boolean forceSave)
         {
             StscState state = StscState.get();
             List result = new ArrayList();
@@ -763,7 +764,7 @@
                     String uri = stp.getSourceName();
                     state.addSourceUri(uri, null);
                     result.add(stp);
-                    copySchemaSource(uri, state);
+                    copySchemaSource(uri, state, forceSave);
 
                     {
                         // handle imports
@@ -936,7 +937,7 @@
             }
         }
 
-        private static void copySchemaSource(String urlLoc, StscState state)
+        private static void copySchemaSource(String urlLoc, StscState state, boolean forceCopy)
         {
             //Copy the schema file if it wasn't already copied
             if (state.getSchemasDir()!=null)
@@ -944,7 +945,7 @@
                 String schemalocation = state.sourceNameForUri(urlLoc);
 
                 File targetFile = new File(state.getSchemasDir(), schemalocation);
-                if (!targetFile.exists())
+                if (forceCopy || !targetFile.exists())
                 {
                     try
                     {
@@ -954,10 +955,22 @@
                         InputStream in = null;
                         URL url = new URL(urlLoc);
                         // Copy the file from filepath to schema[METADATA_PACKAGE_GEN]/src/<schemaFile>
-                        in = url.openStream();
-
-                        FileOutputStream out = new FileOutputStream(targetFile);
-                        IOUtil.copyCompletely(in, out);
+                        try
+                        {
+                            in = url.openStream();
+                        }
+                        catch (FileNotFoundException fnfe)
+                        {
+                            if (forceCopy && targetFile.exists())
+                                targetFile.delete();
+                            else
+                                throw fnfe;
+                        }
+                        if (in != null)
+                        {
+                            FileOutputStream out = new FileOutputStream(targetFile);
+                            IOUtil.copyCompletely(in, out);
+                        }
                     }
                     catch (IOException e)
                     {



---------------------------------------------------------------------
To unsubscribe, e-mail: john56@example.net
For additional commands, e-mail: john56@example.net


From commitsjohn56@example.net Fri Aug 04 19:14:42 2006
Return-Path: <commitsjohn56@example.net>
Delivered-To: john56@example.net
Received: (qmail 3911 invoked from network); 4 Aug 2006 19:14:42 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 4 Aug 2006 19:14:42 -0000
Received: (qmail 87769 invoked by uid 500); 4 Aug 2006 19:14:42 -0000
Delivered-To: john56@example.net
Received: (qmail 87728 invoked by uid 500); 4 Aug 2006 19:14:41 -0000
Mailing-List: contact john56@example.net; run by ezmlm
Precedence: bulk
List-Post: <mailto:john56@example.net>
List-Help: <mailto:john56@example.net>
List-Unsubscribe: <mailto:john56@example.net>
Reply-To: john56@example.net
List-Id: <commits.xmlbeans.apache.org>
Delivered-To: mailing list john56@example.net
Received: (qmail 87717 invoked by uid 99); 4 Aug 2006 19:14:41 -0000
Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Aug 2006 12:14:41 -0700
X-ASF-Spam-Status: No, hits=-9.4 required=10.0
	tests=ALL_TRUSTED,NO_REAL_NAME
X-Spam-Check-By: apache.org
Received-SPF: pass (asf.osuosl.org: local policy)
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Aug 2006 12:14:40 -0700
Received: by eris.apache.org (Postfix, from userid 65534)
	id 5EFBB1A981A; Fri,  4 Aug 2006 12:14:20 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r428846 -
 /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java
Date: Fri, 04 Aug 2006 19:14:20 -0000
To: john56@example.net
From: john56@example.net
X-Mailer: svnmailer-1.0.8
Message-Id: <john56@example.net>
X-Virus-Checked: Checked by ClamAV on apache.org
X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N

Author: radup
Date: Fri Aug  4 12:14:19 2006
New Revision: 428846

URL: http://svn.apache.org/viewvc?rev=428846&view=rev
Log:
Fixed the array setter (again).

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java?rev=428846&r1=428845&r2=428846&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java Fri Aug  4 12:14:19 2006
@@ -1052,23 +1052,110 @@
 
     protected void arraySetterHelper ( XmlObject[] sources, QName elemName )
     {
-        int n = sources == null ? 0 : sources.length;
-        
         TypeStore store = get_store();
 
-        int m = store.count_elements( elemName );
+        if (sources == null || sources.length == 0)
+        {
+            int m = store.count_elements( elemName );
+            for ( ; m > 0 ; m-- )
+                store.remove_element( elemName, 0 );
+            return;
+        }
+
+        // Verify if the sources contain children of this node
+        int i;
+        int m = store.count_elements( elemName ); // how many elements in the original array
+        int startSrc = 0, startDest = 0;
+        for (i = 0; i < sources.length; i++)
+        {
+            XmlCursor c = sources[i].newCursor();
+            if (c.toParent() && c.getObject() == this)
+            {
+                c.dispose();
+                break;
+            }
+            c.dispose();
+        }
+        if (i < sources.length)
+        {
+            TypeStoreUser current = store.find_element_user( elemName, 0 );
+            if (current == sources[i])
+            {
+                // The new object matches what already exists in the array
+                // Heuristic: we optimize for the case where the new elements
+                // in the array are the same as the existing elements with
+                // potentially new elements inserted
+
+                // First insert the new element in the array at position 0
+                int j = 0;
+                for ( j = 0; j < i; j++ )
+                {
+                    TypeStoreUser user = store.insert_element_user( elemName, j );
+                    ((XmlObjectBase) user).set( sources[j] );
+                }
+                for ( i++, j++; i < sources.length; i++, j++)
+                {
+                    XmlCursor c = sources[i].newCursor();
+                    if (c.toParent() && c.getObject() == this)
+                    {
+                        c.dispose();
+                        current = store.find_element_user( elemName, j );
+                        if (current == sources[i])
+                            ; // advance
+                        else
+                        {
+                            // Fall back to the general case
+                            break;
+                        }
+                    }
+                    else
+                    {
+                        c.dispose();
+                        // Insert before the current element
+                        TypeStoreUser user = store.insert_element_user( elemName, j );
+                        ((XmlObjectBase) user).set( sources[i] );
+                    }
+                }
+                startDest = j;
+                startSrc = i;
+                m = store.count_elements( elemName );
+            }
+            // Fall through
+        }
+        else
+        {
+            // All of the elements in the existing array are to
+            // be deleted and replaced with elements from the
+            // sources array
+        }
 
-        for ( ; m > n ; m-- )
+        // The general case: we assume that some of the elements
+        // in the new array already exist, but at different indexes
+
+        // Starting with position i in the sources array, copy the remaining elements
+        // to the end of the original array...
+        for (int j = i; j < sources.length; j++)
+        {
+            TypeStoreUser user = store.add_element_user( elemName );
+            ((XmlObjectBase) user).set( sources[ j ] );
+        }
+
+        // ... then come back and insert the elements starting with startSource
+        // up to i from the sources array into the current array, starting with
+        // startDest
+        int n = i;
+        for ( ; m > n - startSrc + startDest; m-- )
             store.remove_element( elemName, m - 1 );
 
-        for ( int i = 0 ; i < n ; i++ )
+        int j;
+        for ( i = startSrc, j = startDest ; i < n ; i++, j++ )
         {
             TypeStoreUser user;
-            
-            if (i >= m)
+
+            if (j >= m)
                 user = store.add_element_user( elemName );
             else
-                user = store.find_element_user( elemName, i );
+                user = store.find_element_user( elemName, j );
 
             ((XmlObjectBase) user).set( sources[ i ] );
         }
@@ -1076,28 +1163,115 @@
         // We can't just delegate to array_setter because we need
         // synchronization on the sources (potentially each element
         // in the array on a different lock)
-        // get_store().array_setter( sources, elemName );
+//         get_store().array_setter( sources, elemName );
     }
 
     protected void arraySetterHelper ( XmlObject[] sources, QName elemName, QNameSet set )
     {
-        int n = sources == null ? 0 : sources.length;
-        
         TypeStore store = get_store();
 
-        int m = store.count_elements( set );
+        if (sources == null || sources.length == 0)
+        {
+            int m = store.count_elements( set );
+            for ( ; m > 0 ; m-- )
+                store.remove_element( set, 0 );
+            return;
+        }
+
+        // Verify if the sources contain children of this node
+        int i;
+        int m = store.count_elements( set ); // how many elements in the original array
+        int startSrc = 0, startDest = 0;
+        for (i = 0; i < sources.length; i++)
+        {
+            XmlCursor c = sources[i].newCursor();
+            if (c.toParent() && c.getObject() == this)
+            {
+                c.dispose();
+                break;
+            }
+            c.dispose();
+        }
+        if (i < sources.length)
+        {
+            TypeStoreUser current = store.find_element_user( set, 0 );
+            if (current == sources[i])
+            {
+                // The new object matches what already exists in the array
+                // Heuristic: we optimize for the case where the new elements
+                // in the array are the same as the existing elements with
+                // potentially new elements inserted
+
+                // First insert the new element in the array at position 0
+                int j = 0;
+                for ( j = 0; j < i; j++ )
+                {
+                    TypeStoreUser user = store.insert_element_user( set, elemName, j );
+                    ((XmlObjectBase) user).set( sources[j] );
+                }
+                for ( i++, j++; i < sources.length; i++, j++)
+                {
+                    XmlCursor c = sources[i].newCursor();
+                    if (c.toParent() && c.getObject() == this)
+                    {
+                        c.dispose();
+                        current = store.find_element_user( set, j );
+                        if (current == sources[i])
+                            ; // advance
+                        else
+                        {
+                            // Fall back to the general case
+                            break;
+                        }
+                    }
+                    else
+                    {
+                        c.dispose();
+                        // Insert before the current element
+                        TypeStoreUser user = store.insert_element_user( set, elemName, j );
+                        ((XmlObjectBase) user).set( sources[i] );
+                    }
+                }
+                startDest = j;
+                startSrc = i;
+                m = store.count_elements( elemName );
+            }
+            // Fall through
+        }
+        else
+        {
+            // All of the elements in the existing array are to
+            // be deleted and replaced with elements from the
+            // sources array
+        }
 
-        for ( ; m > n ; m-- )
+        // The general case: we assume that some of the elements
+        // in the new array already exist, but at different indexes
+
+        // Starting with position i in the sources array, copy the remaining elements
+        // to the end of the original array...
+        for (int j = i; j < sources.length; j++)
+        {
+            TypeStoreUser user = store.add_element_user( elemName );
+            ((XmlObjectBase) user).set( sources[ j ] );
+        }
+
+        // ... then come back and insert the elements starting with startSource
+        // up to i from the sources array into the current array, starting with
+        // startDest
+        int n = i;
+        for ( ; m > n - startSrc + startDest; m-- )
             store.remove_element( set, m - 1 );
 
-        for ( int i = 0 ; i < n ; i++ )
+        int j;
+        for ( i = startSrc, j = startDest ; i < n ; i++, j++ )
         {
             TypeStoreUser user;
-            
-            if (i >= m)
+
+            if (j >= m)
                 user = store.add_element_user( elemName );
             else
-                user = store.find_element_user( set, i );
+                user = store.find_element_user( set, j );
 
             ((XmlObjectBase) user).set( sources[ i ] );
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: john56@example.net
For additional commands, e-mail: john56@example.net


From commitsjohn56@example.net Tue Aug 08 19:44:57 2006
Return-Path: <commitsjohn56@example.net>
Delivered-To: john56@example.net
Received: (qmail 1214 invoked from network); 8 Aug 2006 19:44:57 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 8 Aug 2006 19:44:57 -0000
Received: (qmail 54489 invoked by uid 500); 8 Aug 2006 19:44:56 -0000
Delivered-To: john56@example.net
Received: (qmail 54466 invoked by uid 500); 8 Aug 2006 19:44:56 -0000
Mailing-List: contact john56@example.net; run by ezmlm
Precedence: bulk
List-Post: <mailto:john56@example.net>
List-Help: <mailto:john56@example.net>
List-Unsubscribe: <mailto:john56@example.net>
Reply-To: john56@example.net
List-Id: <commits.xmlbeans.apache.org>
Delivered-To: mailing list john56@example.net
Received: (qmail 54448 invoked by uid 99); 8 Aug 2006 19:44:56 -0000
Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 12:44:56 -0700
X-ASF-Spam-Status: No, hits=-9.4 required=10.0
	tests=ALL_TRUSTED,NO_REAL_NAME
X-Spam-Check-By: apache.org
Received-SPF: pass (asf.osuosl.org: local policy)
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 12:44:56 -0700
Received: by eris.apache.org (Postfix, from userid 65534)
	id D2AAE1A981A; Tue,  8 Aug 2006 12:44:35 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r429792 -
 /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java
Date: Tue, 08 Aug 2006 19:44:35 -0000
To: john56@example.net
From: john56@example.net
X-Mailer: svnmailer-1.0.8
Message-Id: <john56@example.net>
X-Virus-Checked: Checked by ClamAV on apache.org
X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N

Author: radup
Date: Tue Aug  8 12:44:35 2006
New Revision: 429792

URL: http://svn.apache.org/viewvc?rev=429792&view=rev
Log:
Handled the case where the XmlObjects being copied by the array copy were immutable.

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java?rev=429792&r1=429791&r2=429792&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java Tue Aug  8 12:44:35 2006
@@ -1068,6 +1068,8 @@
         int startSrc = 0, startDest = 0;
         for (i = 0; i < sources.length; i++)
         {
+            if (sources[i].isImmutable())
+                continue;
             XmlCursor c = sources[i].newCursor();
             if (c.toParent() && c.getObject() == this)
             {
@@ -1095,8 +1097,8 @@
                 }
                 for ( i++, j++; i < sources.length; i++, j++)
                 {
-                    XmlCursor c = sources[i].newCursor();
-                    if (c.toParent() && c.getObject() == this)
+                    XmlCursor c = sources[i].isImmutable() ? null : sources[i].newCursor();
+                    if (c != null && c.toParent() && c.getObject() == this)
                     {
                         c.dispose();
                         current = store.find_element_user( elemName, j );
@@ -1184,6 +1186,8 @@
         int startSrc = 0, startDest = 0;
         for (i = 0; i < sources.length; i++)
         {
+            if (sources[i].isImmutable())
+                continue;
             XmlCursor c = sources[i].newCursor();
             if (c.toParent() && c.getObject() == this)
             {
@@ -1211,8 +1215,8 @@
                 }
                 for ( i++, j++; i < sources.length; i++, j++)
                 {
-                    XmlCursor c = sources[i].newCursor();
-                    if (c.toParent() && c.getObject() == this)
+                    XmlCursor c = sources[i].isImmutable() ? null : sources[i].newCursor();
+                    if (c != null && c.toParent() && c.getObject() == this)
                     {
                         c.dispose();
                         current = store.find_element_user( set, j );



---------------------------------------------------------------------
To unsubscribe, e-mail: john56@example.net
For additional commands, e-mail: john56@example.net



{'source': 'Apache Software Foundation Public Mail Archives'}