poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1881834 [6/7] - in /xmlbeans/trunk: ./ src/main/java/org/apache/xmlbeans/ src/main/java/org/apache/xmlbeans/impl/config/ src/main/java/org/apache/xmlbeans/impl/schema/ src/main/java/org/apache/xmlbeans/impl/tool/ src/main/java/org/apache/x...
Date Sat, 19 Sep 2020 02:33:17 GMT
Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java?rev=1881834&r1=1881833&r2=1881834&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java Sat Sep 19 02:33:16 2020
@@ -16,100 +16,92 @@
 package org.apache.xmlbeans.impl.values;
 
 import org.apache.xmlbeans.*;
+import org.apache.xmlbeans.impl.schema.SchemaTypeImpl;
+import org.apache.xmlbeans.impl.schema.SchemaTypeVisitorImpl;
 
-import java.lang.String;
+import javax.xml.namespace.QName;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
-import java.util.Calendar;
-import javax.xml.namespace.QName;
+import java.util.function.BiConsumer;
 
-import org.apache.xmlbeans.impl.schema.SchemaTypeImpl;
-import org.apache.xmlbeans.impl.schema.SchemaTypeVisitorImpl;
-
-public class XmlComplexContentImpl extends XmlObjectBase
-{
-    public XmlComplexContentImpl(SchemaType type)
-    {
-        _schemaType = (SchemaTypeImpl)type;
+public class XmlComplexContentImpl extends XmlObjectBase {
+    public XmlComplexContentImpl(SchemaType type) {
+        _schemaType = (SchemaTypeImpl) type;
         initComplexType(true, true);
     }
 
-    public SchemaType schemaType()
-        { return _schemaType; }
+    public SchemaType schemaType() {
+        return _schemaType;
+    }
 
-    private SchemaTypeImpl _schemaType;
+    private final SchemaTypeImpl _schemaType;
 
-    public String compute_text(NamespaceManager nsm)
-        { return null; }
+    public String compute_text(NamespaceManager nsm) {
+        return null;
+    }
 
-    protected final void set_String(String v)
-    {
+    protected final void set_String(String v) {
         assert _schemaType.getContentType() != SchemaType.SIMPLE_CONTENT;
 
         if (_schemaType.getContentType() != SchemaType.MIXED_CONTENT &&
-                !_schemaType.isNoType())
-        {
+            !_schemaType.isNoType()) {
             throw new IllegalArgumentException(
-                "Type does not allow for textual content: " + _schemaType );
+                "Type does not allow for textual content: " + _schemaType);
         }
 
         super.set_String(v);
     }
-    
-    public void set_text(String str)
-    {
+
+    public void set_text(String str) {
         assert
             _schemaType.getContentType() == SchemaType.MIXED_CONTENT ||
-                _schemaType.isNoType();
+            _schemaType.isNoType();
     }
 
-    protected void update_from_complex_content()
-    {
+    protected void update_from_complex_content() {
         // No complex caching yet ...
     }
-    
-    public void set_nil()
-        { /* BUGBUG: what to do? */ }
+
+    public void set_nil() { /* BUGBUG: what to do? */ }
 
     // LEFT
-    public boolean equal_to(XmlObject complexObject)
-    {
-        if (!_schemaType.equals(complexObject.schemaType()))
+    public boolean equal_to(XmlObject complexObject) {
+        if (!_schemaType.equals(complexObject.schemaType())) {
             return false;
+        }
 
         // BUGBUG: by-value structure comparison undone
         return true;
     }
 
     // LEFT
-    protected int value_hash_code()
-    {
+    protected int value_hash_code() {
         throw new IllegalStateException("Complex types cannot be used as hash keys");
     }
 
     // DONE
-    public TypeStoreVisitor new_visitor()
-    {
+    public TypeStoreVisitor new_visitor() {
         return new SchemaTypeVisitorImpl(_schemaType.getContentModel());
     }
 
     // DONE
-    public boolean is_child_element_order_sensitive()
-    {
+    public boolean is_child_element_order_sensitive() {
         return schemaType().isOrderSensitive();
     }
 
-    public int get_elementflags(QName eltName)
-    {
+    public int get_elementflags(QName eltName) {
         SchemaProperty prop = schemaType().getElementProperty(eltName);
-        if (prop == null)
+        if (prop == null) {
             return 0;
+        }
         if (prop.hasDefault() == SchemaProperty.VARIABLE ||
             prop.hasFixed() == SchemaProperty.VARIABLE ||
-            prop.hasNillable() == SchemaProperty.VARIABLE)
+            prop.hasNillable() == SchemaProperty.VARIABLE) {
             return -1;
+        }
         return
             (prop.hasDefault() == SchemaProperty.NEVER ? 0 : TypeStore.HASDEFAULT) |
             (prop.hasFixed() == SchemaProperty.NEVER ? 0 : TypeStore.FIXED) |
@@ -117,17 +109,16 @@ public class XmlComplexContentImpl exten
     }
 
     // DONE
-    public String get_default_attribute_text(QName attrName)
-    {
+    public String get_default_attribute_text(QName attrName) {
         return super.get_default_attribute_text(attrName);
     }
 
     // DONE
-    public String get_default_element_text(QName eltName)
-    {
+    public String get_default_element_text(QName eltName) {
         SchemaProperty prop = schemaType().getElementProperty(eltName);
-        if (prop == null)
+        if (prop == null) {
             return "";
+        }
         return prop.getDefaultText();
     }
 
@@ -137,1046 +128,258 @@ public class XmlComplexContentImpl exten
     // So much redundant code ..... what I'd give for generics!
     //
 
-    protected void unionArraySetterHelper ( Object[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).objectSet( sources[ i ] );
-        }
+    protected void unionArraySetterHelper(Object[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setObjectValue);
     }
 
-    protected SimpleValue[] arraySetterHelper ( int sourcesLength, QName elemName )
-    {
-        SimpleValue[] dests = new SimpleValue[sourcesLength];
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > sourcesLength ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < sourcesLength ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            dests[i] = (SimpleValue) user;
-        }
-
-        return dests;
+    protected SimpleValue[] arraySetterHelper(int sourcesLength, QName elemName) {
+        SimpleValue[] sources = new SimpleValue[sourcesLength];
+        commonSetterHelper(elemName, null, sources, (u, i) -> sources[i] = u);
+        return sources;
     }
 
-    protected SimpleValue[] arraySetterHelper ( int sourcesLength, QName elemName, QNameSet set )
-    {
-        SimpleValue[] dests = new SimpleValue[sourcesLength];
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > sourcesLength ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < sourcesLength ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            dests[i] = (SimpleValue) user;
-        }
-
-        return dests;
+    protected SimpleValue[] arraySetterHelper(int sourcesLength, QName elemName, QNameSet set) {
+        SimpleValue[] sources = new SimpleValue[sourcesLength];
+        commonSetterHelper(elemName, set, sources, (u, i) -> sources[i] = u);
+        return sources;
     }
 
-    protected void arraySetterHelper ( boolean[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(boolean[] sources, QName elemName) {
+        commonSetterHelper(elemName, null, (sources == null) ? 0 : sources.length, (u, i) -> u.setBooleanValue(sources[i]));
     }
 
-    protected void arraySetterHelper ( float[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(float[] sources, QName elemName) {
+        commonSetterHelper(elemName, null, (sources == null) ? 0 : sources.length, (u, i) -> u.setFloatValue(sources[i]));
     }
-    
-    protected void arraySetterHelper ( double[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
 
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(double[] sources, QName elemName) {
+        commonSetterHelper(elemName, null, (sources == null) ? 0 : sources.length, (u, i) -> u.setDoubleValue(sources[i]));
     }
-    
-    protected void arraySetterHelper ( byte[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
 
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(byte[] sources, QName elemName) {
+        commonSetterHelper(elemName, null, (sources == null) ? 0 : sources.length, (u, i) -> u.setByteValue(sources[i]));
     }
 
-    protected void arraySetterHelper ( short[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(short[] sources, QName elemName) {
+        commonSetterHelper(elemName, null, (sources == null) ? 0 : sources.length, (u, i) -> u.setShortValue(sources[i]));
     }
 
-    protected void arraySetterHelper ( int[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(int[] sources, QName elemName) {
+        commonSetterHelper(elemName, null, (sources == null) ? 0 : sources.length, (u, i) -> u.setIntValue(sources[i]));
     }
-    
-    protected void arraySetterHelper ( long[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
 
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(long[] sources, QName elemName) {
+        commonSetterHelper(elemName, null, (sources == null) ? 0 : sources.length, (u, i) -> u.setLongValue(sources[i]));
     }
-    
-    protected void arraySetterHelper ( BigDecimal[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
 
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(BigDecimal[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setBigDecimalValue);
     }
-    
-    protected void arraySetterHelper ( BigInteger[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
 
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(BigInteger[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setBigIntegerValue);
     }
 
-    protected void arraySetterHelper ( String[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(String[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setStringValue);
     }
-    
-    protected void arraySetterHelper ( byte[][] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
 
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(byte[][] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setByteArrayValue);
     }
-    
-    protected void arraySetterHelper ( GDate[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
 
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(GDate[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setGDateValue);
     }
-    
-    protected void arraySetterHelper ( GDuration[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
 
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(GDuration[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setGDurationValue);
     }
-    
-    protected void arraySetterHelper ( Calendar[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
 
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(Calendar[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setCalendarValue);
     }
-    
-    protected void arraySetterHelper ( Date[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
 
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(Date[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setDateValue);
     }
-    
-    protected void arraySetterHelper ( QName[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
 
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(QName[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setQNameValue);
     }
 
-    protected void arraySetterHelper ( StringEnumAbstractBase[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(StringEnumAbstractBase[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setEnumValue);
     }
 
-    protected void arraySetterHelper ( List[] sources, QName elemName )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( elemName );
 
-        for ( ; m > n ; m-- )
-            store.remove_element( elemName, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(List<?>[] sources, QName elemName) {
+        commonSetterHelper2(elemName, null, sources, XmlObjectBase::setListValue);
     }
 
-    protected void unionArraySetterHelper ( Object[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).objectSet( sources[ i ] );
-        }
+    protected void unionArraySetterHelper(Object[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setObjectValue);
     }
 
-    protected void arraySetterHelper ( boolean[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(boolean[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper(elemName, set, (sources == null) ? 0 : sources.length, (u, i) -> u.setBooleanValue(sources[i]));
     }
 
-    protected void arraySetterHelper ( float[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(float[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper(elemName, set, (sources == null) ? 0 : sources.length, (u, i) -> u.setFloatValue(sources[i]));
     }
 
-    protected void arraySetterHelper ( double[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(double[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper(elemName, set, (sources == null) ? 0 : sources.length, (u, i) -> u.setDoubleValue(sources[i]));
     }
 
-    protected void arraySetterHelper ( byte[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(byte[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper(elemName, set, (sources == null) ? 0 : sources.length, (u, i) -> u.setByteValue(sources[i]));
     }
 
-    protected void arraySetterHelper ( short[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(short[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper(elemName, set, (sources == null) ? 0 : sources.length, (u, i) -> u.setShortValue(sources[i]));
     }
 
-    protected void arraySetterHelper ( int[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(int[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper(elemName, set, (sources == null) ? 0 : sources.length, (u, i) -> u.setIntValue(sources[i]));
     }
 
-    protected void arraySetterHelper ( long[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    @SuppressWarnings("ConstantConditions")
+    protected void arraySetterHelper(long[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper(elemName, set, (sources == null) ? 0 : sources.length, (u, i) -> u.setLongValue(sources[i]));
     }
 
-    protected void arraySetterHelper ( BigDecimal[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(BigDecimal[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setBigDecimalValue);
     }
 
-    protected void arraySetterHelper ( BigInteger[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(BigInteger[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setBigIntegerValue);
     }
 
-    protected void arraySetterHelper ( String[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(String[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setStringValue);
     }
 
-    protected void arraySetterHelper ( byte[][] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(byte[][] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setByteArrayValue);
     }
 
-    protected void arraySetterHelper ( GDate[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(GDate[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setGDateValue);
     }
 
-    protected void arraySetterHelper ( GDuration[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(GDuration[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setGDurationValue);
     }
 
-    protected void arraySetterHelper ( Calendar[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(Calendar[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setCalendarValue);
     }
 
-    protected void arraySetterHelper ( Date[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(Date[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setDateValue);
     }
 
-    protected void arraySetterHelper ( QName[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
-
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(QName[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setQNameValue);
     }
-    
-    protected void arraySetterHelper ( StringEnumAbstractBase[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
-
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
 
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(StringEnumAbstractBase[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setEnumValue);
     }
-    
-    protected void arraySetterHelper ( List[] sources, QName elemName, QNameSet set )
-    {
-        int n = sources == null ? 0 : sources.length;
-        
-        TypeStore store = get_store();
-
-        int m = store.count_elements( set );
 
-        for ( ; m > n ; m-- )
-            store.remove_element( set, m - 1 );
-
-        for ( int i = 0 ; i < n ; i++ )
-        {
-            TypeStoreUser user;
-            
-            if (i >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, i );
+    protected void arraySetterHelper(List<?>[] sources, QName elemName, QNameSet set) {
+        commonSetterHelper2(elemName, set, sources, XmlObjectBase::setListValue);
+    }
 
-            ((XmlObjectBase) user).set( sources[ i ] );
-        }
+    protected void arraySetterHelper(XmlObject[] sources, QName elemName) {
+        arraySetterHelper(sources, elemName, null);
     }
 
-    protected void arraySetterHelper ( XmlObject[] sources, QName elemName )
-    {
+    protected void arraySetterHelper(XmlObject[] sources, QName elemName, QNameSet set) {
         TypeStore store = get_store();
 
-        if (sources == null || sources.length == 0)
-        {
-            int m = store.count_elements( elemName );
-            for ( ; m > 0 ; m-- )
-                store.remove_element( elemName, 0 );
+        if (sources == null || sources.length == 0) {
+            int m = (set == null) ? store.count_elements(elemName) : store.count_elements(set);
+            for (; m > 0; m--) {
+                if (set == null) {
+                    store.remove_element(elemName, 0);
+                } else {
+                    store.remove_element(set, 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
+        // how many elements in the original array
+        int m = (set == null) ? store.count_elements(elemName) : store.count_elements(set);
         int startSrc = 0, startDest = 0;
-        for (i = 0; i < sources.length; i++)
-        {
-            if (sources[i].isImmutable())
+        for (i = 0; i < sources.length; i++) {
+            if (sources[i].isImmutable()) {
                 continue;
+            }
             XmlCursor c = sources[i].newCursor();
-            if (c.toParent() && c.getObject() == this)
-            {
+            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])
-            {
+        if (i < sources.length) {
+            TypeStoreUser current = (set == null) ? store.find_element_user(elemName, 0) : 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( elemName, j );
-                    ((XmlObjectBase) user).set( sources[j] );
+                int j;
+                for (j = 0; j < i; j++) {
+                    TypeStoreUser user = (set == null) ? store.insert_element_user(elemName, j) : store.insert_element_user(set, elemName, j);
+                    ((XmlObjectBase) user).set(sources[j]);
                 }
-                for ( i++, j++; i < sources.length; i++, j++)
-                {
+                for (i++, j++; i < sources.length; i++, j++) {
                     XmlCursor c = sources[i].isImmutable() ? null : sources[i].newCursor();
-                    if (c != null && c.toParent() && c.getObject() == this)
-                    {
+                    if (c != null && c.toParent() && c.getObject() == this) {
                         c.dispose();
-                        current = store.find_element_user( elemName, j );
-                        if (current == sources[i])
-                            ; // advance
-                        else
-                        {
+                        current = (set == null) ? store.find_element_user(elemName, j) : store.find_element_user(set, j);
+                        if (current != sources[i]) {
                             // Fall back to the general case
                             break;
                         }
-                    }
-                    else
-                    {
-                        c.dispose();
+                    } else {
+                        if (c != null) {
+                            c.dispose();
+                        }
                         // Insert before the current element
-                        TypeStoreUser user = store.insert_element_user( elemName, j );
-                        ((XmlObjectBase) user).set( sources[i] );
+                        TypeStoreUser user = (set == null) ? store.insert_element_user(elemName, j) : store.insert_element_user(set, elemName, j);
+                        ((XmlObjectBase) user).set(sources[i]);
                     }
                 }
                 startDest = j;
                 startSrc = i;
-                m = store.count_elements( elemName );
+                m = store.count_elements(elemName);
             }
             // Fall through
-        }
-        else
-        {
+        } else {
             // All of the elements in the existing array are to
             // be deleted and replaced with elements from the
             // sources array
@@ -1187,149 +390,102 @@ public class XmlComplexContentImpl exten
 
         // 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 ] );
+        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 (; m > n - startSrc + startDest; m--) {
+            if (set == null) {
+                store.remove_element(elemName, m - 1);
+            } else {
+                store.remove_element(set, m - 1);
+            }
+        }
 
         int j;
-        for ( i = startSrc, j = startDest ; i < n ; i++, j++ )
-        {
+        for (i = startSrc, j = startDest; i < n; i++, j++) {
             TypeStoreUser user;
 
-            if (j >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( elemName, j );
+            if (j >= m) {
+                user = store.add_element_user(elemName);
+            } else if (set == null) {
+                user = store.find_element_user(elemName, j);
+            } else {
+                user = store.find_element_user(set, j);
+            }
 
-            ((XmlObjectBase) user).set( sources[ i ] );
+            ((XmlObjectBase) user).set(sources[i]);
         }
 
         // 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 );
+    }
+
+
+    private <T> void commonSetterHelper(QName elemName, QNameSet set, T[] sources, BiConsumer<XmlObjectBase, Integer> fun) {
+        commonSetterHelper(elemName, set, (sources == null) ? 0 : sources.length, fun);
     }
 
-    protected void arraySetterHelper ( XmlObject[] sources, QName elemName, QNameSet set )
-    {
+    private void commonSetterHelper(QName elemName, QNameSet set, int n, BiConsumer<XmlObjectBase, Integer> fun) {
         TypeStore store = get_store();
 
-        if (sources == null || sources.length == 0)
-        {
-            int m = store.count_elements( set );
-            for ( ; m > 0 ; m-- )
-                store.remove_element( set, 0 );
-            return;
-        }
+        int m = (set == null) ? store.count_elements(elemName) : store.count_elements(set);
 
-        // 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++)
-        {
-            if (sources[i].isImmutable())
-                continue;
-            XmlCursor c = sources[i].newCursor();
-            if (c.toParent() && c.getObject() == this)
-            {
-                c.dispose();
-                break;
+        for (; m > n; m--) {
+            if (set == null) {
+                store.remove_element(elemName, m - 1);
+            } else {
+                store.remove_element(set, m - 1);
             }
-            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].isImmutable() ? null : sources[i].newCursor();
-                    if (c != null && 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 );
+        for (int i = 0; i < n; i++) {
+            TypeStoreUser user;
+
+            if (i >= m) {
+                user = store.add_element_user(elemName);
+            } else if (set == null) {
+                user = store.find_element_user(elemName, i);
+            } else {
+                user = store.find_element_user(set, i);
             }
-            // Fall through
-        }
-        else
-        {
-            // All of the elements in the existing array are to
-            // be deleted and replaced with elements from the
-            // sources array
+            fun.accept((XmlObjectBase) user, i);
         }
+    }
 
-        // The general case: we assume that some of the elements
-        // in the new array already exist, but at different indexes
+    private <T> void commonSetterHelper2(QName elemName, QNameSet set, T[] sources, BiConsumer<XmlObjectBase, T> c) {
+        int n = (sources == null) ? 0 : sources.length;
 
-        // 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 ] );
-        }
+        TypeStore store = get_store();
 
-        // ... 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 );
+        int m = (set == null) ? store.count_elements(elemName) : store.count_elements(set);
 
-        int j;
-        for ( i = startSrc, j = startDest ; i < n ; i++, j++ )
-        {
-            TypeStoreUser user;
+        for (; m > n; m--) {
+            if (set == null) {
+                store.remove_element(elemName, m - 1);
+            } else {
+                store.remove_element(set, m - 1);
+            }
+        }
 
-            if (j >= m)
-                user = store.add_element_user( elemName );
-            else
-                user = store.find_element_user( set, j );
+        for (int i = 0; i < n; i++) {
+            TypeStoreUser user;
 
-            ((XmlObjectBase) user).set( sources[ i ] );
+            if (i >= m) {
+                user = store.add_element_user(elemName);
+            } else if (set == null) {
+                user = store.find_element_user(elemName, i);
+            } else {
+                user = store.find_element_user(set, i);
+            }
+            c.accept((XmlObjectBase) user, sources[i]);
         }
     }
-
 }

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlListImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlListImpl.java?rev=1881834&r1=1881833&r2=1881834&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlListImpl.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlListImpl.java Sat Sep 19 02:33:16 2020
@@ -15,64 +15,58 @@
 
 package org.apache.xmlbeans.impl.values;
 
-import org.apache.xmlbeans.SchemaType;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlAnySimpleType;
-import org.apache.xmlbeans.SimpleValue;
-import org.apache.xmlbeans.XmlErrorCodes;
-import org.apache.xmlbeans.XmlSimpleList;
-import org.apache.xmlbeans.impl.common.ValidationContext;
-import org.apache.xmlbeans.impl.common.QNameHelper;
+import org.apache.xmlbeans.*;
 import org.apache.xmlbeans.impl.common.PrefixResolver;
+import org.apache.xmlbeans.impl.common.QNameHelper;
+import org.apache.xmlbeans.impl.common.ValidationContext;
 import org.apache.xmlbeans.impl.common.XMLChar;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.ArrayList;
 
-public class XmlListImpl extends XmlObjectBase implements XmlAnySimpleType
-{
-    public XmlListImpl(SchemaType type, boolean complex)
-        { _schemaType = type; initComplexType(complex, false); }
+public class XmlListImpl extends XmlObjectBase implements XmlAnySimpleType {
+    public XmlListImpl(SchemaType type, boolean complex) {
+        _schemaType = type;
+        initComplexType(complex, false);
+    }
 
-    public SchemaType schemaType()
-        { return _schemaType; }
+    public SchemaType schemaType() {
+        return _schemaType;
+    }
 
-    private SchemaType _schemaType;
+    private final SchemaType _schemaType;
     private XmlSimpleList _value;
     private XmlSimpleList _jvalue;
 
 
-
     // SIMPLE VALUE ACCESSORS BELOW -------------------------------------------
     // gets raw text value
 
-    private static String nullAsEmpty(String s)
-    {
-        if (s == null)
+    private static String nullAsEmpty(String s) {
+        if (s == null) {
             return "";
+        }
         return s;
     }
 
-    private static String compute_list_text(List xList)
-    {
-        if (xList.size() == 0)
+    private static String compute_list_text(List xList) {
+        if (xList.size() == 0) {
             return "";
+        }
 
         StringBuilder sb = new StringBuilder();
-        sb.append(nullAsEmpty(((SimpleValue)xList.get(0)).getStringValue()));
+        sb.append(nullAsEmpty(((SimpleValue) xList.get(0)).getStringValue()));
 
-        for (int i = 1; i < xList.size(); i++)
-        {
+        for (int i = 1; i < xList.size(); i++) {
             sb.append(' ');
-            sb.append(nullAsEmpty(((SimpleValue)xList.get(i)).getStringValue()));
+            sb.append(nullAsEmpty(((SimpleValue) xList.get(i)).getStringValue()));
         }
 
         return sb.toString();
     }
 
-    protected String compute_text(NamespaceManager nsm)
-    {
+    protected String compute_text(NamespaceManager nsm) {
         return compute_list_text(_value);
     }
 
@@ -85,26 +79,26 @@ public class XmlListImpl extends XmlObje
             _value = savedValue;
 
             return false;
-        }
-        catch (XmlValueOutOfRangeException e) {
+        } catch (XmlValueOutOfRangeException e) {
             return true;
         }
     }
 
-    protected void set_text(String s)
-    {
+    protected void set_text(String s) {
         // first check against any patterns...
-        if (_validateOnSet() && !_schemaType.matchPatternFacet(s))
+        if (_validateOnSet() && !_schemaType.matchPatternFacet(s)) {
             throw new XmlValueOutOfRangeException(XmlErrorCodes.DATATYPE_VALID$PATTERN_VALID,
-                    new Object[] { "list", s, QNameHelper.readable(_schemaType) });
+                new Object[]{"list", s, QNameHelper.readable(_schemaType)});
+        }
 
         SchemaType itemType = _schemaType.getListItemType();
 
         XmlSimpleList newval = lex(s, itemType, _voorVc, has_store() ? get_store() : null);
 
         // check enumeration
-        if (_validateOnSet())
+        if (_validateOnSet()) {
             validateValue(newval, _schemaType, _voorVc);
+        }
 
         // we made it all the way through; so we're OK.
         _value = newval;
@@ -113,90 +107,82 @@ public class XmlListImpl extends XmlObje
 
     private static final String[] EMPTY_STRINGARRAY = new String[0];
 
-    public static String[] split_list(String s)
-    {
-        if (s.length() == 0)
+    public static String[] split_list(String s) {
+        if (s.length() == 0) {
             return EMPTY_STRINGARRAY;
+        }
 
         List result = new ArrayList();
         int i = 0;
         int start = 0;
-        for (;;)
-        {
-            while (i < s.length() && XMLChar.isSpace(s.charAt(i)))
+        for (; ; ) {
+            while (i < s.length() && XMLChar.isSpace(s.charAt(i))) {
                 i += 1;
-            if (i >= s.length())
-                return (String[])result.toArray(EMPTY_STRINGARRAY);
+            }
+            if (i >= s.length()) {
+                return (String[]) result.toArray(EMPTY_STRINGARRAY);
+            }
             start = i;
-            while (i < s.length() && !XMLChar.isSpace(s.charAt(i)))
+            while (i < s.length() && !XMLChar.isSpace(s.charAt(i))) {
                 i += 1;
+            }
             result.add(s.substring(start, i));
         }
     }
 
-    public static XmlSimpleList lex(String s, SchemaType itemType, ValidationContext ctx, PrefixResolver resolver)
-    {
+    public static XmlSimpleList lex(String s, SchemaType itemType, ValidationContext ctx, PrefixResolver resolver) {
         String[] parts = split_list(s);
 
         XmlAnySimpleType[] newArray = new XmlAnySimpleType[parts.length];
         boolean pushed = false;
-        if (resolver != null)
-        {
+        if (resolver != null) {
             NamespaceContext.push(new NamespaceContext(resolver));
             pushed = true;
         }
         int i = 0;
-        try
-        {
-            for (i = 0; i < parts.length; i++)
-            {
-                try
-                {
+        try {
+            for (i = 0; i < parts.length; i++) {
+                try {
                     newArray[i] = itemType.newValue(parts[i]);
-                }
-                catch (XmlValueOutOfRangeException e)
-                {
-                    ctx.invalid(XmlErrorCodes.LIST, new Object[] { "item '" + parts[i] + "' is not a valid value of " + QNameHelper.readable(itemType) });
+                } catch (XmlValueOutOfRangeException e) {
+                    ctx.invalid(XmlErrorCodes.LIST, new Object[]{"item '" + parts[i] + "' is not a valid value of " + QNameHelper.readable(itemType)});
                 }
             }
-        }
-        finally
-        {
-            if (pushed)
+        } finally {
+            if (pushed) {
                 NamespaceContext.pop();
+            }
         }
         return new XmlSimpleList(Arrays.asList(newArray));
     }
 
-    protected void set_nil()
-    {
+    protected void set_nil() {
         _value = null;
     }
 
-    public List xgetListValue()
-    {
+    public List xgetListValue() {
         check_dated();
         return _value;
     }
 
-    public List getListValue()
-    {
+    public List getListValue() {
         check_dated();
-        if (_value == null)
+        if (_value == null) {
             return null;
-        if (_jvalue != null)
+        }
+        if (_jvalue != null) {
             return _jvalue;
+        }
         List javaResult = new ArrayList();
-        for (int i = 0; i < _value.size(); i++)
-            javaResult.add(java_value((XmlObject)_value.get(i)));
+        for (int i = 0; i < _value.size(); i++) {
+            javaResult.add(java_value((XmlObject) _value.get(i)));
+        }
         _jvalue = new XmlSimpleList(javaResult);
         return _jvalue;
     }
 
-    private static boolean permits_inner_space(XmlObject obj)
-    {
-        switch (((SimpleValue)obj).instanceType().getPrimitiveType().getBuiltinTypeCode())
-        {
+    private static boolean permits_inner_space(XmlObject obj) {
+        switch (((SimpleValue) obj).instanceType().getPrimitiveType().getBuiltinTypeCode()) {
             case SchemaType.BTC_STRING:
             case SchemaType.BTC_ANY_URI:
             case SchemaType.BTC_ANY_SIMPLE:
@@ -207,50 +193,43 @@ public class XmlListImpl extends XmlObje
         }
     }
 
-    private static boolean contains_white_space(String s)
-    {
+    private static boolean contains_white_space(String s) {
         return s.indexOf(' ') >= 0 ||
-                s.indexOf('\t') >= 0 ||
-                s.indexOf('\n') >= 0 ||
-                s.indexOf('\r') >= 0;
+               s.indexOf('\t') >= 0 ||
+               s.indexOf('\n') >= 0 ||
+               s.indexOf('\r') >= 0;
     }
 
-    public void set_list(List list)
-    {
+    public void set_list(List list) {
         SchemaType itemType = _schemaType.getListItemType();
         XmlSimpleList xList;
 
         boolean pushed = false;
-        if (has_store())
-        {
+        if (has_store()) {
             NamespaceContext.push(new NamespaceContext(get_store()));
             pushed = true;
         }
 
-        try
-        {
+        try {
             XmlAnySimpleType[] newval = new XmlAnySimpleType[list.size()];
-            for (int i = 0; i < list.size(); i++)
-            {
+            for (int i = 0; i < list.size(); i++) {
                 Object entry = list.get(i);
-                if ((entry instanceof XmlObject) && permits_inner_space((XmlObject)list.get(i)))
-                {
+                if ((entry instanceof XmlObject) && permits_inner_space((XmlObject) list.get(i))) {
                     String stringrep = list.get(i).toString();
-                    if (contains_white_space(stringrep))
+                    if (contains_white_space(stringrep)) {
                         throw new XmlValueOutOfRangeException();
+                    }
                 }
                 newval[i] = itemType.newValue(entry);
             }
             xList = new XmlSimpleList(Arrays.asList(newval));
-        }
-        finally
-        {
-            if (pushed)
+        } finally {
+            if (pushed) {
                 NamespaceContext.pop();
+            }
         }
 
-        if (_validateOnSet())
-        {
+        if (_validateOnSet()) {
             // check enumeration + min/max/etc
             validateValue(xList, _schemaType, _voorVc);
         }
@@ -259,47 +238,40 @@ public class XmlListImpl extends XmlObje
         _jvalue = null;
     }
 
-    public static void validateValue(XmlSimpleList items, SchemaType sType, ValidationContext context)
-    {
+    public static void validateValue(XmlSimpleList items, SchemaType sType, ValidationContext context) {
         XmlObject[] enumvals = sType.getEnumerationValues();
-        checkEnum: if (enumvals != null)
-        {
-            for (int i = 0; i < enumvals.length; i++)
-            {
-                if (equal_xmlLists(items, ((XmlObjectBase)enumvals[i]).xlistValue()))
+        checkEnum:
+        if (enumvals != null) {
+            for (int i = 0; i < enumvals.length; i++) {
+                if (equal_xmlLists(items, ((XmlObjectBase) enumvals[i]).xgetListValue())) {
                     break checkEnum;
+                }
             }
             context.invalid(XmlErrorCodes.DATATYPE_ENUM_VALID,
-                new Object[] { "list", items, QNameHelper.readable(sType) });
+                new Object[]{"list", items, QNameHelper.readable(sType)});
         }
 
         XmlObject o;
         int i;
 
-        if ((o = sType.getFacet( SchemaType.FACET_LENGTH )) != null)
-        {
-            if ((i = ((SimpleValue)o).getIntValue()) != items.size())
-            {
+        if ((o = sType.getFacet(SchemaType.FACET_LENGTH)) != null) {
+            if ((i = ((SimpleValue) o).getIntValue()) != items.size()) {
                 context.invalid(XmlErrorCodes.DATATYPE_LENGTH_VALID$LIST_LENGTH,
-                    new Object[] { items, new Integer(items.size()), new Integer(i), QNameHelper.readable(sType) });
+                    new Object[]{items, new Integer(items.size()), new Integer(i), QNameHelper.readable(sType)});
             }
         }
 
-        if ((o = sType.getFacet( SchemaType.FACET_MIN_LENGTH )) != null)
-        {
-            if ((i = ((SimpleValue)o).getIntValue()) > items.size())
-            {
+        if ((o = sType.getFacet(SchemaType.FACET_MIN_LENGTH)) != null) {
+            if ((i = ((SimpleValue) o).getIntValue()) > items.size()) {
                 context.invalid(XmlErrorCodes.DATATYPE_MIN_LENGTH_VALID$LIST_LENGTH,
-                    new Object[] { items, new Integer(items.size()), new Integer(i), QNameHelper.readable(sType) });
+                    new Object[]{items, new Integer(items.size()), new Integer(i), QNameHelper.readable(sType)});
             }
         }
 
-        if ((o = sType.getFacet( SchemaType.FACET_MAX_LENGTH )) != null)
-        {
-            if ((i = ((SimpleValue)o).getIntValue()) < items.size())
-            {
+        if ((o = sType.getFacet(SchemaType.FACET_MAX_LENGTH)) != null) {
+            if ((i = ((SimpleValue) o).getIntValue()) < items.size()) {
                 context.invalid(XmlErrorCodes.DATATYPE_MAX_LENGTH_VALID$LIST_LENGTH,
-                    new Object[] { items, new Integer(items.size()), new Integer(i), QNameHelper.readable(sType) });
+                    new Object[]{items, new Integer(items.size()), new Integer(i), QNameHelper.readable(sType)});
             }
         }
     }
@@ -307,44 +279,42 @@ public class XmlListImpl extends XmlObje
     // comparators
     // protected int compare_to(XmlObject i) - no sorting order; inherit from base
 
-    protected boolean equal_to(XmlObject obj)
-    {
-        return equal_xmlLists(_value, ((XmlObjectBase)obj).xlistValue());
+    protected boolean equal_to(XmlObject obj) {
+        return equal_xmlLists(_value, ((XmlObjectBase) obj).xgetListValue());
     }
 
 
-    private static boolean equal_xmlLists(List a, List b)
-    {
-        if (a.size() != b.size())
+    private static boolean equal_xmlLists(List a, List b) {
+        if (a.size() != b.size()) {
             return false;
-        for (int i = 0; i < a.size(); i++)
-        {
-            if (!a.get(i).equals(b.get(i)))
+        }
+        for (int i = 0; i < a.size(); i++) {
+            if (!a.get(i).equals(b.get(i))) {
                 return false;
+            }
         }
         return true;
     }
 
-    protected int value_hash_code()
-    {
-        if (_value == null)
+    protected int value_hash_code() {
+        if (_value == null) {
             return 0;
+        }
 
         // hash code probes 9 distributed values, plus the last
         int hash = _value.size();
         int incr = _value.size() / 9;
-        if (incr < 1)
+        if (incr < 1) {
             incr = 1;
+        }
 
         int i;
-        for (i = 0; i < _value.size(); i += incr)
-        {
+        for (i = 0; i < _value.size(); i += incr) {
             hash *= 19;
             hash += _value.get(i).hashCode();
         }
 
-        if (i < _value.size())
-        {
+        if (i < _value.size()) {
             hash *= 19;
             hash += _value.get(i).hashCode();
         }
@@ -352,9 +322,8 @@ public class XmlListImpl extends XmlObje
         return hash;
     }
 
-    protected void validate_simpleval(String lexical, ValidationContext ctx)
-    {
-        validateValue((XmlSimpleList)xlistValue(), schemaType(), ctx);
+    protected void validate_simpleval(String lexical, ValidationContext ctx) {
+        validateValue((XmlSimpleList) xgetListValue(), schemaType(), ctx);
     }
 
 }

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlObjectBase.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlObjectBase.java?rev=1881834&r1=1881833&r2=1881834&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlObjectBase.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/XmlObjectBase.java Sat Sep 19 02:33:16 2020
@@ -1378,7 +1378,7 @@ public abstract class XmlObjectBase impl
 
     // numerics: integral
     public BigInteger getBigIntegerValue() {
-        BigDecimal bd = bigDecimalValue();
+        BigDecimal bd = getBigDecimalValue();
         return bd == null ? null : bd.toBigInteger();
     }
 
@@ -1514,279 +1514,6 @@ public abstract class XmlObjectBase impl
         }
     }
 
-    /**
-     * @deprecated replaced with {@link #getStringValue}
-     */
-    public String stringValue() {
-        return getStringValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getBooleanValue}
-     */
-    public boolean booleanValue() {
-        return getBooleanValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getByteValue}
-     */
-    public byte byteValue() {
-        return getByteValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getShortValue}
-     */
-    public short shortValue() {
-        return getShortValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getIntValue}
-     */
-    public int intValue() {
-        return getIntValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getLongValue}
-     */
-    public long longValue() {
-        return getLongValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getBigIntegerValue}
-     */
-    public BigInteger bigIntegerValue() {
-        return getBigIntegerValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getBigDecimalValue}
-     */
-    public BigDecimal bigDecimalValue() {
-        return getBigDecimalValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getFloatValue}
-     */
-    public float floatValue() {
-        return getFloatValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getDoubleValue}
-     */
-    public double doubleValue() {
-        return getDoubleValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getByteArrayValue}
-     */
-    public byte[] byteArrayValue() {
-        return getByteArrayValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getEnumValue}
-     */
-    public StringEnumAbstractBase enumValue() {
-        return getEnumValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getCalendarValue}
-     */
-    public Calendar calendarValue() {
-        return getCalendarValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getDateValue}
-     */
-    public Date dateValue() {
-        return getDateValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getGDateValue}
-     */
-    public GDate gDateValue() {
-        return getGDateValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getGDurationValue}
-     */
-    public GDuration gDurationValue() {
-        return getGDurationValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getQNameValue}
-     */
-    public QName qNameValue() {
-        return getQNameValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #xgetListValue}
-     */
-    public List xlistValue() {
-        return xgetListValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getListValue}
-     */
-    public List listValue() {
-        return getListValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #getObjectValue}
-     */
-    public Object objectValue() {
-        return getObjectValue();
-    }
-
-    /**
-     * @deprecated replaced with {@link #setStringValue}
-     */
-    public void set(String obj) {
-        setStringValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setBooleanValue}
-     */
-    public void set(boolean v) {
-        setBooleanValue(v);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setByteValue}
-     */
-    public void set(byte v) {
-        setByteValue(v);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setShortValue}
-     */
-    public void set(short v) {
-        setShortValue(v);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setIntValue}
-     */
-    public void set(int v) {
-        setIntValue(v);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setLongValue}
-     */
-    public void set(long v) {
-        setLongValue(v);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setBigIntegerValue}
-     */
-    public void set(BigInteger obj) {
-        setBigIntegerValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setBigDecimalValue}
-     */
-    public void set(BigDecimal obj) {
-        setBigDecimalValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setFloatValue}
-     */
-    public void set(float v) {
-        setFloatValue(v);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setDoubleValue}
-     */
-    public void set(double v) {
-        setDoubleValue(v);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setByteArrayValue}
-     */
-    public void set(byte[] obj) {
-        setByteArrayValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setEnumValue}
-     */
-    public void set(StringEnumAbstractBase obj) {
-        setEnumValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setCalendarValue}
-     */
-    public void set(Calendar obj) {
-        setCalendarValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setDateValue}
-     */
-    public void set(Date obj) {
-        setDateValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setGDateValue}
-     */
-    public void set(GDateSpecification obj) {
-        setGDateValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setGDurationValue}
-     */
-    public void set(GDurationSpecification obj) {
-        setGDurationValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setQNameValue}
-     */
-    public void set(QName obj) {
-        setQNameValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setListValue}
-     */
-    public void set(List obj) {
-        setListValue(obj);
-    }
-
-    /**
-     * @deprecated replaced with {@link #setObjectValue}
-     */
-    public void objectSet(Object obj) {
-        setObjectValue(obj);
-    }
-
     public byte[] getByteArrayValue() {
         throw new XmlValueNotSupportedException(XmlErrorCodes.EXCEPTION_VALUE_NOT_SUPPORTED_S2J,
             new Object[]{getPrimitiveTypeName(), "byte[]"});
@@ -2025,7 +1752,7 @@ public abstract class XmlObjectBase impl
         }
     }
 
-    public final void setListValue(List obj) {
+    public final void setListValue(List<?> obj) {
         if (obj == null) {
             setNil();
         } else {
@@ -2089,7 +1816,7 @@ public abstract class XmlObjectBase impl
         } else if (o instanceof QName) {
             setQNameValue((QName) o);
         } else if (o instanceof List) {
-            setListValue((List) o);
+            setListValue((List<?>) o);
         } else if (o instanceof byte[]) {
             setByteArrayValue((byte[]) o);
         } else {
@@ -2516,7 +2243,7 @@ public abstract class XmlObjectBase impl
         }
 
         if (obj.isImmutable()) {
-            set(obj.stringValue());
+            setStringValue(obj.getStringValue());
         } else {
             check_orphaned();
             obj.check_orphaned();
@@ -2527,7 +2254,7 @@ public abstract class XmlObjectBase impl
         return (XmlObject) newObj;
     }
 
-    protected void set_list(List list) {
+    protected void set_list(List<?> list) {
         throw new XmlValueNotSupportedException(XmlErrorCodes.EXCEPTION_VALUE_NOT_SUPPORTED_J2S,
             new Object[]{"List", getPrimitiveTypeName()});
     }



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


Mime
View raw message