Author: fanningpj
Date: Fri Jan 7 12:54:54 2022
New Revision: 1896798
URL: http://svn.apache.org/viewvc?rev=1896798&view=rev
Log:
use more generics internally
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlException.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlRuntimeException.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/PathResourceLoader.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaAnnotationImpl.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscResolver.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/XmlValueRef.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/CommandLine.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/SchemaResourceManager.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
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/NamespaceContext.java
Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlException.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlException.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlException.java
(original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlException.java Fri Jan
7 12:54:54 2022
@@ -66,12 +66,12 @@ public class XmlException extends Except
/**
* Constructs an XmlException from a message, a cause, and a collection of
{@link XmlError XmlErrors}.
*/
- public XmlException ( String m, Throwable t, Collection errors )
+ public XmlException ( String m, Throwable t, Collection<XmlError> errors )
{
super( m, t );
if (errors != null)
- _errors = Collections.unmodifiableList( new ArrayList( errors ) );
+ _errors = Collections.unmodifiableList( new ArrayList<>( errors )
);
}
/**
@@ -85,7 +85,7 @@ public class XmlException extends Except
Collection<XmlError> errors = xmlRuntimeException.getErrors();
if (errors != null)
- _errors = Collections.unmodifiableList( new ArrayList( errors ) );
+ _errors = Collections.unmodifiableList( new ArrayList<>( errors )
);
}
/**
Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java Fri Jan 7
12:54:54 2022
@@ -312,7 +312,7 @@ public class XmlOptions implements java.
* <pre>{@code
* // Create an XmlOptions instance and set the error listener.
* XmlOptions validateOptions = new XmlOptions();
- * ArrayList errorList = new ArrayList();
+ * ArrayList<XmlError> errorList = new ArrayList<>();
* validateOptions.setErrorListener(errorList);
*
* // Validate the XML.
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlRuntimeException.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlRuntimeException.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlRuntimeException.java
(original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlRuntimeException.java
Fri Jan 7 12:54:54 2022
@@ -49,12 +49,12 @@ public class XmlRuntimeException extends
/**
* Constructs an XmlRuntimeException from a message, a cause, and a
collection of XmlErrors.
*/
- public XmlRuntimeException ( String m, Throwable t, Collection errors )
+ public XmlRuntimeException ( String m, Throwable t, Collection<XmlError>
errors )
{
super( m, t );
if (errors != null)
- _errors = Collections.unmodifiableList( new ArrayList(errors) );
+ _errors = Collections.unmodifiableList( new ArrayList<>(errors) );
}
/**
@@ -83,7 +83,7 @@ public class XmlRuntimeException extends
Collection<XmlError> errors = xmlException.getErrors();
if (errors != null)
- _errors = Collections.unmodifiableList( new ArrayList( errors ) );
+ _errors = Collections.unmodifiableList( new ArrayList<>( errors )
);
}
/**
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/PathResourceLoader.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/PathResourceLoader.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/PathResourceLoader.java
(original)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/PathResourceLoader.java
Fri Jan 7 12:54:54 2022
@@ -35,7 +35,7 @@ public class PathResourceLoader implemen
public PathResourceLoader(File[] filepath)
{
- List pathlist = new ArrayList();
+ List<ResourceLoader> pathlist = new ArrayList<>();
for (int i = 0; i < filepath.length; i++)
{
try
@@ -48,7 +48,7 @@ public class PathResourceLoader implemen
continue; // can't read a file on classpath? skip it.
}
}
- _path = (ResourceLoader[])pathlist.toArray(new
ResourceLoader[pathlist.size()]);
+ _path = pathlist.toArray(new ResourceLoader[pathlist.size()]);
}
public InputStream getResourceAsStream(String resourceName)
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaAnnotationImpl.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaAnnotationImpl.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaAnnotationImpl.java
(original)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/SchemaAnnotationImpl.java
Fri Jan 7 12:54:54 2022
@@ -136,7 +136,7 @@ public class SchemaAnnotationImpl implem
SchemaAnnotationImpl result = new SchemaAnnotationImpl(c);
// Retrieving attributes, first attributes on the enclosing element
- ArrayList attrArray = new ArrayList(2);
+ ArrayList<AttributeImpl> attrArray = new ArrayList<>(2);
addNoSchemaAttributes(elem, attrArray);
if (ann == null)
{
@@ -160,7 +160,7 @@ public class SchemaAnnotationImpl implem
return result;
}
- private static void addNoSchemaAttributes(XmlObject elem, List attrList)
+ private static void addNoSchemaAttributes(XmlObject elem,
List<AttributeImpl> attrList)
{
try (XmlCursor cursor = elem.newCursor()) {
boolean hasAttributes = cursor.toFirstAttribute();
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscResolver.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscResolver.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscResolver.java
(original)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscResolver.java
Fri Jan 7 12:54:54 2022
@@ -41,14 +41,14 @@ public class StscResolver {
resolveSubstitutionGroup((SchemaTypeImpl) documentTypes[i]);
}
- List allSeenTypes = new ArrayList();
+ List<SchemaType> allSeenTypes = new ArrayList<>();
allSeenTypes.addAll(Arrays.asList(state.documentTypes()));
allSeenTypes.addAll(Arrays.asList(state.attributeTypes()));
allSeenTypes.addAll(Arrays.asList(state.redefinedGlobalTypes()));
allSeenTypes.addAll(Arrays.asList(state.globalTypes()));
for (int i = 0; i < allSeenTypes.size(); i++) {
- SchemaType gType = (SchemaType) allSeenTypes.get(i);
+ SchemaType gType = allSeenTypes.get(i);
resolveType((SchemaTypeImpl) gType);
allSeenTypes.addAll(Arrays.asList(gType.getAnonymousTypes()));
}
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/XmlValueRef.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/XmlValueRef.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/XmlValueRef.java
(original)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/XmlValueRef.java
Fri Jan 7 12:54:54 2022
@@ -53,10 +53,10 @@ public class XmlValueRef
_obj = type.newValue(_initVal);
else
{
- List actualVals = new ArrayList();
- for (Iterator i = ((List)_initVal).iterator(); i.hasNext(); )
+ List<XmlAnySimpleType> actualVals = new ArrayList<>();
+ for (Iterator<XmlValueRef> i =
((List<XmlValueRef>)_initVal).iterator(); i.hasNext(); )
{
- XmlValueRef ref = (XmlValueRef)i.next();
+ XmlValueRef ref = i.next();
actualVals.add(ref.get());
}
_obj = type.newValue(actualVals);
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/CommandLine.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/CommandLine.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/CommandLine.java
(original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/CommandLine.java
Fri Jan 7 12:54:54 2022
@@ -38,9 +38,9 @@ public class CommandLine
if (flags == null || scheme == null)
throw new IllegalArgumentException("collection required (use
Collections.EMPTY_SET if no options)");
- _options = new LinkedHashMap();
- ArrayList badopts = new ArrayList();
- ArrayList endargs = new ArrayList();
+ _options = new LinkedHashMap<>();
+ ArrayList<String> badopts = new ArrayList<>();
+ ArrayList<String> endargs = new ArrayList<>();
for (int i = 0; i < args.length; i++)
{
@@ -69,8 +69,8 @@ public class CommandLine
}
}
- _badopts = (String[])badopts.toArray(new String[badopts.size()]);
- _args = (String[])endargs.toArray(new String[endargs.size()]);
+ _badopts = badopts.toArray(new String[badopts.size()]);
+ _args = endargs.toArray(new String[endargs.size()]);
}
public static void printLicense()
@@ -90,7 +90,7 @@ public class CommandLine
System.out.println(XmlBeans.getVendor() + ", " + XmlBeans.getTitle() +
".XmlBeans version " + XmlBeans.getVersion());
}
- private Map _options;
+ private Map<String, String> _options;
private String[] _badopts;
private String[] _args;
@@ -113,7 +113,7 @@ public class CommandLine
private static List collectFiles(File[] dirs)
{
- List files = new ArrayList();
+ List<File> files = new ArrayList<>();
for (int i = 0; i < dirs.length; i++)
{
File f = dirs[i];
@@ -129,13 +129,13 @@ public class CommandLine
return files;
}
- private List _files;
- private List _urls;
+ private List<File> _files;
+ private List<URL> _urls;
private File _baseDir;
private static final File[] EMPTY_FILEARRAY = new File[0];
private static final URL[] EMPTY_URLARRAY = new URL[0];
- private List getFileList()
+ private List<File> getFileList()
{
if (_files == null)
{
@@ -174,7 +174,7 @@ public class CommandLine
if (_urls == null)
{
String[] args = args();
- List urls = new ArrayList();
+ List<URL> urls = new ArrayList<>();
for (int i = 0; i < args.length; i++)
{
@@ -209,7 +209,7 @@ public class CommandLine
public File[] getFiles()
{
- return (File[])getFileList().toArray(EMPTY_FILEARRAY);
+ return getFileList().toArray(EMPTY_FILEARRAY);
}
public File getBaseDir()
@@ -219,13 +219,13 @@ public class CommandLine
public File[] filesEndingWith(String ext)
{
- List result = new ArrayList();
- for (Iterator i = getFileList().iterator(); i.hasNext(); )
+ List<File> result = new ArrayList<>();
+ for (Iterator<File> i = getFileList().iterator(); i.hasNext(); )
{
- File f = (File)i.next();
+ File f = i.next();
if (f.getName().endsWith(ext) && !looksLikeURL(f.getPath()))
result.add(f);
}
- return (File[])result.toArray(EMPTY_FILEARRAY);
+ return result.toArray(EMPTY_FILEARRAY);
}
}
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java
(original)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java
Fri Jan 7 12:54:54 2022
@@ -154,17 +154,17 @@ public class SchemaCodeGenerator {
private static int triesRemaining = 0;
private static boolean tryNowThatItsLater() {
- List files;
+ List<File> files;
synchronized (deleteFileQueue) {
- files = new ArrayList(deleteFileQueue);
+ files = new ArrayList<>(deleteFileQueue);
deleteFileQueue.clear();
}
- List retry = new ArrayList();
+ List<File> retry = new ArrayList<>();
- for (Iterator i = files.iterator(); i.hasNext(); ) {
- File file = (File) i.next();
+ for (Iterator<File> i = files.iterator(); i.hasNext(); ) {
+ File file = i.next();
tryToDelete(file);
if (file.exists()) {
retry.add(file);
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/SchemaResourceManager.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/SchemaResourceManager.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/SchemaResourceManager.java
(original)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/SchemaResourceManager.java
Fri Jan 7 12:54:54 2022
@@ -55,7 +55,7 @@ public class SchemaResourceManager exten
return;
}
- Set flags = new HashSet();
+ Set<String> flags = new HashSet<>();
flags.add("h");
flags.add("help");
flags.add("usage");
@@ -65,7 +65,7 @@ public class SchemaResourceManager exten
flags.add("refresh");
flags.add("recurse");
- Set opts = new HashSet();
+ Set<String> opts = new HashSet<>();
opts.add("dir");
CommandLine cl = new CommandLine(args, flags, opts);
if (cl.getOpt("h") != null || cl.getOpt("help") != null ||
cl.getOpt("usage") != null)
@@ -124,8 +124,8 @@ public class SchemaResourceManager exten
return;
}
- List uriList = new ArrayList();
- List fileList = new ArrayList();
+ List<String> uriList = new ArrayList<>();
+ List<File> fileList = new ArrayList<>();
for (int i = 0; i < args.length; i++)
{
if (looksLikeURL(args[i]))
@@ -139,9 +139,9 @@ public class SchemaResourceManager exten
}
// deal with files that are not in the proper directory
- for (Iterator i = fileList.iterator(); i.hasNext(); )
+ for (Iterator<File> i = fileList.iterator(); i.hasNext(); )
{
- File file = (File)i.next();
+ File file = i.next();
if (!isInDirectory(file, directory))
{
System.err.println("File not within directory: " + file);
@@ -281,7 +281,7 @@ public class SchemaResourceManager exten
*/
private static List collectXSDFiles(File[] dirs)
{
- List files = new ArrayList();
+ List<File> files = new ArrayList<>();
for (int i = 0; i < dirs.length; i++)
{
File f = dirs[i];
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java
(original)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java
Fri Jan 7 12:54:54 2022
@@ -112,10 +112,10 @@ public class StreamInstanceValidator
}
}
- XmlObject[] schemas = (XmlObject[])sdocs.toArray(new XmlObject[0]);
+ XmlObject[] schemas = sdocs.toArray(new XmlObject[0]);
SchemaTypeLoader sLoader = null;
- Collection compErrors = new ArrayList();
+ Collection<XmlError> compErrors = new ArrayList<>();
XmlOptions schemaOptions = new XmlOptions();
schemaOptions.setErrorListener(compErrors);
if (dl)
@@ -137,7 +137,7 @@ public class StreamInstanceValidator
e.printStackTrace(System.err);
}
System.out.println("Schema invalid");
- for (Iterator i = compErrors.iterator(); i.hasNext();)
+ for (Iterator<XmlError> i = compErrors.iterator(); i.hasNext();)
System.out.println(i.next());
return;
}
@@ -151,7 +151,7 @@ public class StreamInstanceValidator
final XmlOptions options)
{
final ValidatingXMLStreamReader vsr = new ValidatingXMLStreamReader();
- final Collection errors = new ArrayList();
+ final Collection<XmlError> errors = new ArrayList<>();
for (int i = 0; i < instanceFiles.length; i++) {
final File file = instanceFiles[i];
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
(original)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
Fri Jan 7 12:54:54 2022
@@ -15,6 +15,7 @@
package org.apache.xmlbeans.impl.tool;
+import org.apache.xmlbeans.XmlError;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlOptions;
import org.apache.xmlbeans.XmlBeans;
@@ -129,12 +130,12 @@ public class TypeHierarchyPrinter
}
- XmlObject[] schemas = (XmlObject[])sdocs.toArray(new XmlObject[0]);
+ XmlObject[] schemas = sdocs.toArray(new XmlObject[0]);
// step 2: compile all the schemas
SchemaTypeLoader linkTo = null;
SchemaTypeSystem typeSystem;
- Collection compErrors = new ArrayList();
+ Collection<XmlError> compErrors = new ArrayList<>();
XmlOptions schemaOptions = new XmlOptions();
schemaOptions.setErrorListener(compErrors);
schemaOptions.setCompileDownloadUrls();
@@ -157,7 +158,7 @@ public class TypeHierarchyPrinter
System.out.println("Schema invalid:" + (partial ? " couldn't
recover from errors" : ""));
if (compErrors.isEmpty())
System.out.println(e.getMessage());
- else for (Iterator i = compErrors.iterator(); i.hasNext(); )
+ else for (Iterator<XmlError> i = compErrors.iterator();
i.hasNext(); )
System.out.println(i.next());
return;
}
@@ -166,28 +167,28 @@ public class TypeHierarchyPrinter
if (partial && !compErrors.isEmpty())
{
System.out.println("Schema invalid: partial schema type system
recovered");
- for (Iterator i = compErrors.iterator(); i.hasNext(); )
+ for (Iterator<XmlError> i = compErrors.iterator(); i.hasNext(); )
System.out.println(i.next());
}
// step 3: go through all the types, and note their base types and
namespaces
- Map prefixes = new HashMap();
+ Map<String, String> prefixes = new HashMap<>();
prefixes.put("http://www.w3.org/XML/1998/namespace", "xml");
prefixes.put("http://www.w3.org/2001/XMLSchema", "xs");
System.out.println("xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"");
// This will be a map of (base SchemaType -> Collection of directly
dervied types)
- Map childTypes = new HashMap();
+ Map<SchemaType, Collection<SchemaType>> childTypes = new HashMap<>();
// breadthfirst traversal of the type containment tree
- List allSeenTypes = new ArrayList();
+ List<SchemaType> allSeenTypes = new ArrayList<>();
allSeenTypes.addAll(Arrays.asList(typeSystem.documentTypes()));
allSeenTypes.addAll(Arrays.asList(typeSystem.attributeTypes()));
allSeenTypes.addAll(Arrays.asList(typeSystem.globalTypes()));
for (int i = 0; i < allSeenTypes.size(); i++)
{
- SchemaType sType = (SchemaType)allSeenTypes.get(i);
+ SchemaType sType = allSeenTypes.get(i);
// recurse through nested anonymous types as well
if (!noanon)
@@ -201,10 +202,10 @@ public class TypeHierarchyPrinter
noteNamespace(prefixes, sType);
// enter this type in the list of children of its base type
- Collection children =
(Collection)childTypes.get(sType.getBaseType());
+ Collection children = childTypes.get(sType.getBaseType());
if (children == null)
{
- children = new ArrayList();
+ children = new ArrayList<>();
childTypes.put(sType.getBaseType(), children);
// the first time a builtin type is seen, add it too (to get a
complete tree up to anyType)
@@ -215,7 +216,7 @@ public class TypeHierarchyPrinter
}
// step 4: print the tree, starting from xs:anyType (i.e.,
XmlObject.type)
- List typesToPrint = new ArrayList();
+ List typesToPrint = new ArrayList<>();
typesToPrint.add(XmlObject.type);
StringBuilder spaces = new StringBuilder();
while (!typesToPrint.isEmpty())
@@ -226,7 +227,7 @@ public class TypeHierarchyPrinter
else
{
System.out.println(spaces + "+-" + QNameHelper.readable(sType,
prefixes) + notes(sType));
- Collection children = (Collection)childTypes.get(sType);
+ Collection<SchemaType> children = childTypes.get(sType);
if (children != null && children.size() > 0)
{
spaces.append(typesToPrint.size() == 0 ||
typesToPrint.get(typesToPrint.size() - 1) == null ? " " : "| ");
Modified:
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/NamespaceContext.java
URL:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/NamespaceContext.java?rev=1896798&r1=1896797&r2=1896798&view=diff
==============================================================================
---
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/NamespaceContext.java
(original)
+++
xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/NamespaceContext.java
Fri Jan 7 12:54:54 2022
@@ -75,7 +75,7 @@ public class NamespaceContext implements
private static final class NamespaceContextStack
{
NamespaceContext current;
- ArrayList stack = new ArrayList();
+ ArrayList<NamespaceContext> stack = new ArrayList<>();
final void push(NamespaceContext next)
{
stack.add(current);
@@ -83,7 +83,7 @@ public class NamespaceContext implements
}
final void pop()
{
- current = (NamespaceContext)stack.get(stack.size() - 1);
+ current = stack.get(stack.size() - 1);
stack.remove(stack.size() - 1);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]