src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,19 +21,19 @@
package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-import java.util.Stack;
-import java.util.Vector;
-
import com.sun.org.apache.xerces.internal.impl.validation.ValidationState;
import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;
import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
import com.sun.org.apache.xerces.internal.util.SymbolTable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
+import org.w3c.dom.Attr;
import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
/**
* Objects of this class hold all information pecular to a
@@ -50,7 +50,7 @@
// Data
protected SchemaNamespaceSupport fNamespaceSupport;
protected SchemaNamespaceSupport fNamespaceSupportRoot;
- protected Stack SchemaNamespaceSupportStack = new Stack();
+ protected Stack<SchemaNamespaceSupport> SchemaNamespaceSupportStack = new Stack<>();
// schema's attributeFormDefault
protected boolean fAreLocalAttributesQualified;
@@ -72,7 +72,7 @@
protected Element fSchemaElement;
// all namespaces that this document can refer to
- Vector fImportedNS = new Vector();
+ List<String> fImportedNS = new ArrayList<>();
protected ValidationState fValidationContext = new ValidationState();
@@ -188,7 +188,7 @@
}
void restoreNSSupport() {
- fNamespaceSupport = (SchemaNamespaceSupport)SchemaNamespaceSupportStack.pop();
+ fNamespaceSupport = SchemaNamespaceSupportStack.pop();
fValidationContext.setNamespaceSupport(fNamespaceSupport);
}
@@ -198,7 +198,7 @@
}
public void addAllowedNS(String namespace) {
- fImportedNS.addElement(namespace == null ? "" : namespace);
+ fImportedNS.add(namespace == null ? "" : namespace);
}
public boolean isAllowedNS(String namespace) {
@@ -207,16 +207,16 @@
// store whether we have reported an error about that this document
// can't access components from the given namespace
- private Vector fReportedTNS = null;
+ private List<String> fReportedTNS = null;
// check whether we need to report an error against the given uri.
// if we have reported an error, then we don't need to report again;
// otherwise we reported the error, and remember this fact.
final boolean needReportTNSError(String uri) {
if (fReportedTNS == null)
- fReportedTNS = new Vector();
+ fReportedTNS = new ArrayList<>();
else if (fReportedTNS.contains(uri))
return false;
- fReportedTNS.addElement(uri);
+ fReportedTNS.add(uri);
return true;
}