xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ce...@apache.org
Subject svn commit: r560001 - in /xmlbeans/trunk/src: typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java xmlpublic/org/apache/xmlbeans/XmlCalendar.java
Date Thu, 26 Jul 2007 21:42:22 GMT
Author: cezar
Date: Thu Jul 26 14:42:21 2007
New Revision: 560001

URL: http://svn.apache.org/viewvc?view=rev&rev=560001
Log:
Added an unsynchronized _set() method on XmlObjectBase.

checkintest passes.


Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlCalendar.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java?view=diff&rev=560001&r1=560000&r2=560001
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java Thu Jul
26 14:42:21 2007
@@ -127,11 +127,20 @@
         return false;
     }
 
+    /**
+     * Same as copy() but unsynchronized.
+     * Warning: Using this method in mutithreaded environment can cause invalid states.
+     */
     public final XmlObject _copy()
     {
         return _copy(null);
     }
 
+    /**
+     * Same as copy() but unsynchronized.
+     * If Locale.COPY_USE_NEW_LOCALE is set in the options, a new locale will be created
for the copy.
+     * Warning: Using this method in mutithreaded environment can cause invalid states.
+     */
     public final XmlObject _copy(XmlOptions xmlOptions)
     {
         // immutable objects don't get copied. They're immutable
@@ -1984,6 +1993,33 @@
                     GlobalLock.release();
             }
         }
+
+        return (XmlObject) newObj;
+    }
+
+    /**
+     * Same as set() but unsynchronized.
+     * Warning: Using this method in mutithreaded environment can cause invalid states.
+     */
+    public final XmlObject _set(XmlObject src)
+    {
+        if (isImmutable())
+            throw new IllegalStateException("Cannot set the value of an immutable XmlObject");
+
+        XmlObjectBase obj = underlying(src);
+
+        TypeStoreUser newObj = this;
+
+        if (obj == null)
+        {
+            setNil();
+            return this;
+        }
+
+        if (obj.isImmutable())
+            set(obj.stringValue());
+        else
+            newObj = setterHelper( obj );
 
         return (XmlObject) newObj;
     }

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlCalendar.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlCalendar.java?view=diff&rev=560001&r1=560000&r2=560001
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlCalendar.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlCalendar.java Thu Jul 26 14:42:21
2007
@@ -314,5 +314,4 @@
     {
         return (new GDate(this)).toString(); // use GDate to print
     }
-
 }



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


Mime
View raw message