You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2022/07/03 12:13:13 UTC

svn commit: r1902428 - in /xmlbeans/trunk/src: main/java/org/apache/xmlbeans/XmlOptions.java main/java/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java test/java/misc/checkin/XmlOptionsTest.java

Author: fanningpj
Date: Sun Jul  3 12:13:12 2022
New Revision: 1902428

URL: http://svn.apache.org/viewvc?rev=1902428&view=rev
Log:
add test case

Added:
    xmlbeans/trunk/src/test/java/misc/checkin/XmlOptionsTest.java
Modified:
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java?rev=1902428&r1=1902427&r2=1902428&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java Sun Jul  3 12:13:12 2022
@@ -1174,9 +1174,9 @@ public class XmlOptions implements java.
 
     /**
      * This option controls whether or not operations on XmlBeans are
-     * thread safe.  When not on, all XmlBean operations will be syncronized.
+     * thread safe.  When not on, all XmlBean operations will be synchronized.
      * This provides for multiple thread the ability to access a single
-     * XmlBeans simultainously, but has a perf impact.  If set, then
+     * XmlBeans simultaneously, but has a perf impact.  If set, then
      * only one thread may access an XmlBean.
      */
     public XmlOptions setUnsynchronized() {

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java?rev=1902428&r1=1902427&r2=1902428&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java Sun Jul  3 12:13:12 2022
@@ -1584,7 +1584,7 @@ public final class SchemaTypeImpl implem
                 _lookupStringEnumEntry = lookupStringEnumEntry;
             }
         }
-        // HACKHACK: two syncrhonized blocks force a memory barrier:
+        // HACKHACK: two synchronized blocks force a memory barrier:
         // BUGBUG: this behavior is likely to change in future VMs
         synchronized (this) {
             _stringEnumEnsured = true;

Added: xmlbeans/trunk/src/test/java/misc/checkin/XmlOptionsTest.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/misc/checkin/XmlOptionsTest.java?rev=1902428&view=auto
==============================================================================
--- xmlbeans/trunk/src/test/java/misc/checkin/XmlOptionsTest.java (added)
+++ xmlbeans/trunk/src/test/java/misc/checkin/XmlOptionsTest.java Sun Jul  3 12:13:12 2022
@@ -0,0 +1,33 @@
+/*   Copyright 2022 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package misc.checkin;
+
+import org.apache.xmlbeans.XmlOptions;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class XmlOptionsTest {
+    @Test
+    void testUnsynchronizedFlag() {
+        XmlOptions xmlOptions = new XmlOptions();
+        assertFalse(xmlOptions.isUnsynchronized());
+        xmlOptions.setUnsynchronized();
+        assertTrue(xmlOptions.isUnsynchronized());
+        xmlOptions.setUnsynchronized(false);
+        assertFalse(xmlOptions.isUnsynchronized());
+    }
+}



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