Author: fanningpj
Date: Tue Jun 23 12:45:55 2026
New Revision: 1935584
Log:
refactor
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/QNameSet.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlObject.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/LoadSaveUtils.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/Mutex.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/PrefixResolver.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/SystemCache.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/XMLChar.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/XmlErrorWatcher.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/BindingConfigImpl.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/InterfaceExtensionImpl.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/NameSet.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/BuiltinSchemaTypeSystem.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscResolver.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/InstanceValidator.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/QNameSet.java
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/QNameSet.java Tue Jun
23 12:45:04 2026 (r1935583)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/QNameSet.java Tue Jun
23 12:45:55 2026 (r1935584)
@@ -29,7 +29,7 @@ import java.util.Set;
* <ul>
* <li>A QNameSet can cover a finite set of namespaces, additionally including
a finite
* set of QNames outside those namespaces, and with the exception of
- * a finite set of QNames excluded from those namespaes:
+ * a finite set of QNames excluded from those namespaces:
* <ul>
* <li>excludedQNamesInIncludedURIs == the set of excluded QNames from
coveredURIs namespaces
* <li>excludedURIs == null
@@ -196,7 +196,7 @@ public final class QNameSet implements Q
* Constructs a QNameSetBuilder whose contents are given by
* the four sets.
* <p>
- * This constuctor is PRIVATE because it uses the given
+ * This constructor is PRIVATE because it uses the given
* sets directly, and it trusts its callers to set only immutable values.
* This constructor is only called by the static builder methods on
* QNameSet: those methods are all careful assign only unchanging sets.
@@ -252,7 +252,7 @@ public final class QNameSet implements Q
/**
* Returns a new QNameSet that is the intersection of this one and another.
*
- * @param set the set to insersect with
+ * @param set the set to intersect with
* @return the intersection
*/
public QNameSet intersect(QNameSetSpecification set) {
Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlObject.java
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlObject.java Tue Jun
23 12:45:04 2026 (r1935583)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlObject.java Tue Jun
23 12:45:55 2026 (r1935584)
@@ -465,7 +465,7 @@ public interface XmlObject extends XmlTo
* course have equal values (valueEquals(obj) == true).
* <p>
* Usually this method can be treated as an ordinary equivalence
- * relation, but actually it is not is not transitive.
+ * relation, but actually it is not transitive.
* Here is a precise specification:
* <p>
* There are two categories of XML object: objects with a known
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/LoadSaveUtils.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/LoadSaveUtils.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/LoadSaveUtils.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -28,7 +28,6 @@ import javax.xml.stream.XMLStreamWriter;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamException;
-import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.InputStream;
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/Mutex.java
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/Mutex.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/Mutex.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -28,7 +28,7 @@ public class Mutex
*/
public synchronized void acquire() throws InterruptedException
{
- while (tryToAcquire() == false)
+ while (!tryToAcquire())
{
wait();
}
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/PrefixResolver.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/PrefixResolver.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/PrefixResolver.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -18,7 +18,7 @@ package org.apache.xmlbeans.impl.common;
public interface PrefixResolver
{
/**
- * Caled when the user has a prefix and needs to look up the corresponding
+ * Called when the user has a prefix and needs to look up the corresponding
* namespace URI. If the prefix is not defined in this context, then this
* method may return null. The no-namespace is represented by the empty
* string return result.
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/SystemCache.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/SystemCache.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/SystemCache.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -50,7 +50,7 @@ public class SystemCache {
public void addToTypeLoaderCache(SchemaTypeLoader stl, ClassLoader cl) {
}
- private ThreadLocal<SoftReference> tl_saxLoaders = new ThreadLocal<>();
+ private final ThreadLocal<SoftReference<Object>> tl_saxLoaders = new
ThreadLocal<>();
public void clearThreadLocals() {
@@ -58,12 +58,12 @@ public class SystemCache {
}
public Object getSaxLoader() {
- SoftReference s = tl_saxLoaders.get();
+ SoftReference<Object> s = tl_saxLoaders.get();
return s == null ? null : s.get();
}
public void setSaxLoader(Object saxLoader) {
- tl_saxLoaders.set(new SoftReference(saxLoader));
+ tl_saxLoaders.set(new SoftReference<>(saxLoader));
}
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/XMLChar.java
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/XMLChar.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/XMLChar.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -81,7 +81,7 @@ public class XMLChar {
// [#xE000-#xFFFD] | [#x10000-#x10FFFF]
//
- int charRange[] = {
+ int[] charRange = {
0x0009, 0x000A, 0x000D, 0x000D, 0x0020, 0xD7FF, 0xE000, 0xFFFD,
};
@@ -89,7 +89,7 @@ public class XMLChar {
// [3] S ::= (#x20 | #x9 | #xD | #xA)+
//
- int spaceChar[] = {
+ int[] spaceChar = {
0x0020, 0x0009, 0x000D, 0x000A,
};
@@ -98,7 +98,7 @@ public class XMLChar {
// CombiningChar | Extender
//
- int nameChar[] = {
+ int[] nameChar = {
0x002D, 0x002E, // '-' and '.'
};
@@ -106,7 +106,7 @@ public class XMLChar {
// [5] Name ::= (Letter | '_' | ':') (NameChar)*
//
- int nameStartChar[] = {
+ int[] nameStartChar = {
0x003A, 0x005F, // ':' and '_'
};
@@ -114,12 +114,12 @@ public class XMLChar {
// [13] PubidChar ::= #x20 | 0xD | 0xA | [a-zA-Z0-9] |
[-'()+,./:=?;!*#@$_%]
//
- int pubidChar[] = {
+ int[] pubidChar = {
0x000A, 0x000D, 0x0020, 0x0021, 0x0023, 0x0024, 0x0025, 0x003D,
0x005F
};
- int pubidRange[] = {
+ int[] pubidRange = {
0x0027, 0x003B, 0x003F, 0x005A, 0x0061, 0x007A
};
@@ -127,7 +127,7 @@ public class XMLChar {
// [84] Letter ::= BaseChar | Ideographic
//
- int letterRange[] = {
+ int[] letterRange = {
// BaseChar
0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6, 0x00D8, 0x00F6,
0x00F8, 0x0131, 0x0134, 0x013E, 0x0141, 0x0148, 0x014A, 0x017E,
@@ -170,7 +170,7 @@ public class XMLChar {
// Ideographic
0x3021, 0x3029, 0x4E00, 0x9FA5,
};
- int letterChar[] = {
+ int[] letterChar = {
// BaseChar
0x0386, 0x038C, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x0559, 0x06D5,
0x093D, 0x09B2, 0x0A5E, 0x0A8D, 0x0ABD, 0x0AE0, 0x0B3D, 0x0B9C,
@@ -187,7 +187,7 @@ public class XMLChar {
// [87] CombiningChar ::= ...
//
- int combiningCharRange[] = {
+ int[] combiningCharRange = {
0x0300, 0x0345, 0x0360, 0x0361, 0x0483, 0x0486, 0x0591, 0x05A1,
0x05A3, 0x05B9, 0x05BB, 0x05BD, 0x05C1, 0x05C2, 0x064B, 0x0652,
0x06D6, 0x06DC, 0x06DD, 0x06DF, 0x06E0, 0x06E4, 0x06E7, 0x06E8,
@@ -207,7 +207,7 @@ public class XMLChar {
0x20D0, 0x20DC, 0x302A, 0x302F,
};
- int combiningCharChar[] = {
+ int[] combiningCharChar = {
0x05BF, 0x05C4, 0x0670, 0x093C, 0x094D, 0x09BC, 0x09BE, 0x09BF,
0x09D7, 0x0A02, 0x0A3C, 0x0A3E, 0x0A3F, 0x0ABC, 0x0B3C, 0x0BD7,
0x0D57, 0x0E31, 0x0EB1, 0x0F35, 0x0F37, 0x0F39, 0x0F3E, 0x0F3F,
@@ -218,7 +218,7 @@ public class XMLChar {
// [88] Digit ::= ...
//
- int digitRange[] = {
+ int[] digitRange = {
0x0030, 0x0039, 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F,
0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F,
0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F,
@@ -229,11 +229,11 @@ public class XMLChar {
// [89] Extender ::= ...
//
- int extenderRange[] = {
+ int[] extenderRange = {
0x3031, 0x3035, 0x309D, 0x309E, 0x30FC, 0x30FE,
};
- int extenderChar[] = {
+ int[] extenderChar = {
0x00B7, 0x02D0, 0x02D1, 0x0387, 0x0640, 0x0E46, 0x0EC6, 0x3005,
};
@@ -241,7 +241,7 @@ public class XMLChar {
// SpecialChar ::= '<', '&', '\n', '\r', ']'
//
- int specialChar[] = {
+ int[] specialChar = {
'<', '&', '\n', '\r', ']',
};
@@ -518,11 +518,11 @@ public class XMLChar {
if (name.isEmpty())
return false;
char ch = name.charAt(0);
- if( isNameStart(ch) == false)
+ if(!isNameStart(ch))
return false;
for (int i = 1; i < name.length(); i++ ) {
ch = name.charAt(i);
- if( isName( ch ) == false ){
+ if(!isName(ch)){
return false;
}
}
@@ -545,11 +545,11 @@ public class XMLChar {
if (ncName.isEmpty())
return false;
char ch = ncName.charAt(0);
- if( isNCNameStart(ch) == false)
+ if(!isNCNameStart(ch))
return false;
for (int i = 1; i < ncName.length(); i++ ) {
ch = ncName.charAt(i);
- if( isNCName( ch ) == false ){
+ if(!isNCName(ch)){
return false;
}
}
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/XmlErrorWatcher.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/XmlErrorWatcher.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/XmlErrorWatcher.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -30,6 +30,7 @@ public class XmlErrorWatcher extends Abs
_underlying = underlying;
}
+ @Override
public boolean add(XmlError o) {
if (_firstError == null && o != null && o.getSeverity() ==
XmlError.SEVERITY_ERROR) {
_firstError = o;
@@ -40,6 +41,7 @@ public class XmlErrorWatcher extends Abs
return _underlying.add(o);
}
+ @Override
public Iterator<XmlError> iterator() {
if (_underlying == null) {
return Collections.emptyIterator();
@@ -48,6 +50,7 @@ public class XmlErrorWatcher extends Abs
return _underlying.iterator();
}
+ @Override
public int size() {
if (_underlying == null) {
return 0;
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/BindingConfigImpl.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/BindingConfigImpl.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/BindingConfigImpl.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -176,7 +176,7 @@ public class BindingConfigImpl extends B
}
}
- private static void recordNamespacePrefixSetting(List list, String value,
Map<Object, String> result) {
+ private static void recordNamespacePrefixSetting(List<Object> list, String
value, Map<Object, String> result) {
if (value == null) {
return;
}
@@ -193,11 +193,10 @@ public class BindingConfigImpl extends B
if (key instanceof String && "*".equals(key)) {
xbeanSet = NameSet.EVERYTHING;
- } else if (key instanceof List) {
+ } else if (key instanceof List<?>) {
NameSetBuilder xbeanSetBuilder = new NameSetBuilder();
- for (Object o : (List) key) {
- String xbeanName = (String) o;
- xbeanSetBuilder.add(xbeanName);
+ for (Object o : (List<?>) key) {
+ xbeanSetBuilder.add(o.toString());
}
xbeanSet = xbeanSetBuilder.toNameSet();
}
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/InterfaceExtensionImpl.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/InterfaceExtensionImpl.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/InterfaceExtensionImpl.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -19,7 +19,6 @@ import com.github.javaparser.ast.NodeLis
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
import com.github.javaparser.ast.body.MethodDeclaration;
import com.github.javaparser.ast.body.Parameter;
-import com.github.javaparser.ast.type.ReferenceType;
import com.github.javaparser.ast.type.Type;
import com.github.javaparser.ast.type.TypeParameter;
import com.github.javaparser.resolution.MethodUsage;
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/NameSet.java
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/NameSet.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/NameSet.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -20,6 +20,7 @@ package org.apache.xmlbeans.impl.config;
import java.util.Collections;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Set;
/**
@@ -31,19 +32,19 @@ public class NameSet {
/**
* An empty NameSet, it doesn't contain any name
*/
- public static final NameSet EMPTY = new NameSet(true,
Collections.EMPTY_SET);
+ public static final NameSet EMPTY = new NameSet(true,
Collections.emptySet());
/**
* The NameSet that contains any name
*/
- public static final NameSet EVERYTHING = new NameSet(false,
Collections.EMPTY_SET);
+ public static final NameSet EVERYTHING = new NameSet(false,
Collections.emptySet());
/*
There are two big cases:
1) - it represents "*", ie all except a finite set of names:
_isFinite==false
2) - if represents only a finite set of names: _isFinite==true
*/
- private boolean _isFinite;
- private Set<String> _finiteSet;
+ private final boolean _isFinite;
+ private final Set<String> _finiteSet;
private NameSet(boolean isFinite, Set<String> finiteSet) {
_isFinite = isFinite;
@@ -67,8 +68,9 @@ public class NameSet {
private static Set<String> intersectFiniteSets(Set<String> a, Set<String>
b) {
Set<String> intersection = new HashSet<>();
//compute the intersection of _finiteSet with withSet
- while (a.iterator().hasNext()) {
- String name = (String) a.iterator().next();
+ Iterator<String> it = a.iterator();
+ while (it.hasNext()) {
+ String name = it.next();
if (b.contains(name)) {
intersection.add(name);
}
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/BuiltinSchemaTypeSystem.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/BuiltinSchemaTypeSystem.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/BuiltinSchemaTypeSystem.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -44,7 +44,7 @@ public class BuiltinSchemaTypeSystem ext
private static final SchemaAttributeGroup[]
EMPTY_SCHEMAATTRIBUTEGROUP_ARRAY = new SchemaAttributeGroup[0];
private static final SchemaAnnotation[] EMPTY_SCHEMAANNOTATION_ARRAY = new
SchemaAnnotation[0];
- private static BuiltinSchemaTypeSystem _global = new
BuiltinSchemaTypeSystem();
+ private static final BuiltinSchemaTypeSystem _global = new
BuiltinSchemaTypeSystem();
// UR types
public static final SchemaTypeImpl ST_ANY_TYPE =
_global.getBuiltinType(SchemaType.BTC_ANY_TYPE);
@@ -209,12 +209,12 @@ public class BuiltinSchemaTypeSystem ext
}
}
- private Map<QName, SchemaType> _typeMap = new HashMap<>();
- private SchemaTypeImpl[] _typeArray = new
SchemaTypeImpl[SchemaType.BTC_LAST_BUILTIN + 1];
- private Map<String, SchemaType> _handlesToObjects = new HashMap<>();
- private Map<SchemaType, String> _objectsToHandles = new HashMap<>();
- private Map<String, SchemaType> _typesByClassname = new HashMap<>();
- private SchemaContainer _container = new
SchemaContainer("http://www.w3.org/2001/XMLSchema");
+ private final Map<QName, SchemaType> _typeMap = new HashMap<>();
+ private final SchemaTypeImpl[] _typeArray = new
SchemaTypeImpl[SchemaType.BTC_LAST_BUILTIN + 1];
+ private final Map<String, SchemaType> _handlesToObjects = new HashMap<>();
+ private final Map<SchemaType, String> _objectsToHandles = new HashMap<>();
+ private final Map<String, SchemaType> _typesByClassname = new HashMap<>();
+ private final SchemaContainer _container = new
SchemaContainer("http://www.w3.org/2001/XMLSchema");
private SchemaTypeImpl getBuiltinType(int btc)
{
@@ -596,9 +596,6 @@ public class BuiltinSchemaTypeSystem ext
derivationType = SchemaType.DT_RESTRICTION;
break;
- default:
- assert(false);
-
case SchemaType.BTC_ANY_SIMPLE:
base = ST_ANY_TYPE; break;
@@ -697,6 +694,9 @@ public class BuiltinSchemaTypeSystem ext
else
item = ST_NMTOKEN;
break;
+
+ default:
+ assert(false);
}
result.setDerivationType(derivationType);
@@ -731,9 +731,6 @@ public class BuiltinSchemaTypeSystem ext
// now set up facets
switch (btc)
{
- default:
- assert(false);
-
case SchemaType.BTC_ANY_TYPE:
case SchemaType.BTC_ANY_SIMPLE:
case SchemaType.BTC_NOT_BUILTIN:
@@ -882,6 +879,10 @@ public class BuiltinSchemaTypeSystem ext
fixedf = FIXED_FACETS_NONE;
wsr = SchemaType.WS_UNSPECIFIED;
break;
+
+ default:
+ assert(false);
+
}
// fundamental facets
@@ -892,9 +893,6 @@ public class BuiltinSchemaTypeSystem ext
switch (btc)
{
- default:
- assert(false);
-
case SchemaType.BTC_ANY_TYPE:
case SchemaType.BTC_NOT_BUILTIN:
case SchemaType.BTC_ANY_SIMPLE:
@@ -960,6 +958,9 @@ public class BuiltinSchemaTypeSystem ext
isFinite = true;
isBounded = true;
break;
+
+ default:
+ assert(false);
}
result.setBasicFacets(facets, fixedf);
@@ -1030,7 +1031,7 @@ public class BuiltinSchemaTypeSystem ext
attrModel.setWildcardSet(QNameSet.ALL);
result.setComplexTypeVariety(SchemaType.MIXED_CONTENT);
- result.setContentModel(contentModel, attrModel,
Collections.EMPTY_MAP, Collections.EMPTY_MAP, false);
+ result.setContentModel(contentModel, attrModel,
Collections.emptyMap(), Collections.emptyMap(), false);
result.setAnonymousTypeRefs(EMPTY_SCHEMATYPEREF_ARRAY);
result.setWildcardSummary(QNameSet.ALL, true, QNameSet.ALL, true);
}
@@ -1040,7 +1041,7 @@ public class BuiltinSchemaTypeSystem ext
SchemaParticleImpl contentModel = null; // empty
SchemaAttributeModelImpl attrModel = new
SchemaAttributeModelImpl(); // empty
result.setComplexTypeVariety(SchemaType.EMPTY_CONTENT);
- result.setContentModel(contentModel, attrModel,
Collections.EMPTY_MAP, Collections.EMPTY_MAP, false);
+ result.setContentModel(contentModel, attrModel,
Collections.emptyMap(), Collections.emptyMap(), false);
result.setAnonymousTypeRefs(EMPTY_SCHEMATYPEREF_ARRAY);
result.setWildcardSummary(QNameSet.EMPTY, false, QNameSet.EMPTY,
false);
}
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscResolver.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscResolver.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscResolver.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -194,7 +194,7 @@ public class StscResolver {
sImpl.setContentModel(
contentModel, new SchemaAttributeModelImpl(),
- elementPropertyModel, Collections.EMPTY_MAP, false);
+ elementPropertyModel, Collections.emptyMap(), false);
sImpl.setWildcardSummary(
QNameSet.EMPTY, false, QNameSet.EMPTY, false);
@@ -236,7 +236,7 @@ public class StscResolver {
attributeModel, sImpl);
sImpl.setContentModel(
- null, attributeModel, Collections.EMPTY_MAP,
attributePropertyModel, false);
+ null, attributeModel, Collections.emptyMap(),
attributePropertyModel, false);
sImpl.setWildcardSummary(
QNameSet.EMPTY, false, QNameSet.EMPTY, false);
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -570,7 +570,7 @@ public class XQuerySchemaTypeSystem exte
*/
public void fillInType(int btc) {
SchemaTypeImpl result = getBuiltinType(btc);
- SchemaType base;
+ SchemaType base = null;
SchemaType item = null;
int variety = SchemaType.ATOMIC;
int derivationType = SchemaType.DT_RESTRICTION;
@@ -587,9 +587,6 @@ public class XQuerySchemaTypeSystem exte
derivationType = SchemaType.DT_RESTRICTION;
break;
- default:
- assert (false);
-
case SchemaType.BTC_ANY_SIMPLE:
base = ST_ANY_TYPE;
break;
@@ -721,6 +718,8 @@ public class XQuerySchemaTypeSystem exte
base = ST_DURATION;
break;
+ default:
+ assert (false);
}
result.setDerivationType(derivationType);
@@ -746,16 +745,13 @@ public class XQuerySchemaTypeSystem exte
result.setPrimitiveTypeRef(base.getPrimitiveType().getRef());
}
- XmlValueRef[] facets;
- boolean[] fixedf;
+ XmlValueRef[] facets = null;
+ boolean[] fixedf = null;
int wsr = SchemaType.WS_COLLAPSE;
int decimalSize = SchemaType.NOT_DECIMAL;
// now set up facets
switch (btc) {
- default:
- assert (false);
-
case SchemaType.BTC_ANY_TYPE:
case SchemaType.BTC_ANY_SIMPLE:
case SchemaType.BTC_NOT_BUILTIN:
@@ -913,6 +909,8 @@ public class XQuerySchemaTypeSystem exte
wsr = SchemaType.WS_COLLAPSE;
break;
+ default:
+ assert (false);
}
// fundamental facets
@@ -922,9 +920,6 @@ public class XQuerySchemaTypeSystem exte
boolean isBounded = false;
switch (btc) {
- default:
- assert (false);
-
case SchemaType.BTC_ANY_TYPE:
case SchemaType.BTC_NOT_BUILTIN:
case SchemaType.BTC_ANY_SIMPLE:
@@ -993,6 +988,9 @@ public class XQuerySchemaTypeSystem exte
isFinite = true;
isBounded = true;
break;
+
+ default:
+ assert (false);
}
result.setBasicFacets(facets, fixedf);
@@ -1069,7 +1067,7 @@ public class XQuerySchemaTypeSystem exte
attrModel.setWildcardSet(QNameSet.ALL);
result.setComplexTypeVariety(SchemaType.MIXED_CONTENT);
- result.setContentModel(contentModel, attrModel,
Collections.EMPTY_MAP, Collections.EMPTY_MAP, false);
+ result.setContentModel(contentModel, attrModel,
Collections.emptyMap(), Collections.emptyMap(), false);
result.setAnonymousTypeRefs(EMPTY_SCHEMATYPEREF_ARRAY);
result.setWildcardSummary(QNameSet.ALL, true, QNameSet.ALL, true);
} else if (btc == SchemaType.BTC_NOT_BUILTIN) {
@@ -1077,7 +1075,7 @@ public class XQuerySchemaTypeSystem exte
SchemaParticleImpl contentModel = null; // empty
SchemaAttributeModelImpl attrModel = new
SchemaAttributeModelImpl(); // empty
result.setComplexTypeVariety(SchemaType.EMPTY_CONTENT);
- result.setContentModel(contentModel, attrModel,
Collections.EMPTY_MAP, Collections.EMPTY_MAP, false);
+ result.setContentModel(contentModel, attrModel,
Collections.emptyMap(), Collections.emptyMap(), false);
result.setAnonymousTypeRefs(EMPTY_SCHEMATYPEREF_ARRAY);
result.setWildcardSummary(QNameSet.EMPTY, false, QNameSet.EMPTY,
false);
}
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/InstanceValidator.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/InstanceValidator.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/InstanceValidator.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -57,7 +57,7 @@ public class InstanceValidator {
flags.add("strict");
flags.add("partial");
- CommandLine cl = new CommandLine(args, flags, Collections.EMPTY_SET);
+ CommandLine cl = new CommandLine(args, flags, Collections.emptySet());
if (cl.getOpt("h") != null || cl.getOpt("help") != null ||
cl.getOpt("usage") != null || args.length < 1) {
printUsage();
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -55,7 +55,7 @@ public class StreamInstanceValidator
flags.add("noupr");
flags.add("noupa");
- CommandLine cl = new CommandLine(args, flags, Collections.EMPTY_SET);
+ CommandLine cl = new CommandLine(args, flags, Collections.emptySet());
if (cl.getOpt("h") != null || cl.getOpt("help") != null ||
cl.getOpt("usage") != null || args.length < 1)
{
printUsage();
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
Tue Jun 23 12:45:04 2026 (r1935583)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
Tue Jun 23 12:45:55 2026 (r1935584)
@@ -67,7 +67,7 @@ public class TypeHierarchyPrinter
flags.add("noupa");
flags.add("partial");
- CommandLine cl = new CommandLine(args, flags, Collections.EMPTY_SET);
+ CommandLine cl = new CommandLine(args, flags, Collections.emptySet());
if (cl.getOpt("h") != null || cl.getOpt("help") != null ||
cl.getOpt("usage") != null)
{
printUsage();
@@ -216,12 +216,12 @@ public class TypeHierarchyPrinter
}
// step 4: print the tree, starting from xs:anyType (i.e.,
XmlObject.type)
- List typesToPrint = new ArrayList<>();
+ List<SchemaType> typesToPrint = new ArrayList<>();
typesToPrint.add(XmlObject.type);
StringBuilder spaces = new StringBuilder();
while (!typesToPrint.isEmpty())
{
- SchemaType sType =
(SchemaType)typesToPrint.remove(typesToPrint.size() - 1);
+ SchemaType sType = typesToPrint.remove(typesToPrint.size() - 1);
if (sType == null)
spaces.setLength(Math.max(0, spaces.length() - 2));
else
@@ -269,10 +269,10 @@ public class TypeHierarchyPrinter
}
}
- private static void noteNamespace(Map prefixes, SchemaType sType)
+ private static void noteNamespace(Map<String, String> prefixes, SchemaType
sType)
{
String namespace = QNameHelper.namespace(sType);
- if (namespace.equals("") || prefixes.containsKey(namespace))
+ if (namespace.isEmpty() || prefixes.containsKey(namespace))
return;
String base = QNameHelper.suggestPrefix(namespace);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]