8181150: Fix lint warnings in JAXP repo: rawtypes and unchecked
authorjoehw
Wed, 18 Oct 2017 13:25:49 -0700 (2017-10-18)
changeset 47359 e1a6c0168741
parent 47358 d07d5f7cab35
child 47360 31c9cf5eca62
8181150: Fix lint warnings in JAXP repo: rawtypes and unchecked Reviewed-by: lancea, rriggs, mullan
src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHere.java
src/java.xml/share/classes/com/sun/java_cup/internal/runtime/lr_parser.java
src/java.xml/share/classes/com/sun/java_cup/internal/runtime/virtual_parse_stack.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/ExceptionConst.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ARRAYLENGTH.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ATHROW.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/IDIV.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/IREM.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDIV.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LREM.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/MONITORENTER.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/MONITOREXIT.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/MethodGen.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/NEWARRAY.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ReturnInstruction.java
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/InstructionFinder.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/Translet.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/CallTemplate.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/CastCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/CeilingCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ConcatCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ContainsCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ElementAvailableCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Expression.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FloorCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FlowList.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FormatNumberCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/GenerateIdCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LangCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LocalNameCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NameBase.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NameCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceUriCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NotCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NumberCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Predicate.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstructionPattern.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/RelationalExpr.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/RoundCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StartsWithCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Step.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StepPattern.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StringCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StringLengthCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TopLevelElement.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnaryOpExpr.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnparsedEntityUriCall.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UseAttributeSets.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableBase.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Whitespace.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/BooleanType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/IntType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/AttributeMap.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/RangeImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/Constants.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ConfigurableValidationState.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/PSVIErrorList.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultBuilder.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/WeakReferenceXMLSchema.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/NamespaceSupport.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/MultipleScopeNamespaceSupport.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xni/Augmentations.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xni/NamespaceContext.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/LSInputList.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/ShortList.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/StringList.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamedMap.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSObjectList.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/CustomStringPool.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBase.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMStringPool.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTM.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2RTFDTM.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Encodings.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/CharInfo.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/Encodings.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/DOMStringListImpl.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/NamespaceSupport.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOMBuilder.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/ObjectPool.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/QName.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/StringComparable.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/StylesheetPIHandler.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/Expression.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/ExtensionsProvider.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPath.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathException.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/AxesWalker.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/IteratorPool.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncCurrent.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncFalse.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncHere.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncLast.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncPosition.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncTrue.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/Function2Args.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/Function3Args.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XNodeSet.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XObject.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XRTreeFragSelectWrapper.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/operations/Operation.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/operations/UnaryOperation.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/operations/Variable.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/NodeTest.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/StepPattern.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/UnionPattern.java
src/java.xml/share/classes/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java
src/java.xml/share/classes/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java
src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java
src/java.xml/share/classes/javax/xml/namespace/QName.java
src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java
src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java
src/java.xml/share/classes/javax/xml/xpath/XPathFunction.java
src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java
src/java.xml/share/classes/org/xml/sax/helpers/AttributeListImpl.java
src/java.xml/share/classes/org/xml/sax/helpers/NamespaceSupport.java
src/java.xml/share/classes/org/xml/sax/helpers/ParserAdapter.java
--- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHere.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHere.java	Wed Oct 18 13:25:49 2017 -0700
@@ -27,12 +27,14 @@
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.security.utils.I18n;
 import com.sun.org.apache.xml.internal.security.utils.XMLUtils;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.NodeSetDTM;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.functions.Function;
 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
 import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
+import java.util.List;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
@@ -145,8 +147,7 @@
      * @param vars
      * @param globalsSize
      */
-    @SuppressWarnings("rawtypes")
-    public void fixupVariables(java.util.Vector vars, int globalsSize) {
+    public void fixupVariables(List<QName> vars, int globalsSize) {
         // do nothing
     }
 }
--- a/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/lr_parser.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/lr_parser.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -272,7 +272,7 @@
   /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
 
   /** The parse stack itself. */
-  protected Stack stack = new Stack();
+  protected Stack<Symbol> stack = new Stack<>();
 
   /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
 
@@ -322,7 +322,7 @@
   public abstract Symbol do_action(
     int       act_num,
     lr_parser parser,
-    Stack     stack,
+    Stack<Symbol>     stack,
     int       top)
     throws java.lang.Exception;
 
@@ -571,7 +571,7 @@
           /* current state is always on the top of the stack */
 
           /* look up action out of the current state with the current input */
-          act = get_action(((Symbol)stack.peek()).parse_state, cur_token.sym);
+          act = get_action((stack.peek()).parse_state, cur_token.sym);
 
           /* decode the action -- > 0 encodes shift */
           if (act > 0)
@@ -603,7 +603,7 @@
                 }
 
               /* look up the state to go to from the one popped back to */
-              act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
+              act = get_reduce((stack.peek()).parse_state, lhs_sym_num);
 
               /* shift to that state */
               lhs_sym.parse_state = act;
@@ -626,7 +626,7 @@
                   /* just in case that wasn't fatal enough, end parse */
                   done_parsing();
                 } else {
-                  lhs_sym = (Symbol)stack.peek();
+                  lhs_sym = stack.peek();
                 }
             }
         }
@@ -661,8 +661,8 @@
       /* dump the stack */
       for (int i=0; i<stack.size(); i++)
         {
-          debug_message("Symbol: " + ((Symbol)stack.elementAt(i)).sym +
-                        " State: " + ((Symbol)stack.elementAt(i)).parse_state);
+          debug_message("Symbol: " + (stack.get(i)).sym +
+                        " State: " + (stack.get(i)).parse_state);
         }
       debug_message("==========================================");
     }
@@ -698,13 +698,13 @@
   /** Do debug output for stack state. [CSA]
    */
   public void debug_stack() {
-      StringBuffer sb=new StringBuffer("## STACK:");
+      StringBuilder sb=new StringBuilder("## STACK:");
       for (int i=0; i<stack.size(); i++) {
-          Symbol s = (Symbol) stack.elementAt(i);
+          Symbol s = stack.get(i);
           sb.append(" <state "+s.parse_state+", sym "+s.sym+">");
           if ((i%3)==2 || (i==(stack.size()-1))) {
               debug_message(sb.toString());
-              sb = new StringBuffer("         ");
+              sb = new StringBuilder("         ");
           }
       }
   }
@@ -762,7 +762,7 @@
           //debug_stack();
 
           /* look up action out of the current state with the current input */
-          act = get_action(((Symbol)stack.peek()).parse_state, cur_token.sym);
+          act = get_action((stack.peek()).parse_state, cur_token.sym);
 
           /* decode the action -- > 0 encodes shift */
           if (act > 0)
@@ -798,9 +798,9 @@
                 }
 
               /* look up the state to go to from the one popped back to */
-              act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
+              act = get_reduce((stack.peek()).parse_state, lhs_sym_num);
               debug_message("# Reduce rule: top state " +
-                             ((Symbol)stack.peek()).parse_state +
+                             (stack.peek()).parse_state +
                              ", lhs sym " + lhs_sym_num + " -> state " + act);
 
               /* shift to that state */
@@ -826,7 +826,7 @@
                   /* just in case that wasn't fatal enough, end parse */
                   done_parsing();
                 } else {
-                  lhs_sym = (Symbol)stack.peek();
+                  lhs_sym = stack.peek();
                 }
             }
         }
@@ -916,7 +916,7 @@
   protected boolean shift_under_error()
     {
       /* is there a shift under error Symbol */
-      return get_action(((Symbol)stack.peek()).parse_state, error_sym()) > 0;
+      return get_action((stack.peek()).parse_state, error_sym()) > 0;
     }
 
   /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
@@ -936,8 +936,8 @@
       if (debug) debug_message("# Finding recovery state on stack");
 
       /* Remember the right-position of the top symbol on the stack */
-      int right_pos = ((Symbol)stack.peek()).right;
-      int left_pos  = ((Symbol)stack.peek()).left;
+      int right_pos = (stack.peek()).right;
+      int left_pos  = (stack.peek()).left;
 
       /* pop down until we can shift under error Symbol */
       while (!shift_under_error())
@@ -945,7 +945,7 @@
           /* pop the stack */
           if (debug)
             debug_message("# Pop stack by one, state was # " +
-                          ((Symbol)stack.peek()).parse_state);
+                          (stack.peek()).parse_state);
           left_pos = ((Symbol)stack.pop()).left;
           tos--;
 
@@ -958,11 +958,11 @@
         }
 
       /* state on top of the stack can shift under error, find the shift */
-      act = get_action(((Symbol)stack.peek()).parse_state, error_sym());
+      act = get_action((stack.peek()).parse_state, error_sym());
       if (debug)
         {
           debug_message("# Recover state found (#" +
-                        ((Symbol)stack.peek()).parse_state + ")");
+                        (stack.peek()).parse_state + ")");
           debug_message("# Shifting on error to state #" + (act-1));
         }
 
@@ -1145,7 +1145,7 @@
           debug_message("# Reparsing saved input with actions");
           debug_message("# Current Symbol is #" + cur_err_token().sym);
           debug_message("# Current state is #" +
-                        ((Symbol)stack.peek()).parse_state);
+                        (stack.peek()).parse_state);
         }
 
       /* continue until we accept or have read all lookahead input */
@@ -1155,7 +1155,7 @@
 
           /* look up action out of the current state with the current input */
           act =
-            get_action(((Symbol)stack.peek()).parse_state, cur_err_token().sym);
+            get_action((stack.peek()).parse_state, cur_err_token().sym);
 
           /* decode the action -- > 0 encodes shift */
           if (act > 0)
@@ -1205,7 +1205,7 @@
                 }
 
               /* look up the state to go to from the one popped back to */
-              act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
+              act = get_reduce((stack.peek()).parse_state, lhs_sym_num);
 
               /* shift to that state */
               lhs_sym.parse_state = act;
@@ -1234,7 +1234,7 @@
   protected static short[][] unpackFromStrings(String[] sa)
     {
       // Concatanate initialization strings.
-      StringBuffer sb = new StringBuffer(sa[0]);
+      StringBuilder sb = new StringBuilder(sa[0]);
       for (int i=1; i<sa.length; i++)
         sb.append(sa[i]);
       int n=0; // location in initialization string
--- a/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/virtual_parse_stack.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/virtual_parse_stack.java	Wed Oct 18 13:25:49 2017 -0700
@@ -49,7 +49,7 @@
   /*-----------------------------------------------------------*/
 
   /** Constructor to build a virtual stack out of a real stack. */
-  public virtual_parse_stack(Stack shadowing_stack) throws java.lang.Exception
+  public virtual_parse_stack(Stack<Symbol> shadowing_stack) throws java.lang.Exception
     {
       /* sanity check */
       if (shadowing_stack == null)
@@ -58,7 +58,7 @@
 
       /* set up our internals */
       real_stack = shadowing_stack;
-      vstack     = new Stack();
+      vstack     = new Stack<>();
       real_next  = 0;
 
       /* get one element onto the virtual portion of the stack */
@@ -73,7 +73,7 @@
    *  the bottom of the virtual portion of the stack, but is always left
    *  unmodified.
    */
-  protected Stack real_stack;
+  protected Stack<Symbol> real_stack;
 
   /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
 
@@ -91,7 +91,7 @@
    *  on the virtual stack).  When this portion of the stack becomes empty we
    *  transfer elements from the underlying stack onto this stack.
    */
-  protected Stack vstack;
+  protected Stack<Integer> vstack;
 
   /*-----------------------------------------------------------*/
   /*--- General Methods ---------------------------------------*/
@@ -108,7 +108,7 @@
       if (real_next >= real_stack.size()) return;
 
       /* get a copy of the first Symbol we have not transfered */
-      stack_sym = (Symbol)real_stack.elementAt(real_stack.size()-1-real_next);
+      stack_sym = real_stack.get(real_stack.size()-1-real_next);
 
       /* record the transfer */
       real_next++;
@@ -136,7 +136,7 @@
         throw new Exception(
                   "Internal parser error: top() called on empty virtual stack");
 
-      return ((Integer)vstack.peek()).intValue();
+      return (vstack.peek());
     }
 
   /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/ExceptionConst.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/ExceptionConst.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
@@ -73,8 +73,8 @@
     private static final Class<?>[] EXCS_FIELD_AND_METHOD_RESOLUTION = {
             NO_SUCH_FIELD_ERROR, ILLEGAL_ACCESS_ERROR, NO_SUCH_METHOD_ERROR
     }; // Chapter 5.2
-    private static final Class<?>[] EXCS_INTERFACE_METHOD_RESOLUTION = new Class[0]; // Chapter 5.3 (as below)
-    private static final Class<?>[] EXCS_STRING_RESOLUTION = new Class[0];
+    private static final Class<?>[] EXCS_INTERFACE_METHOD_RESOLUTION = new Class<?>[0]; // Chapter 5.3 (as below)
+    private static final Class<?>[] EXCS_STRING_RESOLUTION = new Class<?>[0];
     // Chapter 5.4 (no errors but the ones that _always_ could happen! How stupid.)
     private static final Class<?>[] EXCS_ARRAY_EXCEPTION = {
             NULL_POINTER_EXCEPTION, ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ARRAYLENGTH.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ARRAYLENGTH.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
@@ -43,7 +43,7 @@
      */
     @Override
     public Class<?>[] getExceptions() {
-        return new Class[] {
+        return new Class<?>[] {
             ExceptionConst.NULL_POINTER_EXCEPTION
         };
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ATHROW.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ATHROW.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
@@ -43,7 +43,7 @@
      */
     @Override
     public Class<?>[] getExceptions() {
-        return new Class[] {
+        return new Class<?>[] {
             ExceptionConst.THROWABLE
         };
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/IDIV.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/IDIV.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
@@ -42,7 +42,7 @@
      */
     @Override
     public Class<?>[] getExceptions() {
-        return new Class[] {
+        return new Class<?>[] {
             ExceptionConst.ARITHMETIC_EXCEPTION
         };
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/IREM.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/IREM.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
@@ -42,7 +42,7 @@
      */
     @Override
     public Class<?>[] getExceptions() {
-        return new Class[] {
+        return new Class<?>[] {
             ExceptionConst.ARITHMETIC_EXCEPTION
         };
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDIV.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDIV.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
@@ -39,7 +39,7 @@
 
     @Override
     public Class<?>[] getExceptions() {
-        return new Class[] {
+        return new Class<?>[] {
             ExceptionConst.ARITHMETIC_EXCEPTION
         };
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LREM.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LREM.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
@@ -38,7 +38,7 @@
 
     @Override
     public Class<?>[] getExceptions() {
-        return new Class[] {
+        return new Class<?>[] {
             ExceptionConst.ARITHMETIC_EXCEPTION
         };
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/MONITORENTER.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/MONITORENTER.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
@@ -38,7 +38,7 @@
 
     @Override
     public Class<?>[] getExceptions() {
-        return new Class[] {
+        return new Class<?>[] {
             ExceptionConst.NULL_POINTER_EXCEPTION
         };
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/MONITOREXIT.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/MONITOREXIT.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
@@ -38,7 +38,7 @@
 
     @Override
     public Class<?>[] getExceptions() {
-        return new Class[] {
+        return new Class<?>[] {
             ExceptionConst.NULL_POINTER_EXCEPTION
         };
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/MethodGen.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/MethodGen.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1165,7 +1166,7 @@
             if (attribute instanceof ParameterAnnotations) {
                 // Initialize param_annotations
                 if (!hasParameterAnnotations) {
-                    @SuppressWarnings("unchecked") // OK
+                    @SuppressWarnings({"rawtypes", "unchecked"})
                     final List<AnnotationEntryGen>[] parmList = new List[arg_types.length];
                     param_annotations = parmList;
                     for (int j = 0; j < arg_types.length; j++) {
@@ -1213,7 +1214,7 @@
             final AnnotationEntryGen annotation) {
         ensureExistingParameterAnnotationsUnpacked();
         if (!hasParameterAnnotations) {
-            @SuppressWarnings("unchecked") // OK
+            @SuppressWarnings({"rawtypes", "unchecked"})
             final List<AnnotationEntryGen>[] parmList = new List[arg_types.length];
             param_annotations = parmList;
             hasParameterAnnotations = true;
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/NEWARRAY.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/NEWARRAY.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,12 +21,11 @@
 
 package com.sun.org.apache.bcel.internal.generic;
 
+import com.sun.org.apache.bcel.internal.ExceptionConst;
+import com.sun.org.apache.bcel.internal.util.ByteSequence;
 import java.io.DataOutputStream;
 import java.io.IOException;
 
-import com.sun.org.apache.bcel.internal.ExceptionConst;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
 /**
  * NEWARRAY -  Create new array of basic type (int, short, ...)
  * <PRE>Stack: ..., count -&gt; ..., arrayref</PRE>
@@ -107,7 +106,7 @@
 
     @Override
     public Class<?>[] getExceptions() {
-        return new Class[] {
+        return new Class<?>[] {
             ExceptionConst.NEGATIVE_ARRAY_SIZE_EXCEPTION
         };
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ReturnInstruction.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ReturnInstruction.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
@@ -71,7 +71,7 @@
 
     @Override
     public Class<?>[] getExceptions() {
-        return new Class[] {
+        return new Class<?>[] {
             ExceptionConst.ILLEGAL_MONITOR_STATE
         };
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/InstructionFinder.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/InstructionFinder.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,9 +1,30 @@
 /*
- * 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
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package com.sun.org.apache.bcel.internal.util;
 
+import com.sun.org.apache.bcel.internal.Const;
+import com.sun.org.apache.bcel.internal.generic.ClassGenException;
+import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
+import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -13,11 +34,6 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import com.sun.org.apache.bcel.internal.Const;
-import com.sun.org.apache.bcel.internal.generic.ClassGenException;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-
 /**
  * InstructionFinder is a tool to search for given instructions patterns, i.e.,
  * match sequences of instructions in an instruction list via regular
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java	Wed Oct 18 13:25:49 2017 -0700
@@ -62,7 +62,7 @@
      * @param state the state of the property
      * @param value the value of the property
      */
-    public void setValue(Enum property, State state, String value) {
+    public void setValue(Enum<?> property, State state, String value) {
         //only update if it shall override
         if (state.compareTo(states[property.ordinal()]) >= 0) {
             values[property.ordinal()] = value;
@@ -128,7 +128,7 @@
      * @param property the property
      * @return the value of the property
      */
-    public String getValue(Enum property) {
+    public String getValue(Enum<?> property) {
         return values[property.ordinal()];
     }
 
@@ -195,7 +195,7 @@
      * @param property the property
      * @param systemProperty the name of the system property
      */
-    void getSystemProperty(Enum property, String systemProperty) {
+    void getSystemProperty(Enum<?> property, String systemProperty) {
         try {
             String value = SecuritySupport.getSystemProperty(systemProperty);
             if (value != null) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -124,7 +124,7 @@
     {
         ClassLoader cl = System.getSecurityManager()!=null ? null : findClassLoader();
         try{
-            Class providerClass = findProviderClass(className, cl, doFallback);
+            Class<?> providerClass = findProviderClass(className, cl, doFallback);
             Object instance = providerClass.getConstructor().newInstance();
             debugPrintln(()->"created new instance of " + providerClass +
                              " using ClassLoader: " + cl);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/Translet.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/Translet.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
@@ -43,8 +43,8 @@
     public void buildKeys(DOM document, DTMAxisIterator iterator,
                           SerializationHandler handler, int root)
         throws TransletException;
-    public void addAuxiliaryClass(Class auxClass);
-    public Class getAuxiliaryClass(String className);
+    public void addAuxiliaryClass(Class<?> auxClass);
+    public Class<?> getAuxiliaryClass(String className);
     public String[] getNamesArray();
     public String[] getUrisArray();
     public int[]    getTypesArray();
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,9 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Enumeration;
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@@ -38,7 +36,8 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
 import com.sun.org.apache.xml.internal.utils.XML11Char;
-import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -119,10 +118,10 @@
         final int current = methodGen.getLocalIndex("current");
 
         // check if sorting nodes is required
-        final Vector<Sort> sortObjects = new Vector<>();
+        final List<Sort> sortObjects = new ArrayList<>();
         for (final SyntaxTreeNode child : getContents()) {
             if (child instanceof Sort) {
-                sortObjects.addElement((Sort)child);
+                sortObjects.add((Sort)child);
             }
         }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -34,10 +35,8 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
 import com.sun.org.apache.xml.internal.utils.XML11Char;
-import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Vector;
 
 
 /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,11 +24,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Enumeration;
-import java.util.Vector;
-import java.util.StringTokenizer;
-import java.util.NoSuchElementException;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@@ -41,6 +37,8 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import java.util.Iterator;
 import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.StringTokenizer;
 
 /**
  * @author Jacek Ambroziak
@@ -86,7 +84,7 @@
           */
         String t = null;
         String lookahead = null;
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         int state = OUT_EXPR;
 
         while (tokenizer.hasMoreTokens()) {
@@ -220,7 +218,7 @@
     }
 
     public String toString() {
-        final StringBuffer buffer = new StringBuffer("AVT:[");
+        final StringBuilder buffer = new StringBuilder("AVT:[");
         final int count = elementCount();
         for (int i = 0; i < count; i++) {
             buffer.append(elementAt(i).toString());
@@ -252,7 +250,7 @@
             il.append(new NEW(cpg.addClass(STRING_BUFFER_CLASS)));
             il.append(DUP);
             il.append(new INVOKESPECIAL(initBuffer));
-            // StringBuffer is on the stack
+            // StringBuilder is on the stack
             final Iterator<SyntaxTreeNode> elements = elements();
             while (elements.hasNext()) {
                 final Expression exp = (Expression)elements.next();
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.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
@@ -83,11 +83,11 @@
                                               new MethodType(Type.Void,
                                                              tleft, tright));
         if (ptype != null) {
-            final Type arg1 = (Type) ptype.argsType().elementAt(0);
+            final Type arg1 = (Type) ptype.argsType().get(0);
             if (!arg1.identicalTo(tleft)) {
                 _left = new CastExpr(_left, arg1);
             }
-            final Type arg2 = (Type) ptype.argsType().elementAt(1);
+            final Type arg2 = (Type) ptype.argsType().get(1);
             if (!arg2.identicalTo(tright)) {
                 _right = new CastExpr(_right, arg1);
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanCall.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,12 +21,11 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -36,7 +35,7 @@
 
     private Expression _arg = null;
 
-    public BooleanCall(QName fname, Vector arguments) {
+    public BooleanCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
         _arg = argument(0);
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/CallTemplate.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/CallTemplate.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -30,8 +31,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
 import com.sun.org.apache.xml.internal.utils.XML11Char;
-
-import java.util.Vector;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -205,11 +205,11 @@
     private void buildParameterList() {
         // Put the parameters from the called template into the array first.
         // This is to ensure the order of the parameters.
-        Vector<Param> defaultParams = _calleeTemplate.getParameters();
+        List<Param> defaultParams = _calleeTemplate.getParameters();
         int numParams = defaultParams.size();
         _parameters = new SyntaxTreeNode[numParams];
         for (int i = 0; i < numParams; i++) {
-            _parameters[i] = defaultParams.elementAt(i);
+            _parameters[i] = defaultParams.get(i);
         }
 
         // Replace a Param with a WithParam if they have the same name.
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/CastCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/CastCall.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,17 +21,16 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
+import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ObjectType;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ObjectType;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Santiago Pericas-Geertsen
@@ -52,7 +51,7 @@
     /**
      * Constructor.
      */
-    public CastCall(QName fname, Vector arguments) {
+    public CastCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/CeilingCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/CeilingCall.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,20 +21,19 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
  * @author Santiago Pericas-Geertsen
  */
 final class CeilingCall extends FunctionCall {
-    public CeilingCall(QName fname, Vector arguments) {
+    public CeilingCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,9 +24,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Enumeration;
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.BranchHandle;
 import com.sun.org.apache.bcel.internal.generic.GOTO;
 import com.sun.org.apache.bcel.internal.generic.IFEQ;
@@ -37,7 +35,11 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
 import java.util.Iterator;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -61,7 +63,7 @@
      * <xsl:when> elements and default to the <xsl:otherwise> if present.
      */
     public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-        final Vector whenElements = new Vector();
+        final List<SyntaxTreeNode> whenElements = new ArrayList<>();
         Otherwise otherwise = null;
         Iterator<SyntaxTreeNode> elements = elements();
 
@@ -74,7 +76,7 @@
             SyntaxTreeNode element = elements.next();
             // Add a When child element
             if (element instanceof When) {
-                whenElements.addElement(element);
+                whenElements.add(element);
             }
             // Add an Otherwise child element
             else if (element instanceof Otherwise) {
@@ -108,10 +110,10 @@
         // next element will hold a handle to the beginning of next
         // When/Otherwise if test on current When fails
         BranchHandle nextElement = null;
-        Vector exitHandles = new Vector();
+        List<InstructionHandle> exitHandles = new ArrayList<>();
         InstructionHandle exit = null;
 
-        Enumeration whens = whenElements.elements();
+        Enumeration<SyntaxTreeNode> whens = Collections.enumeration(whenElements);
         while (whens.hasMoreElements()) {
             final When when = (When)whens.nextElement();
             final Expression test = when.getTest();
@@ -142,7 +144,7 @@
             if (!when.ignore()) when.translateContents(classGen, methodGen);
 
             // goto exit after executing the body of when
-            exitHandles.addElement(il.append(new GOTO(null)));
+            exitHandles.add(il.append(new GOTO(null)));
             if (whens.hasMoreElements() || otherwise != null) {
                 nextElement = il.append(new GOTO(null));
                 test.backPatchFalseList(nextElement);
@@ -160,7 +162,7 @@
         }
 
         // now that end is known set targets of exit gotos
-        Enumeration exitGotos = exitHandles.elements();
+        Enumeration<InstructionHandle> exitGotos = Collections.enumeration(exitHandles);
         while (exitGotos.hasMoreElements()) {
             BranchHandle gotoExit = (BranchHandle)exitGotos.nextElement();
             gotoExit.setTarget(exit);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ConcatCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ConcatCall.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@@ -34,13 +32,14 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
  * @author Santiago Pericas-Geertsen
  */
 final class ConcatCall extends FunctionCall {
-    public ConcatCall(QName fname, Vector arguments) {
+    public ConcatCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ContainsCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ContainsCall.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.IFLT;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@@ -32,6 +30,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -46,7 +45,7 @@
     /**
      * Create a contains() call - two arguments, both strings
      */
-    public ContainsCall(QName fname, Vector arguments) {
+    public ContainsCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.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,11 +21,8 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.bcel.internal.generic.PUSH;
@@ -34,6 +31,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -48,7 +46,7 @@
     /**
      * Default function call constructor
      */
-    public DocumentCall(QName fname, Vector arguments) {
+    public DocumentCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ElementAvailableCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ElementAvailableCall.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.PUSH;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
@@ -30,6 +28,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -37,7 +36,7 @@
  */
 final class ElementAvailableCall extends FunctionCall {
 
-    public ElementAvailableCall(QName fname, Vector arguments) {
+    public ElementAvailableCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Expression.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Expression.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.BranchHandle;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.GOTO_W;
@@ -37,6 +35,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -193,12 +192,12 @@
     public MethodType lookupPrimop(SymbolTable stable, String op,
                                    MethodType ctype) {
         MethodType result = null;
-        final Vector primop = stable.lookupPrimop(op);
+        final List<MethodType> primop = stable.lookupPrimop(op);
         if (primop != null) {
             final int n = primop.size();
             int minDistance = Integer.MAX_VALUE;
             for (int i = 0; i < n; i++) {
-                final MethodType ptype = (MethodType) primop.elementAt(i);
+                final MethodType ptype = primop.get(i);
                 // Skip if different arity
                 if (ptype.argsCount() != ctype.argsCount()) {
                     continue;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.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,17 +21,13 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ALOAD;
 import com.sun.org.apache.bcel.internal.generic.ASTORE;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
+import com.sun.org.apache.bcel.internal.generic.ISTORE;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
 import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
 import com.sun.org.apache.bcel.internal.generic.NEW;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
@@ -41,6 +37,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -57,9 +54,9 @@
     /**
      * Array of predicates in '(e)[p1]...[pn]'.
      */
-    private final Vector _predicates;
+    private final List<Expression> _predicates;
 
-    public FilterExpr(Expression primary, Vector predicates) {
+    public FilterExpr(Expression primary, List<Expression> predicates) {
         _primary = primary;
         _predicates = predicates;
         primary.setParent(this);
@@ -78,7 +75,7 @@
         if (_predicates != null) {
             final int n = _predicates.size();
             for (int i = 0; i < n; i++) {
-                final Expression exp = (Expression)_predicates.elementAt(i);
+                final Expression exp = (Expression)_predicates.get(i);
                 exp.setParser(parser);
                 exp.setParent(this);
             }
@@ -112,7 +109,7 @@
         // Type check predicates and turn all optimizations off if appropriate
         int n = _predicates.size();
         for (int i = 0; i < n; i++) {
-            Predicate pred = (Predicate) _predicates.elementAt(i);
+            Predicate pred = (Predicate) _predicates.get(i);
 
             if (!canOptimize) {
                 pred.dontOptimize();
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FloorCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FloorCall.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,18 +21,17 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
  * @author Santiago Pericas-Geertsen
  */
 final class FloorCall extends FunctionCall {
-    public FloorCall(QName fname, Vector arguments) {
+    public FloorCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FlowList.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FlowList.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,27 +21,27 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Iterator;
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.BranchHandle;
 import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
  * @author Santiago Pericas-Geertsen
  */
 public final class FlowList {
-    private Vector _elements;
+    private List<InstructionHandle> _elements;
 
     public FlowList() {
         _elements = null;
     }
 
     public FlowList(InstructionHandle bh) {
-        _elements = new Vector();
-        _elements.addElement(bh);
+        _elements = new ArrayList<>();
+        _elements.add(bh);
     }
 
     public FlowList(FlowList list) {
@@ -50,9 +50,9 @@
 
     public FlowList add(InstructionHandle bh) {
         if (_elements == null) {
-            _elements = new Vector();
+            _elements = new ArrayList<>();
         }
-        _elements.addElement(bh);
+        _elements.add(bh);
         return this;
     }
 
@@ -61,11 +61,11 @@
             _elements = right._elements;
         }
         else {
-            final Vector temp = right._elements;
+            final List<InstructionHandle> temp = right._elements;
             if (temp != null) {
                 final int n = temp.size();
                 for (int i = 0; i < n; i++) {
-                    _elements.addElement(temp.elementAt(i));
+                    _elements.add(temp.get(i));
                 }
             }
         }
@@ -79,7 +79,7 @@
         if (_elements != null) {
             final int n = _elements.size();
             for (int i = 0; i < n; i++) {
-                BranchHandle bh = (BranchHandle)_elements.elementAt(i);
+                BranchHandle bh = (BranchHandle)_elements.get(i);
                 bh.setTarget(target);
             }
             _elements.clear();          // avoid backpatching more than once
@@ -99,15 +99,15 @@
         }
 
         final int n = _elements.size();
-        final Iterator oldIter = oldList.iterator();
-        final Iterator newIter = newList.iterator();
+        final Iterator<InstructionHandle> oldIter = oldList.iterator();
+        final Iterator<InstructionHandle> newIter = newList.iterator();
 
         while (oldIter.hasNext()) {
-            final InstructionHandle oldIh = (InstructionHandle) oldIter.next();
-            final InstructionHandle newIh = (InstructionHandle) newIter.next();
+            final InstructionHandle oldIh = oldIter.next();
+            final InstructionHandle newIh = newIter.next();
 
             for (int i = 0; i < n; i++) {
-                if (_elements.elementAt(i) == oldIh) {
+                if (_elements.get(i) == oldIh) {
                     result.add(newIh);
                 }
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,9 +24,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Enumeration;
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.BranchHandle;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.GOTO;
@@ -42,7 +40,9 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -97,12 +97,12 @@
         il.append(methodGen.loadIterator());
 
         // Collect sort objects associated with this instruction
-        final Vector sortObjects = new Vector();
+        final List<Sort> sortObjects = new ArrayList<>();
         Iterator<SyntaxTreeNode> children = elements();
         while (children.hasNext()) {
-            final Object child = children.next();
+            final SyntaxTreeNode child = children.next();
             if (child instanceof Sort) {
-                sortObjects.addElement(child);
+                sortObjects.add((Sort)child);
             }
         }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FormatNumberCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FormatNumberCall.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@@ -34,6 +32,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -46,7 +45,7 @@
     private Expression _name;
     private QName      _resolvedQName = null;
 
-    public FormatNumberCall(QName fname, Vector arguments) {
+    public FormatNumberCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
         _value = argument(0);
         _format = argument(1);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.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,18 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.PUSH;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.List;
 
 /**
  * @author G. Todd Miller
@@ -52,9 +51,9 @@
      * a list of arguments where the arguments must be instances of
      * LiteralExpression.
      */
-    public FunctionAvailableCall(QName fname, Vector arguments) {
+    public FunctionAvailableCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
-        _arg = (Expression)arguments.elementAt(0);
+        _arg = (Expression)arguments.get(0);
         _type = null;
 
         if (_arg instanceof LiteralExpr) {
@@ -131,7 +130,7 @@
           methodName = replaceDash(methodName);
 
         try {
-            final Class clazz = ObjectFactory.findProviderClass(className, true);
+            final Class<?> clazz = ObjectFactory.findProviderClass(className, true);
 
             if (clazz == null) {
                 return false;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -48,12 +49,12 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Vector;
 import jdk.xml.internal.JdkXmlFeatures;
 
 /**
@@ -68,9 +69,9 @@
     // Name of this function call
     private QName  _fname;
     // Arguments to this function call (might not be any)
-    private final Vector _arguments;
+    private final List<Expression> _arguments;
     // Empty argument list, used for certain functions
-    private final static Vector EMPTY_ARG_LIST = new Vector(0);
+    private final static List<Expression> EMPTY_ARG_LIST = new ArrayList<>(0);
 
     // Valid namespaces for Java function-call extension
     protected final static String EXT_XSLTC =
@@ -122,9 +123,9 @@
 
     // External Java function's class/method/signature
     private String      _className;
-    private Class       _clazz;
+    private Class<?>    _clazz;
     private Method      _chosenMethod;
-    private Constructor _chosenConstructor;
+    private Constructor<?> _chosenConstructor;
     private MethodType  _chosenMethodType;
 
     // Encapsulates all unsupported external function calls
@@ -156,7 +157,7 @@
         public Class<?>  type;
         public int distance;
 
-        public JavaType(Class type, int distance){
+        public JavaType(Class<?> type, int distance){
             this.type = type;
             this.distance = distance;
         }
@@ -294,7 +295,7 @@
 
     }
 
-    public FunctionCall(QName fname, Vector arguments) {
+    public FunctionCall(QName fname, List<Expression> arguments) {
         _fname = fname;
         _arguments = arguments;
         _type = null;
@@ -314,7 +315,7 @@
         if (_arguments != null) {
             final int n = _arguments.size();
             for (int i = 0; i < n; i++) {
-                final Expression exp = (Expression)_arguments.elementAt(i);
+                final Expression exp = _arguments.get(i);
                 exp.setParser(parser);
                 exp.setParent(this);
             }
@@ -435,18 +436,18 @@
         _fname.clearNamespace();        // HACK!!!
 
         final int n = _arguments.size();
-        final Vector argsType = typeCheckArgs(stable);
+        final List<Type> argsType = typeCheckArgs(stable);
         final MethodType args = new MethodType(Type.Void, argsType);
         final MethodType ptype =
             lookupPrimop(stable, _fname.getLocalPart(), args);
 
         if (ptype != null) {
             for (int i = 0; i < n; i++) {
-                final Type argType = (Type) ptype.argsType().elementAt(i);
-                final Expression exp = (Expression)_arguments.elementAt(i);
+                final Type argType = (Type) ptype.argsType().get(i);
+                final Expression exp = _arguments.get(i);
                 if (!argType.identicalTo(exp.getType())) {
                     try {
-                        _arguments.setElementAt(new CastExpr(exp, argType), i);
+                        _arguments.set(i, new CastExpr(exp, argType));
                     }
                     catch (TypeCheckError e) {
                         throw new TypeCheckError(this); // invalid conversion
@@ -462,7 +463,7 @@
 
 
     public Type typeCheckConstructor(SymbolTable stable) throws TypeCheckError{
-        final Vector constructors = findConstructors();
+        final List<Constructor<?>> constructors = findConstructors();
         if (constructors == null) {
             // Constructor not found in this class
             throw new TypeCheckError(ErrorMsg.CONSTRUCTOR_NOT_FOUND,
@@ -472,23 +473,22 @@
 
         final int nConstructors = constructors.size();
         final int nArgs = _arguments.size();
-        final Vector argsType = typeCheckArgs(stable);
+        final List<Type> argsType = typeCheckArgs(stable);
 
         // Try all constructors
         int bestConstrDistance = Integer.MAX_VALUE;
         _type = null;                   // reset
         for (int j, i = 0; i < nConstructors; i++) {
             // Check if all parameters to this constructor can be converted
-            final Constructor constructor =
-                (Constructor)constructors.elementAt(i);
-            final Class[] paramTypes = constructor.getParameterTypes();
+            final Constructor<?> constructor = constructors.get(i);
+            final Class<?>[] paramTypes = constructor.getParameterTypes();
 
             Class<?> extType;
             int currConstrDistance = 0;
             for (j = 0; j < nArgs; j++) {
                 // Convert from internal (translet) type to external (Java) type
                 extType = paramTypes[j];
-                final Type intType = (Type)argsType.elementAt(j);
+                final Type intType = argsType.get(j);
                 JavaType match = _internal2Java.maps(intType, new JavaType(extType, 0));
                 if (match != null) {
                     currConstrDistance += match.distance;
@@ -556,7 +556,7 @@
                     || _namespace_format == NAMESPACE_FORMAT_PACKAGE)
                     hasThisArgument = true;
 
-                Expression firstArg = (Expression)_arguments.elementAt(0);
+                Expression firstArg = _arguments.get(0);
                 Type firstArgType = (Type)firstArg.typeCheck(stable);
 
                 if (_namespace_format == NAMESPACE_FORMAT_CLASS
@@ -566,7 +566,7 @@
                     hasThisArgument = true;
 
                 if (hasThisArgument) {
-                    _thisArgument = (Expression) _arguments.elementAt(0);
+                    _thisArgument = _arguments.get(0);
                     _arguments.remove(0); nArgs--;
                     if (firstArgType instanceof ObjectType) {
                         _className = ((ObjectType) firstArgType).getJavaClassName();
@@ -592,30 +592,30 @@
             }
         }
 
-        final Vector methods = findMethods();
+        final List<Method> methods = findMethods();
 
         if (methods == null) {
             // Method not found in this class
             throw new TypeCheckError(ErrorMsg.METHOD_NOT_FOUND_ERR, _className + "." + name);
         }
 
-        Class extType = null;
+        Class<?> extType = null;
         final int nMethods = methods.size();
-        final Vector argsType = typeCheckArgs(stable);
+        final List<Type> argsType = typeCheckArgs(stable);
 
         // Try all methods to identify the best fit
         int bestMethodDistance  = Integer.MAX_VALUE;
         _type = null;                       // reset internal type
         for (int j, i = 0; i < nMethods; i++) {
             // Check if all paramteters to this method can be converted
-            final Method method = (Method)methods.elementAt(i);
-            final Class[] paramTypes = method.getParameterTypes();
+            final Method method = (Method)methods.get(i);
+            final Class<?>[] paramTypes = method.getParameterTypes();
 
             int currMethodDistance = 0;
             for (j = 0; j < nArgs; j++) {
                 // Convert from internal (translet) type to external (Java) type
                 extType = paramTypes[j];
-                final Type intType = (Type)argsType.elementAt(j);
+                final Type intType = argsType.get(j);
                 JavaType match = _internal2Java.maps(intType, new JavaType(extType, 0));
                 if (match != null) {
                     currMethodDistance += match.distance;
@@ -683,18 +683,16 @@
     /**
      * Type check the actual arguments of this function call.
      */
-    public Vector typeCheckArgs(SymbolTable stable) throws TypeCheckError {
-        final Vector result = new Vector();
-        final Enumeration e = _arguments.elements();
-        while (e.hasMoreElements()) {
-            final Expression exp = (Expression)e.nextElement();
-            result.addElement(exp.typeCheck(stable));
+    public List<Type> typeCheckArgs(SymbolTable stable) throws TypeCheckError {
+        final List<Type> result = new ArrayList<>();
+        for (Expression exp : _arguments) {
+            result.add(exp.typeCheck(stable));
         }
         return result;
     }
 
     protected final Expression argument(int i) {
-        return (Expression)_arguments.elementAt(i);
+        return _arguments.get(i);
     }
 
     protected final Expression argument() {
@@ -706,7 +704,7 @@
     }
 
     protected final void setArgument(int i, Expression exp) {
-        _arguments.setElementAt(exp, i);
+        _arguments.set(i, exp);
     }
 
     /**
@@ -795,7 +793,7 @@
             //   <TransletClass>.class.getModule().addReads(
             generateAddReads(classGen, methodGen, clazz);
 
-            Class[] paramTypes = _chosenConstructor.getParameterTypes();
+            Class<?>[] paramTypes = _chosenConstructor.getParameterTypes();
             LocalVariableGen[] paramTemp = new LocalVariableGen[n];
 
             // Backwards branches are prohibited if an uninitialized object is
@@ -856,7 +854,7 @@
                 translateUnallowedExtension(cpg, il);
 
             final String clazz = _chosenMethod.getDeclaringClass().getName();
-            Class[] paramTypes = _chosenMethod.getParameterTypes();
+            Class<?>[] paramTypes = _chosenMethod.getParameterTypes();
 
 
             // Generate call to Module.addReads:
@@ -960,9 +958,9 @@
      * after stripping its namespace or <code>null</code>
      * if no such methods exist.
      */
-    private Vector findMethods() {
+    private List<Method> findMethods() {
 
-          Vector result = null;
+          List<Method> result = null;
           final String namespace = _fname.getNamespace();
 
           if (_className != null && _className.length() > 0) {
@@ -1003,9 +1001,9 @@
                     && methods[i].getParameterTypes().length == nArgs)
                 {
                   if (result == null) {
-                    result = new Vector();
+                    result = new ArrayList<>();
                   }
-                  result.addElement(methods[i]);
+                  result.add(methods[i]);
                 }
               }
             }
@@ -1022,9 +1020,8 @@
      * after stripping its namespace or <code>null</code>
      * if no such methods exist.
      */
-    private Vector findConstructors() {
-        Vector result = null;
-        final String namespace = _fname.getNamespace();
+    private List<Constructor<?>> findConstructors() {
+        List<Constructor<?>> result = null;
 
         final int nArgs = _arguments.size();
         try {
@@ -1037,20 +1034,17 @@
             }
           }
 
-          final Constructor[] constructors = _clazz.getConstructors();
+          final Constructor<?>[] constructors = _clazz.getConstructors();
 
-          for (int i = 0; i < constructors.length; i++) {
-              final int mods = constructors[i].getModifiers();
-              // Is it public, static and same number of args ?
-              if (Modifier.isPublic(mods) &&
-                  constructors[i].getParameterTypes().length == nArgs)
-              {
-                if (result == null) {
-                  result = new Vector();
+            for (Constructor<?> constructor : constructors) {
+                final int mods = constructor.getModifiers();
+                // Is it public, static and same number of args ?
+                if (Modifier.isPublic(mods) && constructor.getParameterTypes().length == nArgs) {
+                    if (result == null) {
+                        result = new ArrayList<>();
+                    }   result.add(constructor);
                 }
-                result.addElement(constructors[i]);
-              }
-          }
+            }
         }
         catch (ClassNotFoundException e) {
           final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
@@ -1064,10 +1058,10 @@
     /**
      * Compute the JVM signature for the class.
      */
-    static final String getSignature(Class clazz) {
+    static final String getSignature(Class<?> clazz) {
         if (clazz.isArray()) {
             final StringBuffer sb = new StringBuffer();
-            Class cl = clazz;
+            Class<?> cl = clazz;
             while (cl.isArray()) {
                 sb.append("[");
                 cl = cl.getComponentType();
@@ -1120,7 +1114,7 @@
     static final String getSignature(Method meth) {
         final StringBuffer sb = new StringBuffer();
         sb.append('(');
-        final Class[] params = meth.getParameterTypes(); // avoid clone
+        final Class<?>[] params = meth.getParameterTypes(); // avoid clone
         for (int j = 0; j < params.length; j++) {
             sb.append(getSignature(params[j]));
         }
@@ -1131,10 +1125,10 @@
     /**
      * Compute the JVM constructor descriptor for the constructor.
      */
-    static final String getSignature(Constructor cons) {
+    static final String getSignature(Constructor<?> cons) {
         final StringBuffer sb = new StringBuffer();
         sb.append('(');
-        final Class[] params = cons.getParameterTypes(); // avoid clone
+        final Class<?>[] params = cons.getParameterTypes(); // avoid clone
         for (int j = 0; j < params.length; j++) {
             sb.append(getSignature(params[j]));
         }
@@ -1144,13 +1138,13 @@
     /**
      * Return the signature of the current method
      */
-    private String getMethodSignature(Vector argsType) {
+    private String getMethodSignature(List<Type> argsType) {
         final StringBuffer buf = new StringBuffer(_className);
         buf.append('.').append(_fname.getLocalPart()).append('(');
 
         int nArgs = argsType.size();
         for (int i = 0; i < nArgs; i++) {
-            final Type intType = (Type)argsType.elementAt(i);
+            final Type intType = argsType.get(i);
             buf.append(intType.toString());
             if (i < nArgs - 1) buf.append(", ");
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/GenerateIdCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/GenerateIdCall.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,20 +21,19 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
  * @author Santiago Pericas-Geertsen
  */
 final class GenerateIdCall extends FunctionCall {
-    public GenerateIdCall(QName fname, Vector arguments) {
+    public GenerateIdCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,8 +24,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.BranchHandle;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.GOTO;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyCall.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,28 +21,16 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFGT;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
 import com.sun.org.apache.bcel.internal.generic.PUSH;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.List;
 
 /**
  * @author Morten Jorgensen
@@ -82,7 +70,7 @@
      * @param fname The function name (should be 'key' or 'id')
      * @param arguments A vector containing the arguments the the function
      */
-    public KeyCall(QName fname, Vector arguments) {
+    public KeyCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
         switch(argumentCount()) {
         case 1:
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LangCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LangCall.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.ILOAD;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
@@ -33,6 +31,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Morten Jorgensen
@@ -45,7 +44,7 @@
      * Get the parameters passed to function:
      *   lang(string)
      */
-    public LangCall(QName fname, Vector arguments) {
+    public LangCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
         _lang = argument(0);
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -102,6 +103,7 @@
 
         // Check if we have any declared namespaces
         if (_accessedPrefixes == null) {
+            // use Hashtable for behavior compatibility
             _accessedPrefixes = new Hashtable<>();
         }
         else {
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LocalNameCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LocalNameCall.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,14 +21,13 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
+import java.util.List;
 
 /**
  * @author Morten Jorgensen
@@ -45,7 +44,7 @@
     /**
      * Handles calls with one parameter (either node or node-set).
      */
-    public LocalNameCall(QName fname, Vector arguments) {
+    public LocalNameCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.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
@@ -137,11 +137,11 @@
         // Yes, the operation is supported
         if (haveType != null) {
             // Check if left-hand side operand must be type casted
-            Type arg1 = (Type)haveType.argsType().elementAt(0);
+            Type arg1 = (Type)haveType.argsType().get(0);
             if (!arg1.identicalTo(tleft))
                 _left = new CastExpr(_left, arg1);
             // Check if right-hand side operand must be type casted
-            Type arg2 = (Type) haveType.argsType().elementAt(1);
+            Type arg2 = (Type) haveType.argsType().get(1);
             if (!arg2.identicalTo(tright))
                 _right = new CastExpr(_right, arg1);
             // Return the result type for the operator we will use
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -46,12 +47,12 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
 import com.sun.org.apache.xml.internal.dtm.Axis;
 import com.sun.org.apache.xml.internal.dtm.DTM;
-import java.util.Enumeration;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.Vector;
 
 /**
  * Mode gathers all the templates belonging to a given mode;
@@ -83,12 +84,12 @@
     /**
      * A vector of all the templates in this mode.
      */
-    private Vector _templates;
+    private List<Template> _templates;
 
     /**
      * Group for patterns with node()-type kernel and child axis.
      */
-    private Vector _childNodeGroup = null;
+    private List<LocationPathPattern> _childNodeGroup = null;
 
     /**
      * Test sequence for patterns with node()-type kernel and child axis.
@@ -98,7 +99,7 @@
     /**
      * Group for patterns with node()-type kernel and attribute axis.
      */
-    private Vector _attribNodeGroup = null;
+    private List<LocationPathPattern> _attribNodeGroup = null;
 
     /**
      * Test sequence for patterns with node()-type kernel and attribute axis.
@@ -108,7 +109,7 @@
     /**
      * Group for patterns with id() or key()-type kernel.
      */
-    private Vector _idxGroup = null;
+    private List<LocationPathPattern> _idxGroup = null;
 
     /**
      * Test sequence for patterns with id() or key()-type kernel.
@@ -118,7 +119,7 @@
     /**
      * Group for patterns with any other kernel type.
      */
-    private Vector[] _patternGroups;
+    private List<LocationPathPattern>[] _patternGroups;
 
     /**
      * Test sequence for patterns with any other kernel type.
@@ -175,12 +176,13 @@
      * @param suffix A suffix to append to the method name for this mode
      *               (normally a sequence number - still in a String).
      */
+    @SuppressWarnings({"rawtypes", "unchecked"})
     public Mode(QName name, Stylesheet stylesheet, String suffix) {
         _name = name;
         _stylesheet = stylesheet;
         _methodName = APPLY_TEMPLATES + suffix;
-        _templates = new Vector();
-        _patternGroups = new Vector[32];
+        _templates = new ArrayList<>();
+        _patternGroups = (List<LocationPathPattern>[])new ArrayList[32];
     }
 
     /**
@@ -214,10 +216,10 @@
     }
 
     public void addTemplate(Template template) {
-        _templates.addElement(template);
+        _templates.add(template);
     }
 
-    private Vector quicksort(Vector templates, int p, int r) {
+    private List<Template> quicksort(List<Template> templates, int p, int r) {
         if (p < r) {
             final int q = partition(templates, p, r);
             quicksort(templates, p, q);
@@ -226,15 +228,15 @@
         return templates;
     }
 
-    private int partition(Vector templates, int p, int r) {
-        final Template x = (Template)templates.elementAt(p);
+    private int partition(List<Template> templates, int p, int r) {
+        final Template x = (Template)templates.get(p);
         int i = p - 1;
         int j = r + 1;
         while (true) {
-            while (x.compareTo((Template)templates.elementAt(--j)) > 0);
-            while (x.compareTo((Template)templates.elementAt(++i)) < 0);
+            while (x.compareTo((Template)templates.get(--j)) > 0);
+            while (x.compareTo((Template)templates.get(++i)) < 0);
             if (i < j) {
-                templates.set(j, templates.set(i, templates.elementAt(j)));
+                templates.set(j, templates.set(i, templates.get(j)));
             }
             else {
                 return j;
@@ -247,35 +249,10 @@
      */
     public void processPatterns(Map<String, Key> keys) {
         _keys = keys;
-
-/*
-System.out.println("Before Sort " + _name);
-for (int i = 0; i < _templates.size(); i++) {
-    System.out.println("name = " + ((Template)_templates.elementAt(i)).getName());
-    System.out.println("pattern = " + ((Template)_templates.elementAt(i)).getPattern());
-    System.out.println("priority = " + ((Template)_templates.elementAt(i)).getPriority());
-    System.out.println("position = " + ((Template)_templates.elementAt(i)).getPosition());
-}
-*/
-
         _templates = quicksort(_templates, 0, _templates.size() - 1);
 
-/*
-System.out.println("\n After Sort " + _name);
-for (int i = 0; i < _templates.size(); i++) {
-    System.out.println("name = " + ((Template)_templates.elementAt(i)).getName());
-    System.out.println("pattern = " + ((Template)_templates.elementAt(i)).getPattern());
-    System.out.println("priority = " + ((Template)_templates.elementAt(i)).getPriority());
-    System.out.println("position = " + ((Template)_templates.elementAt(i)).getPosition());
-}
-*/
-
         // Traverse all templates
-        final Enumeration templates = _templates.elements();
-        while (templates.hasMoreElements()) {
-            // Get the next template
-            final Template template = (Template)templates.nextElement();
-
+        for (Template template : _templates) {
             /*
              * Add this template to a table of named templates if it has a name.
              * If there are multiple templates with the same name, all but one
@@ -308,8 +285,8 @@
         if (pattern instanceof IdKeyPattern) {
             final IdKeyPattern idkey = (IdKeyPattern)pattern;
             idkey.setTemplate(template);
-            if (_idxGroup == null) _idxGroup = new Vector();
-            _idxGroup.add(pattern);
+            if (_idxGroup == null) _idxGroup = new ArrayList<>();
+            _idxGroup.add((IdKeyPattern)pattern);
         }
         // Alternative patterns are broken up and re-processed recursively
         else if (pattern instanceof AlternativePattern) {
@@ -355,47 +332,50 @@
         // Make sure the array of pattern groups is long enough
         final int oldLength = _patternGroups.length;
         if (kernelType >= oldLength) {
-            Vector[] newGroups = new Vector[kernelType * 2];
+            @SuppressWarnings({"rawtypes", "unchecked"})
+            List<LocationPathPattern>[] newGroups =
+                    (List<LocationPathPattern>[])new ArrayList[kernelType * 2];
+
             System.arraycopy(_patternGroups, 0, newGroups, 0, oldLength);
             _patternGroups = newGroups;
         }
 
         // Find the vector to put this pattern into
-        Vector patterns;
+        List<LocationPathPattern> patterns;
 
         if (kernelType == DOM.NO_TYPE) {
             if (pattern.getAxis() == Axis.ATTRIBUTE) {
                 patterns = (_attribNodeGroup == null) ?
-                    (_attribNodeGroup = new Vector(2)) : _attribNodeGroup;
+                    (_attribNodeGroup = new ArrayList<>(2)) : _attribNodeGroup;
             }
             else {
                 patterns = (_childNodeGroup == null) ?
-                    (_childNodeGroup = new Vector(2)) : _childNodeGroup;
+                    (_childNodeGroup = new ArrayList<>(2)) : _childNodeGroup;
             }
         }
         else {
             patterns = (_patternGroups[kernelType] == null) ?
-                (_patternGroups[kernelType] = new Vector(2)) :
+                (_patternGroups[kernelType] = new ArrayList<>(2)) :
                 _patternGroups[kernelType];
         }
 
         if (patterns.size() == 0) {
-            patterns.addElement(pattern);
+            patterns.add(pattern);
         }
         else {
             boolean inserted = false;
             for (int i = 0; i < patterns.size(); i++) {
                 final LocationPathPattern lppToCompare =
-                    (LocationPathPattern)patterns.elementAt(i);
+                    (LocationPathPattern)patterns.get(i);
 
                 if (pattern.noSmallerThan(lppToCompare)) {
                     inserted = true;
-                    patterns.insertElementAt(pattern, i);
+                    patterns.add(i, pattern);
                     break;
                 }
             }
             if (inserted == false) {
-                patterns.addElement(pattern);
+                patterns.add(pattern);
             }
         }
     }
@@ -404,7 +384,7 @@
      * Complete test sequences of a given type by adding all patterns
      * from a given group.
      */
-    private void completeTestSequences(int nodeType, Vector patterns) {
+    private void completeTestSequences(int nodeType, List<LocationPathPattern> patterns) {
         if (patterns != null) {
             if (_patternGroups[nodeType] == null) {
                 _patternGroups[nodeType] = patterns;
@@ -412,8 +392,7 @@
             else {
                 final int m = patterns.size();
                 for (int j = 0; j < m; j++) {
-                    addPattern(nodeType,
-                        (LocationPathPattern) patterns.elementAt(j));
+                    addPattern(nodeType, patterns.get(j));
                 }
             }
         }
@@ -425,8 +404,8 @@
      * sequences, and of "@*" to all attribute test sequences.
      */
     private void prepareTestSequences() {
-        final Vector starGroup = _patternGroups[DTM.ELEMENT_NODE];
-        final Vector atStarGroup = _patternGroups[DTM.ATTRIBUTE_NODE];
+        final List<LocationPathPattern> starGroup = _patternGroups[DTM.ELEMENT_NODE];
+        final List<LocationPathPattern> atStarGroup = _patternGroups[DTM.ATTRIBUTE_NODE];
 
         // Complete test sequence for "text()" with "child::node()"
         completeTestSequences(DTM.TEXT_NODE, _childNodeGroup);
@@ -443,7 +422,7 @@
         // Complete test sequence for "@*" with "attribute::node()"
         completeTestSequences(DTM.ATTRIBUTE_NODE, _attribNodeGroup);
 
-        final Vector names = _stylesheet.getXSLTC().getNamesIndex();
+        final List<String> names = _stylesheet.getXSLTC().getNamesIndex();
         if (starGroup != null || atStarGroup != null ||
             _childNodeGroup != null || _attribNodeGroup != null)
         {
@@ -453,7 +432,7 @@
             for (int i = DTM.NTYPES; i < n; i++) {
                 if (_patternGroups[i] == null) continue;
 
-                final String name = (String) names.elementAt(i - DTM.NTYPES);
+                final String name = names.get(i - DTM.NTYPES);
 
                 if (isAttributeName(name)) {
                     // If an attribute then copy "@*" to its test sequence
@@ -476,7 +455,7 @@
 
         final int n = _patternGroups.length;
         for (int i = 0; i < n; i++) {
-            final Vector patterns = _patternGroups[i];
+            final List<LocationPathPattern> patterns = _patternGroups[i];
             if (patterns != null) {
                 final TestSeq testSeq = new TestSeq(patterns, i, this);
 // System.out.println("testSeq[" + i + "] = " + testSeq);
@@ -520,7 +499,7 @@
 
         int numParams = 0;
         if (template.isSimpleNamedTemplate()) {
-            Vector parameters = template.getParameters();
+            List<Param> parameters = template.getParameters();
             numParams = parameters.size();
         }
 
@@ -676,8 +655,8 @@
         final ConstantPoolGen cpg = classGen.getConstantPool();
 
         // Append switch() statement - namespace test dispatch loop
-        final Vector namespaces = xsltc.getNamespaceIndex();
-        final Vector names = xsltc.getNamesIndex();
+        final List<String> namespaces = xsltc.getNamespaceIndex();
+        final List<String> names = xsltc.getNamesIndex();
         final int namespaceCount = namespaces.size() + 1;
         final int namesCount = names.size();
 
@@ -697,7 +676,7 @@
             // Add test sequences for known namespace types
             for (int i = DTM.NTYPES; i < (DTM.NTYPES+namesCount); i++) {
                 if ((isNamespace[i]) && (isAttribute[i] == attrFlag)) {
-                    String name = (String)names.elementAt(i-DTM.NTYPES);
+                    String name = names.get(i-DTM.NTYPES);
                     String namespace = name.substring(0,name.lastIndexOf(':'));
                     final int type = xsltc.registerNamespace(namespace);
 
@@ -737,7 +716,7 @@
     public void compileApplyTemplates(ClassGenerator classGen) {
         final XSLTC xsltc = classGen.getParser().getXSLTC();
         final ConstantPoolGen cpg = classGen.getConstantPool();
-        final Vector names = xsltc.getNamesIndex();
+        final List<String> names = xsltc.getNamesIndex();
 
         // Create the applyTemplates() method
         final com.sun.org.apache.bcel.internal.generic.Type[] argTypes =
@@ -816,7 +795,7 @@
         final boolean[] isAttribute = new boolean[types.length];
         final boolean[] isNamespace = new boolean[types.length];
         for (int i = 0; i < names.size(); i++) {
-            final String name = (String)names.elementAt(i);
+            final String name = names.get(i);
             isAttribute[i + DTM.NTYPES] = isAttributeName(name);
             isNamespace[i + DTM.NTYPES] = isNamespaceName(name);
         }
@@ -1067,28 +1046,26 @@
         });
     }
 
-
+    @SuppressWarnings({"rawtypes", "unchecked"})
     public void compileApplyImports(ClassGenerator classGen, int min, int max) {
         final XSLTC xsltc = classGen.getParser().getXSLTC();
         final ConstantPoolGen cpg = classGen.getConstantPool();
-        final Vector names      = xsltc.getNamesIndex();
+        final List<String> names = xsltc.getNamesIndex();
 
         // Clear some datastructures
         _namedTemplates = new HashMap<>();
         _neededTemplates = new HashMap<>();
         _templateIHs = new HashMap<>();
         _templateILs = new HashMap<>();
-        _patternGroups = new Vector[32];
+        _patternGroups = (List<LocationPathPattern>[])new ArrayList[32];
         _rootPattern = null;
 
         // IMPORTANT: Save orignal & complete set of templates!!!!
-        Vector oldTemplates = _templates;
+        List<Template> oldTemplates = _templates;
 
         // Gather templates that are within the scope of this import
-        _templates = new Vector();
-        final Enumeration templates = oldTemplates.elements();
-        while (templates.hasMoreElements()) {
-            final Template template = (Template)templates.nextElement();
+        _templates = new ArrayList<>();
+        for (Template template : oldTemplates) {
             final int prec = template.getImportPrecedence();
             if ((prec >= min) && (prec < max)) addTemplate(template);
         }
@@ -1159,7 +1136,7 @@
         final boolean[] isAttribute = new boolean[types.length];
         final boolean[] isNamespace = new boolean[types.length];
         for (int i = 0; i < names.size(); i++) {
-            final String name = (String)names.elementAt(i);
+            final String name = (String)names.get(i);
             isAttribute[i+DTM.NTYPES] = isAttributeName(name);
             isNamespace[i+DTM.NTYPES] = isNamespaceName(name);
         }
@@ -1406,8 +1383,8 @@
         // is creating a problem in the Turkish locale
         pattern = "loadinstruction pop";
 
-        for (Iterator iter = find.search(pattern); iter.hasNext();) {
-            InstructionHandle[] match = (InstructionHandle[]) iter.next();
+        for (Iterator<InstructionHandle[]> iter = find.search(pattern); iter.hasNext();) {
+            InstructionHandle[] match = iter.next();
             try {
                 if (!match[0].hasTargeters() && !match[1].hasTargeters()) {
                     il.delete(match[0], match[1]);
@@ -1423,8 +1400,8 @@
         // changed to lower case - changing to all lower case although only the instruction with capital I
         // is creating a problem in the Turkish locale
         pattern = "iload iload swap istore";
-        for (Iterator iter = find.search(pattern); iter.hasNext();) {
-            InstructionHandle[] match = (InstructionHandle[]) iter.next();
+        for (Iterator<InstructionHandle[]> iter = find.search(pattern); iter.hasNext();) {
+            InstructionHandle[] match = iter.next();
             try {
                 com.sun.org.apache.bcel.internal.generic.ILOAD iload1 =
                     (com.sun.org.apache.bcel.internal.generic.ILOAD) match[0].getInstruction();
@@ -1452,8 +1429,8 @@
         // changed to lower case - changing to all lower case although only the instruction with capital I
         // is creating a problem in the Turkish locale
         pattern = "loadinstruction loadinstruction swap";
-        for (Iterator iter = find.search(pattern); iter.hasNext();) {
-            InstructionHandle[] match = (InstructionHandle[])iter.next();
+        for (Iterator<InstructionHandle[]> iter = find.search(pattern); iter.hasNext();) {
+            InstructionHandle[] match = iter.next();
             try {
                 if (!match[0].hasTargeters() &&
                     !match[1].hasTargeters() &&
@@ -1474,8 +1451,8 @@
         // changed to lower case - changing to all lower case although only the instruction with capital I
         // is creating a problem in the Turkish locale
         pattern = "aload aload";
-        for (Iterator iter = find.search(pattern); iter.hasNext();) {
-            InstructionHandle[] match = (InstructionHandle[])iter.next();
+        for (Iterator<InstructionHandle[]> iter = find.search(pattern); iter.hasNext();) {
+            InstructionHandle[] match = iter.next();
             try {
                 if (!match[1].hasTargeters()) {
                     com.sun.org.apache.bcel.internal.generic.ALOAD aload1 =
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NameBase.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NameBase.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
@@ -30,6 +28,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Morten Jorgensen
@@ -50,7 +49,7 @@
     /**
      * Handles calls with one parameter (either node or node-set).
      */
-    public NameBase(QName fname, Vector arguments) {
+    public NameBase(QName fname, List<Expression> arguments) {
         super(fname, arguments);
         _param = argument(0);
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NameCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NameCall.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,13 +21,12 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -46,7 +45,7 @@
     /**
      * Handles calls with one parameter (either node or node-set).
      */
-    public NameCall(QName fname, Vector arguments) {
+    public NameCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceUriCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceUriCall.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,13 +21,12 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
+import java.util.List;
 
 /**
  * @author Morten Jorgensen
@@ -44,7 +43,7 @@
     /**
      * Handles calls with one parameter (either node or node-set).
      */
-    public NamespaceUriCall(QName fname, Vector arguments) {
+    public NamespaceUriCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NotCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NotCall.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,20 +21,19 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.BranchHandle;
 import com.sun.org.apache.bcel.internal.generic.GOTO;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
  * @author Santiago Pericas-Geertsen
  */
 final class NotCall extends FunctionCall {
-    public NotCall(QName fname, Vector arguments) {
+    public NotCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.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,23 +21,21 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.ArrayList;
-
 import com.sun.org.apache.bcel.internal.classfile.Field;
 import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
 import com.sun.org.apache.bcel.internal.generic.ASTORE;
 import com.sun.org.apache.bcel.internal.generic.BranchHandle;
 import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
+import com.sun.org.apache.bcel.internal.generic.D2I;
 import com.sun.org.apache.bcel.internal.generic.GETFIELD;
 import com.sun.org.apache.bcel.internal.generic.GOTO;
 import com.sun.org.apache.bcel.internal.generic.IFNONNULL;
+import com.sun.org.apache.bcel.internal.generic.ILOAD;
 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.D2I;
 import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
 import com.sun.org.apache.bcel.internal.generic.NEW;
 import com.sun.org.apache.bcel.internal.generic.PUSH;
@@ -50,6 +48,8 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -86,7 +86,7 @@
     private boolean _formatNeeded = false;
 
     private String _className = null;
-    private ArrayList _closureVars = null;
+    private List<VariableRefBase> _closureVars = null;
 
      // -- Begin Closure interface --------------------
 
@@ -118,7 +118,7 @@
      */
     public void addVariable(VariableRefBase variableRef) {
         if (_closureVars == null) {
-            _closureVars = new ArrayList();
+            _closureVars = new ArrayList<>();
         }
 
         // Only one reference per variable
@@ -395,8 +395,7 @@
             _closureVars.size();
 
         for (int i = 0; i < closureLen; i++) {
-            VariableBase var =
-                ((VariableRefBase) _closureVars.get(i)).getVariable();
+            VariableBase var = (_closureVars.get(i)).getVariable();
 
             nodeCounterGen.addField(new Field(ACC_PUBLIC,
                                         cpg.addUtf8(var.getEscapedName()),
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NumberCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/NumberCall.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,13 +21,12 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -35,7 +34,7 @@
  */
 final class NumberCall extends FunctionCall {
 
-    public NumberCall(QName fname, Vector arguments) {
+    public NumberCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Predicate.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Predicate.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.ArrayList;
-
 import com.sun.org.apache.bcel.internal.classfile.Field;
 import com.sun.org.apache.bcel.internal.generic.ASTORE;
 import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
@@ -47,6 +45,8 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
 import com.sun.org.apache.xalan.internal.xsltc.runtime.Operators;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -92,7 +92,7 @@
     /**
      * List of variables in closure.
      */
-    private ArrayList _closureVars = null;
+    private List<VariableRefBase> _closureVars = null;
 
     /**
      * Reference to parent closure.
@@ -208,7 +208,7 @@
      */
     public void addVariable(VariableRefBase variableRef) {
         if (_closureVars == null) {
-            _closureVars = new ArrayList();
+            _closureVars = new ArrayList<>();
         }
 
         // Only one reference per variable
@@ -372,7 +372,7 @@
 
         // Add a new instance variable for each var in closure
         for (int i = 0; i < length; i++) {
-            VariableBase var = ((VariableRefBase) _closureVars.get(i)).getVariable();
+            VariableBase var = (_closureVars.get(i)).getVariable();
 
             filterGen.addField(new Field(ACC_PUBLIC,
                                         cpg.addUtf8(var.getEscapedName()),
@@ -559,7 +559,7 @@
         final int length = (_closureVars == null) ? 0 : _closureVars.size();
 
         for (int i = 0; i < length; i++) {
-            VariableRefBase varRef = (VariableRefBase) _closureVars.get(i);
+            VariableRefBase varRef = _closureVars.get(i);
             VariableBase var = varRef.getVariable();
             Type varType = var.getType();
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstructionPattern.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstructionPattern.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
@@ -81,7 +81,7 @@
             // Type check all the predicates (e -> position() = e)
             final int n = _predicates.size();
             for (int i = 0; i < n; i++) {
-                final Predicate pred = (Predicate)_predicates.elementAt(i);
+                final Predicate pred = _predicates.get(i);
                 pred.typeCheck(stable);
             }
         }
@@ -133,7 +133,7 @@
         if (hasPredicates()) {
             final int n = _predicates.size();
             for (int i = 0; i < n; i++) {
-                Predicate pred = (Predicate)_predicates.elementAt(i);
+                Predicate pred = _predicates.get(i);
                 Expression exp = pred.getExpr();
                 exp.translateDesynthesized(classGen, methodGen);
                 _trueList.append(exp._trueList);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/RelationalExpr.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/RelationalExpr.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
@@ -183,11 +183,11 @@
                 new MethodType(Type.Void, tleft, tright));
 
         if (ptype != null) {
-            Type arg1 = (Type) ptype.argsType().elementAt(0);
+            Type arg1 = ptype.argsType().get(0);
             if (!arg1.identicalTo(tleft)) {
                 _left = new CastExpr(_left, arg1);
             }
-            Type arg2 = (Type) ptype.argsType().elementAt(1);
+            Type arg2 = ptype.argsType().get(1);
             if (!arg2.identicalTo(tright)) {
                 _right = new CastExpr(_right, arg1);
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/RoundCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/RoundCall.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,13 +21,12 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -35,7 +34,7 @@
  */
 final class RoundCall extends FunctionCall {
 
-    public RoundCall(QName fname, Vector arguments) {
+    public RoundCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,9 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.ArrayList;
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.classfile.Field;
 import com.sun.org.apache.bcel.internal.generic.ALOAD;
 import com.sun.org.apache.bcel.internal.generic.ANEWARRAY;
@@ -53,6 +51,8 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
 import com.sun.org.apache.xml.internal.dtm.Axis;
+import java.util.ArrayList;
+import java.util.List;
 
 
 /**
@@ -69,7 +69,7 @@
     private String         _lang; // bug! see 26869
 
     private String _className = null;
-    private ArrayList<VariableRefBase> _closureVars = null;
+    private List<VariableRefBase> _closureVars = null;
     private boolean _needsSortRecordFactory = false;
 
     // -- Begin Closure interface --------------------
@@ -233,7 +233,7 @@
     public static void translateSortIterator(ClassGenerator classGen,
                                       MethodGenerator methodGen,
                                       Expression nodeSet,
-                                      Vector<Sort> sortObjects)
+                                      List<Sort> sortObjects)
     {
         final ConstantPoolGen cpg = classGen.getConstantPool();
         final InstructionList il = methodGen.getInstructionList();
@@ -299,7 +299,7 @@
      * Compiles code that instantiates a NodeSortRecordFactory object which
      * will produce NodeSortRecord objects of a specific type.
      */
-    public static void compileSortRecordFactory(Vector<Sort> sortObjects,
+    public static void compileSortRecordFactory(List<Sort> sortObjects,
         ClassGenerator classGen, MethodGenerator methodGen)
     {
         String sortRecordClass =
@@ -308,7 +308,7 @@
         boolean needsSortRecordFactory = false;
         final int nsorts = sortObjects.size();
         for (int i = 0; i < nsorts; i++) {
-            final Sort sort = sortObjects.elementAt(i);
+            final Sort sort = sortObjects.get(i);
             needsSortRecordFactory |= sort._needsSortRecordFactory;
         }
 
@@ -339,7 +339,7 @@
         il.append(new PUSH(cpg, nsorts));
         il.append(new ANEWARRAY(cpg.addClass(STRING)));
         for (int level = 0; level < nsorts; level++) {
-            final Sort sort = (Sort)sortObjects.elementAt(level);
+            final Sort sort = sortObjects.get(level);
             il.append(DUP);
             il.append(new PUSH(cpg, level));
             sort.translateSortOrder(classGen, methodGen);
@@ -354,7 +354,7 @@
         il.append(new PUSH(cpg, nsorts));
         il.append(new ANEWARRAY(cpg.addClass(STRING)));
         for (int level = 0; level < nsorts; level++) {
-            final Sort sort = (Sort)sortObjects.elementAt(level);
+            final Sort sort = sortObjects.get(level);
             il.append(DUP);
             il.append(new PUSH(cpg, level));
             sort.translateSortType(classGen, methodGen);
@@ -369,7 +369,7 @@
         il.append(new PUSH(cpg, nsorts));
         il.append(new ANEWARRAY(cpg.addClass(STRING)));
         for (int level = 0; level < nsorts; level++) {
-              final Sort sort = (Sort)sortObjects.elementAt(level);
+              final Sort sort = sortObjects.get(level);
               il.append(DUP);
               il.append(new PUSH(cpg, level));
               sort.translateLang(classGen, methodGen);
@@ -384,7 +384,7 @@
         il.append(new PUSH(cpg, nsorts));
         il.append(new ANEWARRAY(cpg.addClass(STRING)));
         for (int level = 0; level < nsorts; level++) {
-            final Sort sort = (Sort)sortObjects.elementAt(level);
+            final Sort sort = sortObjects.get(level);
             il.append(DUP);
             il.append(new PUSH(cpg, level));
             sort.translateCaseOrder(classGen, methodGen);
@@ -416,7 +416,7 @@
                     + "[" + STRING_SIG + ")V")));
 
         // Initialize closure variables in sortRecordFactory
-        final ArrayList<VariableRefBase> dups = new ArrayList<>();
+        final List<VariableRefBase> dups = new ArrayList<>();
 
         for (int j = 0; j < nsorts; j++) {
             final Sort sort = (Sort) sortObjects.get(j);
@@ -442,11 +442,11 @@
         }
     }
 
-    public static String compileSortRecordFactory(Vector<Sort> sortObjects,
+    public static String compileSortRecordFactory(List<Sort> sortObjects,
         ClassGenerator classGen, MethodGenerator methodGen,
         String sortRecordClass)
     {
-        final XSLTC xsltc = (sortObjects.firstElement()).getXSLTC();
+        final XSLTC xsltc = (sortObjects.get(0)).getXSLTC();
         final String className = xsltc.getHelperClassName();
 
         final NodeSortRecordFactGenerator sortRecordFactory =
@@ -461,7 +461,7 @@
 
         // Add a new instance variable for each var in closure
         final int nsorts = sortObjects.size();
-        final ArrayList<VariableRefBase> dups = new ArrayList<>();
+        final List<VariableRefBase> dups = new ArrayList<>();
 
         for (int j = 0; j < nsorts; j++) {
             final Sort sort = sortObjects.get(j);
@@ -587,10 +587,10 @@
     /**
      * Create a new auxillary class extending NodeSortRecord.
      */
-    private static String compileSortRecord(Vector<Sort> sortObjects,
+    private static String compileSortRecord(List<Sort> sortObjects,
                                             ClassGenerator classGen,
                                             MethodGenerator methodGen) {
-        final XSLTC  xsltc = sortObjects.firstElement().getXSLTC();
+        final XSLTC  xsltc = sortObjects.get(0).getXSLTC();
         final String className = xsltc.getHelperClassName();
 
         // This generates a new class for handling this specific sort
@@ -606,7 +606,7 @@
 
         // Add a new instance variable for each var in closure
         final int nsorts = sortObjects.size();
-        final ArrayList<VariableRefBase> dups = new ArrayList<>();
+        final List<VariableRefBase> dups = new ArrayList<>();
 
         for (int j = 0; j < nsorts; j++) {
             final Sort sort = sortObjects.get(j);
@@ -673,7 +673,7 @@
     /**
      * Compiles a method that overloads NodeSortRecord.extractValueFromDOM()
      */
-    private static MethodGenerator compileExtract(Vector<Sort> sortObjects,
+    private static MethodGenerator compileExtract(List<Sort> sortObjects,
                                          NodeSortRecordGenerator sortRecord,
                                          ConstantPoolGen cpg,
                                          String className) {
@@ -715,7 +715,7 @@
         // Append all the cases for the switch statment
         for (int level = 0; level < levels; level++) {
             match[level] = level;
-            final Sort sort = sortObjects.elementAt(level);
+            final Sort sort = sortObjects.get(level);
             target[level] = il.append(NOP);
             sort.translateSelect(sortRecord, extractMethod);
             il.append(ARETURN);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StartsWithCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StartsWithCall.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
@@ -31,6 +29,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -45,7 +44,7 @@
     /**
      * Create a starts-with() call - two arguments, both strings
      */
-    public StartsWithCall(QName fname, Vector arguments) {
+    public StartsWithCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Step.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Step.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,17 +21,15 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ALOAD;
 import com.sun.org.apache.bcel.internal.generic.ASTORE;
 import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.ICONST;
 import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
 import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
+import com.sun.org.apache.bcel.internal.generic.ISTORE;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
 import com.sun.org.apache.bcel.internal.generic.NEW;
@@ -44,6 +42,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
 import com.sun.org.apache.xml.internal.dtm.Axis;
 import com.sun.org.apache.xml.internal.dtm.DTM;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -60,7 +59,7 @@
     /**
      * A vector of predicates (filters) defined on this step - may be null
      */
-    private Vector _predicates;
+    private List<Predicate> _predicates;
 
     /**
      * Some simple predicates can be handled by this class (and not by the
@@ -74,7 +73,7 @@
      */
     private int _nodeType;
 
-    public Step(int axis, int nodeType, Vector predicates) {
+    public Step(int axis, int nodeType, List<Predicate> predicates) {
         _axis = axis;
         _nodeType = nodeType;
         _predicates = predicates;
@@ -88,7 +87,7 @@
         if (_predicates != null) {
             final int n = _predicates.size();
             for (int i = 0; i < n; i++) {
-                final Predicate exp = (Predicate)_predicates.elementAt(i);
+                final Predicate exp = _predicates.get(i);
                 exp.setParser(parser);
                 exp.setParent(this);
             }
@@ -119,14 +118,14 @@
     /**
      * Returns the vector containing all predicates for this step.
      */
-    public Vector getPredicates() {
+    public List<Predicate> getPredicates() {
         return _predicates;
     }
 
     /**
      * Returns the vector containing all predicates for this step.
      */
-    public void addPredicates(Vector predicates) {
+    public void addPredicates(List<Predicate> predicates) {
         if (_predicates == null) {
             _predicates = predicates;
         }
@@ -213,9 +212,7 @@
 
         // Type check all predicates (expressions applied to the step)
         if (_predicates != null) {
-            final int n = _predicates.size();
-            for (int i = 0; i < n; i++) {
-                final Expression pred = (Expression)_predicates.elementAt(i);
+            for (Expression pred : _predicates) {
                 pred.typeCheck(stable);
             }
         }
@@ -249,9 +246,9 @@
             final XSLTC xsltc = getParser().getXSLTC();
 
             if (_nodeType >= DTM.NTYPES) {
-                final Vector ni = xsltc.getNamesIndex();
+                final List<String> ni = xsltc.getNamesIndex();
 
-                name = (String)ni.elementAt(_nodeType-DTM.NTYPES);
+                name = ni.get(_nodeType-DTM.NTYPES);
                 star = name.lastIndexOf('*');
             }
 
@@ -375,7 +372,7 @@
             translateStep(classGen, methodGen, predicateIndex);
         }
         else {
-            final Predicate predicate = (Predicate) _predicates.get(predicateIndex--);
+            final Predicate predicate = _predicates.get(predicateIndex--);
 
             // Special case for predicates that can use the NodeValueIterator
             // instead of an auxiliary class. Certain path/predicates pairs
@@ -525,9 +522,7 @@
         final StringBuffer buffer = new StringBuffer("step(\"");
         buffer.append(Axis.getNames(_axis)).append("\", ").append(_nodeType);
         if (_predicates != null) {
-            final int n = _predicates.size();
-            for (int i = 0; i < n; i++) {
-                final Predicate pred = (Predicate)_predicates.elementAt(i);
+            for (Expression pred : _predicates) {
                 buffer.append(", ").append(pred.toString());
             }
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StepPattern.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StepPattern.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.classfile.Field;
 import com.sun.org.apache.bcel.internal.generic.ALOAD;
 import com.sun.org.apache.bcel.internal.generic.ASTORE;
@@ -54,6 +52,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
 import com.sun.org.apache.xml.internal.dtm.Axis;
 import com.sun.org.apache.xml.internal.dtm.DTM;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -68,7 +67,7 @@
 
     protected final int _axis;
     protected final int _nodeType;
-    protected Vector _predicates;
+    protected List<Predicate> _predicates;
 
     private Step    _step = null;
     private boolean _isEpsilon = false;
@@ -76,7 +75,7 @@
 
     private double  _priority = Double.MAX_VALUE;
 
-    public StepPattern(int axis, int nodeType, Vector predicates) {
+    public StepPattern(int axis, int nodeType, List<Predicate> predicates) {
         _axis = axis;
         _nodeType = nodeType;
         _predicates = predicates;
@@ -85,9 +84,7 @@
     public void setParser(Parser parser) {
         super.setParser(parser);
         if (_predicates != null) {
-            final int n = _predicates.size();
-            for (int i = 0; i < n; i++) {
-                final Predicate exp = (Predicate)_predicates.elementAt(i);
+            for (Predicate exp : _predicates) {
                 exp.setParser(parser);
                 exp.setParent(this);
             }
@@ -110,7 +107,7 @@
         return _isEpsilon && hasPredicates() == false;
     }
 
-    public StepPattern setPredicates(Vector predicates) {
+    public StepPattern setPredicates(List<Predicate> predicates) {
         _predicates = predicates;
         return(this);
     }
@@ -149,7 +146,7 @@
 
     public String toString() {
         final StringBuffer buffer = new StringBuffer("stepPattern(\"");
-    buffer.append(Axis.getNames(_axis))
+        buffer.append(Axis.getNames(_axis))
             .append("\", ")
             .append(_isEpsilon ?
                         ("epsilon{" + Integer.toString(_nodeType) + "}") :
@@ -164,7 +161,7 @@
         final int n = _predicates.size();
 
         for (int i = 0; i < n && noContext; i++) {
-            Predicate pred = (Predicate) _predicates.elementAt(i);
+            Predicate pred = _predicates.get(i);
             if (pred.isNthPositionFilter() ||
                 pred.hasPositionCall() ||
                 pred.hasLastCall())
@@ -189,9 +186,7 @@
     public Type typeCheck(SymbolTable stable) throws TypeCheckError {
         if (hasPredicates()) {
             // Type check all the predicates (e -> position() = e)
-            final int n = _predicates.size();
-            for (int i = 0; i < n; i++) {
-                final Predicate pred = (Predicate)_predicates.elementAt(i);
+            for (Predicate pred : _predicates) {
                 pred.typeCheck(stable);
             }
 
@@ -202,7 +197,7 @@
 
             // Create an instance of Step to do the translation
             if (_contextCase == SIMPLE_CONTEXT) {
-                Predicate pred = (Predicate)_predicates.elementAt(0);
+                Predicate pred = _predicates.get(0);
                 if (pred.isNthPositionFilter()) {
                     _contextCase = GENERAL_CONTEXT;
                     step = new Step(_axis, _nodeType, _predicates);
@@ -210,9 +205,8 @@
                     step = new Step(_axis, _nodeType, null);
                 }
             } else if (_contextCase == GENERAL_CONTEXT) {
-                final int len = _predicates.size();
-                for (int i = 0; i < len; i++) {
-                    ((Predicate)_predicates.elementAt(i)).dontOptimize();
+                for (Predicate pred : _predicates) {
+                    pred.dontOptimize();
                 }
 
                 step = new Step(_axis, _nodeType, _predicates);
@@ -292,9 +286,7 @@
         }
 
         // Compile the expressions within the predicates
-        final int n = _predicates.size();
-        for (int i = 0; i < n; i++) {
-            Predicate pred = (Predicate)_predicates.elementAt(i);
+        for (Predicate pred : _predicates) {
             Expression exp = pred.getExpr();
             exp.translateDesynthesized(classGen, methodGen);
             _trueList.append(exp._trueList);
@@ -382,7 +374,7 @@
         il.append(methodGen.storeCurrentNode());
 
         // Translate the expression of the predicate
-        Predicate pred = (Predicate) _predicates.elementAt(0);
+        Predicate pred = _predicates.get(0);
         Expression exp = pred.getExpr();
         exp.translateDesynthesized(classGen, methodGen);
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StringCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StringCall.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,21 +21,20 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
  * @author Santiago Pericas-Geertsen
  */
 final class StringCall extends FunctionCall {
-    public StringCall(QName fname, Vector arguments) {
+    public StringCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StringLengthCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/StringLengthCall.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,21 +21,20 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
  * @author Santiago Pericas-Geertsen
  */
 final class StringLengthCall extends FunctionCall {
-    public StringLengthCall(QName fname, Vector arguments) {
+    public StringLengthCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -53,13 +54,13 @@
 import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.StringTokenizer;
-import java.util.Vector;
 
 /**
  * @author Jacek Ambroziak
@@ -91,7 +92,7 @@
     /**
      * Contains global variables and parameters defined in the stylesheet.
      */
-    private Vector _globals = new Vector();
+    private List<VariableBase> _globals = new ArrayList<>();
 
     /**
      * Used to cache the result returned by <code>hasLocalParams()</code>.
@@ -106,13 +107,13 @@
     /**
       * Contains all templates defined in this stylesheet
       */
-    private final Vector _templates = new Vector();
+    private final List<Template> _templates = new ArrayList<>();
 
     /**
      * Used to cache result of <code>getAllValidTemplates()</code>. Only
      * set in top-level stylesheets that include/import other stylesheets.
      */
-    private Vector _allValidTemplates = null;
+    private List<Template> _allValidTemplates = null;
 
     /**
      * Counter to generate unique mode suffixes.
@@ -149,7 +150,7 @@
     /**
      * Array of all the stylesheets imported or included from this one.
      */
-    private Vector _includedStylesheets = null;
+    private List<Stylesheet> _includedStylesheets = null;
 
     /**
      * Import precendence for this stylesheet.
@@ -370,8 +371,7 @@
                                           : 0;
 
             for (int i = 0; i < inclImpCount; i++) {
-                int prec = ((Stylesheet)_includedStylesheets.elementAt(i))
-                                              .getMinimumDescendantPrecedence();
+                int prec = (_includedStylesheets.get(i)).getMinimumDescendantPrecedence();
 
                 if (prec < min) {
                     min = prec;
@@ -420,9 +420,9 @@
 
     public void addIncludedStylesheet(Stylesheet child) {
         if (_includedStylesheets == null) {
-            _includedStylesheets = new Vector();
+            _includedStylesheets = new ArrayList<>();
         }
-        _includedStylesheets.addElement(child);
+        _includedStylesheets.add(child);
     }
 
     public void setSystemId(String systemId) {
@@ -461,10 +461,10 @@
      */
     public boolean hasLocalParams() {
         if (_hasLocalParams == null) {
-            Vector templates = getAllValidTemplates();
+           List<Template> templates = getAllValidTemplates();
             final int n = templates.size();
             for (int i = 0; i < n; i++) {
-                final Template template = (Template)templates.elementAt(i);
+                final Template template = templates.get(i);
                 if (template.hasParams()) {
                     _hasLocalParams = Boolean.TRUE;
                     return true;
@@ -648,7 +648,7 @@
     public Type typeCheck(SymbolTable stable) throws TypeCheckError {
         final int count = _globals.size();
         for (int i = 0; i < count; i++) {
-            final VariableBase var = (VariableBase)_globals.elementAt(i);
+            final VariableBase var = _globals.get(i);
             var.typeCheck(stable);
         }
         return typeCheckContents(stable);
@@ -711,7 +711,7 @@
             if (element instanceof Template) {
                 // Separate templates by modes
                 final Template template = (Template)element;
-                //_templates.addElement(template);
+                //_templates.add(template);
                 getMode(template.getModeName()).addTemplate(template);
             }
             // xsl:attribute-set
@@ -770,7 +770,7 @@
         }
 
         // Put the names array into the translet - used for dom/translet mapping
-        final Vector namesIndex = getXSLTC().getNamesIndex();
+        final List<String> namesIndex = getXSLTC().getNamesIndex();
         int size = namesIndex.size();
         String[] namesArray = new String[size];
         String[] urisArray = new String[size];
@@ -778,7 +778,7 @@
 
         int index;
         for (int i = 0; i < size; i++) {
-            String encodedName = (String)namesIndex.elementAt(i);
+            String encodedName = namesIndex.get(i);
             if ((index = encodedName.lastIndexOf(':')) > -1) {
                 urisArray[i] = encodedName.substring(0, index);
             }
@@ -859,7 +859,7 @@
         }
 
         // Put the namespace names array into the translet
-        final Vector namespaces = getXSLTC().getNamespaceIndex();
+        final List<String> namespaces = getXSLTC().getNamespaceIndex();
         staticConst.markChunkStart();
         il.append(new PUSH(cpg, namespaces.size()));
         il.append(new ANEWARRAY(cpg.addClass(STRING)));
@@ -870,7 +870,7 @@
         staticConst.markChunkEnd();
 
         for (int i = 0; i < namespaces.size(); i++) {
-            final String ns = (String)namespaces.elementAt(i);
+            final String ns = namespaces.get(i);
             staticConst.markChunkStart();
             il.append(new GETSTATIC(namespaceArrayRef));
             il.append(new PUSH(cpg, i));
@@ -1050,7 +1050,7 @@
         current.setStart(il.append(new ISTORE(current.getIndex())));
 
         // Create a new list containing variables/params + keys
-        Vector varDepElements = new Vector(_globals);
+        List<SyntaxTreeNode> varDepElements = new ArrayList<>(_globals);
         Iterator<SyntaxTreeNode> elements = elements();
         while (elements.hasNext()) {
             SyntaxTreeNode element = elements.next();
@@ -1065,7 +1065,7 @@
         // Translate vars/params and keys in the right order
         final int count = varDepElements.size();
         for (int i = 0; i < count; i++) {
-            final TopLevelElement tle = (TopLevelElement) varDepElements.elementAt(i);
+            final TopLevelElement tle = (TopLevelElement) varDepElements.get(i);
             tle.translate(classGen, toplevel);
             if (tle instanceof Key) {
                 final Key key = (Key) tle;
@@ -1074,7 +1074,7 @@
         }
 
         // Compile code for other top-level elements
-        Vector whitespaceRules = new Vector();
+       List<Whitespace.WhitespaceRule> whitespaceRules = new ArrayList<>();
         elements = elements();
         while (elements.hasNext()) {
             SyntaxTreeNode element = elements.next();
@@ -1115,27 +1115,15 @@
      * compatibility with Xalan interpretive, that type of dependency is
      * allowed and, therefore, consider to determine the partial order.
      */
-    private Vector resolveDependencies(Vector input) {
-        /* DEBUG CODE - INGORE
-        for (int i = 0; i < input.size(); i++) {
-            final TopLevelElement e = (TopLevelElement) input.elementAt(i);
-            System.out.println("e = " + e + " depends on:");
-            Vector dep = e.getDependencies();
-            for (int j = 0; j < (dep != null ? dep.size() : 0); j++) {
-                System.out.println("\t" + dep.elementAt(j));
-            }
-        }
-        System.out.println("=================================");
-        */
-
-        Vector result = new Vector();
+    private List<SyntaxTreeNode> resolveDependencies(List<SyntaxTreeNode> input) {
+        List<SyntaxTreeNode> result = new ArrayList<>();
         while (input.size() > 0) {
             boolean changed = false;
             for (int i = 0; i < input.size(); ) {
-                final TopLevelElement vde = (TopLevelElement) input.elementAt(i);
-                final Vector dep = vde.getDependencies();
+                final TopLevelElement vde = (TopLevelElement) input.get(i);
+                final List<SyntaxTreeNode> dep = vde.getDependencies();
                 if (dep == null || result.containsAll(dep)) {
-                    result.addElement(vde);
+                    result.add(vde);
                     input.remove(i);
                     changed = true;
                 }
@@ -1153,14 +1141,6 @@
             }
         }
 
-        /* DEBUG CODE - INGORE
-        System.out.println("=================================");
-        for (int i = 0; i < result.size(); i++) {
-            final TopLevelElement e = (TopLevelElement) result.elementAt(i);
-            System.out.println("e = " + e);
-        }
-        */
-
         return result;
     }
 
@@ -1374,8 +1354,8 @@
         final String pattern = "`aload'`pop'`instruction'";
         final InstructionList il = methodGen.getInstructionList();
         final InstructionFinder find = new InstructionFinder(il);
-        for(Iterator iter=find.search(pattern); iter.hasNext(); ) {
-            InstructionHandle[] match = (InstructionHandle[])iter.next();
+        for(Iterator<InstructionHandle[]> iter=find.search(pattern); iter.hasNext(); ) {
+            InstructionHandle[] match = iter.next();
             try {
                 il.delete(match[0], match[1]);
             }
@@ -1386,12 +1366,12 @@
     }
 
     public int addParam(Param param) {
-        _globals.addElement(param);
+        _globals.add(param);
         return _globals.size() - 1;
     }
 
     public int addVariable(Variable global) {
-        _globals.addElement(global);
+        _globals.add(global);
         return _globals.size() - 1;
     }
 
@@ -1410,11 +1390,11 @@
         return _className;
     }
 
-    public Vector getTemplates() {
+    public List<Template> getTemplates() {
         return _templates;
     }
 
-    public Vector getAllValidTemplates() {
+    public List<Template> getAllValidTemplates() {
         // Return templates if no imported/included stylesheets
         if (_includedStylesheets == null) {
             return _templates;
@@ -1422,11 +1402,9 @@
 
         // Is returned value cached?
         if (_allValidTemplates == null) {
-           Vector templates = new Vector();
-           templates.addAll(_templates);
-            int size = _includedStylesheets.size();
-            for (int i = 0; i < size; i++) {
-                Stylesheet included =(Stylesheet)_includedStylesheets.elementAt(i);
+            List<Template> templates = new ArrayList<>();
+            templates.addAll(_templates);
+            for (Stylesheet included : _includedStylesheets) {
                 templates.addAll(included.getAllValidTemplates());
             }
             //templates.addAll(_templates);
@@ -1442,6 +1420,6 @@
     }
 
     protected void addTemplate(Template template) {
-        _templates.addElement(template);
+        _templates.add(template);
     }
 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -24,11 +25,12 @@
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Stack;
 import java.util.StringTokenizer;
-import java.util.Vector;
 
 /**
  * @author Jacek Ambroziak
@@ -39,7 +41,7 @@
 
     // These maps are used for all stylesheets
     private final Map<String, Stylesheet> _stylesheets = new HashMap<>();
-    private final Map<String, Vector> _primops     = new HashMap<>();
+    private final Map<String, List<MethodType>> _primops = new HashMap<>();
 
     // These maps are used for some stylesheets
     private Map<String, VariableBase> _variables = null;
@@ -138,18 +140,18 @@
      * is prepended.
      */
     public void addPrimop(String name, MethodType mtype) {
-        Vector methods = _primops.get(name);
+        List<MethodType> methods = _primops.get(name);
         if (methods == null) {
-            _primops.put(name, methods = new Vector());
+            _primops.put(name, methods = new ArrayList<>());
         }
-        methods.addElement(mtype);
+        methods.add(mtype);
     }
 
     /**
      * Lookup a primitive operator or function in the symbol table by
      * prepending the prefix <tt>PrimopPrefix</tt>.
      */
-    public Vector lookupPrimop(String name) {
+    public List<MethodType> lookupPrimop(String name) {
         return _primops.get(name);
     }
 
@@ -272,7 +274,7 @@
      */
     public void pushExcludedNamespacesContext() {
         if (_excludedURIStack == null) {
-            _excludedURIStack = new Stack();
+            _excludedURIStack = new Stack<>();
         }
         _excludedURIStack.push(_excludedURI);
         _excludedURI = null;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
 import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
@@ -34,6 +33,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
 import com.sun.org.apache.xml.internal.utils.XML11Char;
+import java.util.ArrayList;
 import java.util.List;
 
 
@@ -60,7 +60,7 @@
 
     // The list of parameters in this template. This is only used
     // for simple named templates.
-    private Vector<Param> _parameters = new Vector<>();
+    private List<Param> _parameters = new ArrayList<>();
 
     public boolean hasParams() {
         return _parameters.size() > 0;
@@ -79,10 +79,10 @@
     }
 
     public void addParameter(Param param) {
-        _parameters.addElement(param);
+        _parameters.add(param);
     }
 
-    public Vector<Param> getParameters() {
+    public List<Param> getParameters() {
         return _parameters;
     }
 
@@ -328,7 +328,7 @@
 
             // Update load/store instructions to access Params from the stack
             for (int i = 0; i < numParams; i++) {
-                Param param = (Param)_parameters.elementAt(i);
+                Param param = _parameters.get(i);
                 param.setLoadInstruction(namedMethodGen.loadParameter(i));
                 param.setStoreInstruction(namedMethodGen.storeParameter(i));
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -28,9 +29,9 @@
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import java.util.Dictionary;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
-import java.util.Vector;
 
 /**
  * A test sequence is a sequence of patterns that
@@ -56,10 +57,10 @@
     private int _kernelType;
 
     /**
-     * Vector of all patterns in the test sequence. May include
+     * ArrayList of all patterns in the test sequence. May include
      * patterns with "*", "@*" or "node()" kernel.
      */
-    private Vector _patterns = null;
+    private List<LocationPathPattern> _patterns = null;
 
     /**
      * A reference to the Mode object.
@@ -84,11 +85,11 @@
     /**
      * Creates a new test sequence given a set of patterns and a mode.
      */
-    public TestSeq(Vector patterns, Mode mode) {
+    public TestSeq(List<LocationPathPattern> patterns, Mode mode) {
         this(patterns, -2, mode);
     }
 
-    public TestSeq(Vector patterns, int kernelType, Mode mode) {
+    public TestSeq(List<LocationPathPattern> patterns, int kernelType, Mode mode) {
         _patterns = patterns;
         _kernelType = kernelType;
         _mode = mode;
@@ -104,8 +105,7 @@
         final StringBuffer result = new StringBuffer();
 
         for (int i = 0; i < count; i++) {
-            final LocationPathPattern pattern =
-                (LocationPathPattern) _patterns.elementAt(i);
+            final LocationPathPattern pattern = _patterns.get(i);
 
             if (i == 0) {
                 result.append("Testseq for kernel ").append(_kernelType)
@@ -131,8 +131,8 @@
      * of the default pattern.
      */
     public double getPriority() {
-        final Template template = (_patterns.size() == 0) ? _default
-            : ((Pattern) _patterns.elementAt(0)).getTemplate();
+        final Template template = (_patterns.isEmpty()) ? _default
+            : ((Pattern) _patterns.get(0)).getTemplate();
         return template.getPriority();
     }
 
@@ -141,8 +141,8 @@
      * this test sequence.
      */
     public int getPosition() {
-        final Template template = (_patterns.size() == 0) ? _default
-            : ((Pattern) _patterns.elementAt(0)).getTemplate();
+        final Template template = (_patterns.isEmpty()) ? _default
+            : ((Pattern) _patterns.get(0)).getTemplate();
         return template.getPosition();
     }
 
@@ -152,13 +152,9 @@
      * finds a patterns that is fully reduced.
      */
     public void reduce() {
-        final Vector newPatterns = new Vector();
+        final List<LocationPathPattern> newPatterns = new ArrayList<>();
 
-        final int count = _patterns.size();
-        for (int i = 0; i < count; i++) {
-            final LocationPathPattern pattern =
-                (LocationPathPattern)_patterns.elementAt(i);
-
+        for (LocationPathPattern pattern : _patterns) {
             // Reduce this pattern
             pattern.reduceKernelPattern();
 
@@ -168,7 +164,7 @@
                 break;          // Ignore following patterns
             }
             else {
-                newPatterns.addElement(pattern);
+                newPatterns.add(pattern);
             }
         }
         _patterns = newPatterns;
@@ -183,9 +179,7 @@
         if (_default != null) {
             templates.put(_default, this);
         }
-        for (int i = 0; i < _patterns.size(); i++) {
-            final LocationPathPattern pattern =
-                (LocationPathPattern)_patterns.elementAt(i);
+        for (LocationPathPattern pattern : _patterns) {
             templates.put(pattern.getTemplate(), this);
         }
     }
@@ -204,7 +198,7 @@
      * Returns pattern n in this test sequence
      */
     private LocationPathPattern getPattern(int n) {
-        return (LocationPathPattern)_patterns.elementAt(n);
+        return _patterns.get(n);
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TopLevelElement.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TopLevelElement.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
@@ -30,6 +28,8 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.ArrayList;
+import java.util.List;
 
 class TopLevelElement extends SyntaxTreeNode {
 
@@ -37,7 +37,7 @@
      * List of dependencies with other variables, parameters or
      * keys defined at the top level.
      */
-    protected Vector _dependencies = null;
+    protected List<SyntaxTreeNode> _dependencies = null;
 
     /**
      * Type check all the children of this node.
@@ -80,10 +80,10 @@
      */
     public void addDependency(TopLevelElement other) {
         if (_dependencies == null) {
-            _dependencies = new Vector();
+            _dependencies = new ArrayList<>();
         }
         if (!_dependencies.contains(other)) {
-            _dependencies.addElement(other);
+            _dependencies.add(other);
         }
     }
 
@@ -91,7 +91,7 @@
      * Get the list of dependencies with other top-level elements
      * like variables, parameteres or keys.
      */
-    public Vector getDependencies() {
+    public List<SyntaxTreeNode> getDependencies() {
         return _dependencies;
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnaryOpExpr.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnaryOpExpr.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
@@ -66,7 +66,7 @@
                                                              tleft));
 
         if (ptype != null) {
-            final Type arg1 = (Type) ptype.argsType().elementAt(0);
+            final Type arg1 = ptype.argsType().get(0);
             if (!arg1.identicalTo(tleft)) {
                 _left = new CastExpr(_left, arg1);
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
@@ -35,6 +33,8 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xml.internal.dtm.Axis;
 import com.sun.org.apache.xml.internal.dtm.DTM;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -57,7 +57,7 @@
     public void setParser(Parser parser) {
         super.setParser(parser);
         // find all expressions in this Union
-        final Vector components = new Vector();
+        final List<Expression> components = new ArrayList<>();
         flatten(components);
         final int size = components.size();
         _components = (Expression[])components.toArray(new Expression[size]);
@@ -95,14 +95,14 @@
         return "union(" + _pathExpr + ", " + _rest + ')';
     }
 
-    private void flatten(Vector components) {
-        components.addElement(_pathExpr);
+    private void flatten(List<Expression> components) {
+        components.add(_pathExpr);
         if (_rest != null) {
             if (_rest instanceof UnionPathExpr) {
                 ((UnionPathExpr)_rest).flatten(components);
             }
             else {
-                components.addElement(_rest);
+                components.add(_rest);
             }
         }
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnparsedEntityUriCall.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnparsedEntityUriCall.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,8 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
@@ -31,6 +29,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -40,7 +39,7 @@
 final class UnparsedEntityUriCall extends FunctionCall {
     private Expression _entity;
 
-    public UnparsedEntityUriCall(QName fname, Vector arguments) {
+    public UnparsedEntityUriCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
         _entity = argument();
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,19 +24,17 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.bcel.internal.generic.PUSH;
-
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -43,7 +42,7 @@
  */
 final class UnsupportedElement extends SyntaxTreeNode {
 
-    private Vector _fallbacks = null;
+    private List<SyntaxTreeNode> _fallbacks = null;
     private ErrorMsg _message = null;
     private boolean _isExtension = false;
 
@@ -94,9 +93,9 @@
                     fallback.activate();
                     fallback.parseContents(parser);
                     if (_fallbacks == null) {
-                        _fallbacks = new Vector();
+                        _fallbacks = new ArrayList<>();
                     }
-                    _fallbacks.addElement(child);
+                    _fallbacks.add(child);
                 }
             }
         }
@@ -116,7 +115,7 @@
         if (_fallbacks != null) {
             int count = _fallbacks.size();
             for (int i = 0; i < count; i++) {
-                Fallback fallback = (Fallback)_fallbacks.elementAt(i);
+                Fallback fallback = (Fallback)_fallbacks.get(i);
                 fallback.typeCheck(stable);
             }
         }
@@ -130,7 +129,7 @@
         if (_fallbacks != null) {
             int count = _fallbacks.size();
             for (int i = 0; i < count; i++) {
-                Fallback fallback = (Fallback)_fallbacks.elementAt(i);
+                Fallback fallback = (Fallback)_fallbacks.get(i);
                 fallback.translate(classGen, methodGen);
             }
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UseAttributeSets.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UseAttributeSets.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,9 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.StringTokenizer;
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
@@ -32,6 +29,9 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
 
 /**
  * @author Jacek Ambroziak
@@ -45,7 +45,7 @@
         "";
 
     // Contains the names of all references attribute sets
-    private final Vector _sets = new Vector(2);
+    private final List<QName> _sets = new ArrayList<>(2);
 
     /**
      * Constructur - define initial attribute sets to use
@@ -87,10 +87,7 @@
         final InstructionList il = methodGen.getInstructionList();
         final SymbolTable symbolTable = getParser().getSymbolTable();
 
-        // Go through each attribute set and generate a method call
-        for (int i=0; i<_sets.size(); i++) {
-            // Get the attribute set name
-            final QName name = (QName)_sets.elementAt(i);
+        for (QName name : _sets) {
             // Get the AttributeSet reference from the symbol table
             final AttributeSet attrs = symbolTable.lookupAttributeSet(name);
             // Compile the call to the set's method if the set exists
@@ -102,7 +99,7 @@
                 il.append(methodGen.loadHandler());
                 il.append(methodGen.loadCurrentNode());
                 final int method = cpg.addMethodref(classGen.getClassName(),
-                                                    methodName, ATTR_SET_SIG);
+                        methodName, ATTR_SET_SIG);
                 il.append(new INVOKESPECIAL(method));
             }
             // Generate an error if the attribute set does not exist
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableBase.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableBase.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,15 +21,13 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
+import com.sun.org.apache.bcel.internal.generic.Instruction;
+import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
 import com.sun.org.apache.bcel.internal.generic.NEW;
 import com.sun.org.apache.bcel.internal.generic.PUSH;
@@ -40,6 +39,8 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
 import com.sun.org.apache.xml.internal.utils.XML11Char;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -61,7 +62,7 @@
     protected String      select;            // Textual repr. of variable expr.
 
     // References to this variable (when local)
-    protected Vector<VariableRefBase> _refs = new Vector<>(2);
+    protected List<VariableRefBase> _refs = new ArrayList<>(2);
 
     // Used to make sure parameter field is not added twice
     protected boolean    _ignore = false;
@@ -78,7 +79,7 @@
      * expression contains a reference to this variable.
      */
     public void addReference(VariableRefBase vref) {
-        _refs.addElement(vref);
+        _refs.add(vref);
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Whitespace.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Whitespace.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,9 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.StringTokenizer;
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ALOAD;
 import com.sun.org.apache.bcel.internal.generic.BranchHandle;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
@@ -40,6 +37,9 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
 
 /**
  * @author Morten Jorgensen
@@ -63,7 +63,7 @@
     /**
      * Auxillary class for encapsulating a single strip/preserve rule
      */
-    private final static class WhitespaceRule {
+    final static class WhitespaceRule {
         private final int _action;
         private String _namespace; // Should be replaced by NS type (int)
         private String _element;   // Should be replaced by node type (int)
@@ -174,8 +174,8 @@
      * De-tokenize the elements listed in the 'elements' attribute and
      * instanciate a set of strip/preserve rules.
      */
-    public Vector getRules() {
-        final Vector rules = new Vector();
+    public List<WhitespaceRule> getRules() {
+        final List<WhitespaceRule> rules = new ArrayList<>();
         // Go through each element and instanciate strip/preserve-object
         final StringTokenizer list = new StringTokenizer(_elementList);
         while (list.hasMoreElements()) {
@@ -191,35 +191,33 @@
      * Scans through the rules vector and looks for a rule of higher
      * priority that contradicts the current rule.
      */
-    private static WhitespaceRule findContradictingRule(Vector rules,
+    private static WhitespaceRule findContradictingRule(List<WhitespaceRule> rules,
                                                         WhitespaceRule rule) {
-        for (int i = 0; i < rules.size(); i++) {
-            // Get the next rule in the prioritized list
-            WhitespaceRule currentRule = (WhitespaceRule)rules.elementAt(i);
+        for (WhitespaceRule currentRule : rules) {
             // We only consider rules with higher priority
             if (currentRule == rule) {
                 return null;
             }
 
             /*
-             * See if there is a contradicting rule with higher priority.
-             * If the rules has the same action then this rule is redundant,
-             * if they have different action then this rule will never win.
-             */
+            * See if there is a contradicting rule with higher priority.
+            * If the rules has the same action then this rule is redundant,
+            * if they have different action then this rule will never win.
+            */
             switch (currentRule.getStrength()) {
-            case RULE_ALL:
-                return currentRule;
+                case RULE_ALL:
+                    return currentRule;
 
-            case RULE_ELEMENT:
-                if (!rule.getElement().equals(currentRule.getElement())) {
-                    break;
-                }
+                case RULE_ELEMENT:
+                    if (!rule.getElement().equals(currentRule.getElement())) {
+                        break;
+                    }
                 // intentional fall-through
-            case RULE_NAMESPACE:
-                if (rule.getNamespace().equals(currentRule.getNamespace())) {
-                    return currentRule;
-                }
-                break;
+                case RULE_NAMESPACE:
+                    if (rule.getNamespace().equals(currentRule.getNamespace())) {
+                        return currentRule;
+                    }
+                    break;
             }
         }
         return null;
@@ -230,7 +228,7 @@
      * Orders a set or rules by priority, removes redundant rules and rules
      * that are shadowed by stronger, contradicting rules.
      */
-    private static int prioritizeRules(Vector rules) {
+    private static int prioritizeRules(List<WhitespaceRule> rules) {
         WhitespaceRule currentRule;
         int defaultAction = PRESERVE_SPACE;
 
@@ -242,20 +240,20 @@
         // elements and signal that all whitespaces should be preserved
         boolean strip = false;
         for (int i = 0; i < rules.size(); i++) {
-            currentRule = (WhitespaceRule)rules.elementAt(i);
+            currentRule = rules.get(i);
             if (currentRule.getAction() == STRIP_SPACE) {
                 strip = true;
             }
         }
         // Return with default action: PRESERVE_SPACE
         if (!strip) {
-            rules.removeAllElements();
+            rules.clear();
             return PRESERVE_SPACE;
         }
 
         // Remove all rules that are contradicted by rules with higher priority
         for (int idx = 0; idx < rules.size(); ) {
-            currentRule = (WhitespaceRule)rules.elementAt(idx);
+            currentRule = rules.get(idx);
 
             // Remove this single rule if it has no purpose
             if (findContradictingRule(rules,currentRule) != null) {
@@ -266,7 +264,7 @@
                 if (currentRule.getStrength() == RULE_ALL) {
                     defaultAction = currentRule.getAction();
                     for (int i = idx; i < rules.size(); i++) {
-                        rules.removeElementAt(i);
+                        rules.remove(i);
                     }
                 }
                 // Skip to next rule (there might not be any)...
@@ -275,16 +273,16 @@
         }
 
         // The rules vector could be empty if first rule has strength RULE_ALL
-        if (rules.size() == 0) {
+        if (rules.isEmpty()) {
             return defaultAction;
         }
 
         // Now work backwards and strip away all rules that have the same
         // action as the default rule (no reason the check them at the end).
         do {
-            currentRule = (WhitespaceRule)rules.lastElement();
+            currentRule = rules.get(rules.size() - 1);
             if (currentRule.getAction() == defaultAction) {
-                rules.removeElementAt(rules.size() - 1);
+                rules.remove(rules.size() - 1);
             }
             else {
                 break;
@@ -330,7 +328,7 @@
     /**
      * Compiles the predicate method
      */
-    private static void compilePredicate(Vector rules,
+    private static void compilePredicate(List<WhitespaceRule> rules,
                                          int defaultAction,
                                          ClassGenerator classGen) {
         final ConstantPoolGen cpg = classGen.getConstantPool();
@@ -363,7 +361,7 @@
         // Traverse all strip/preserve rules
         for (int i = 0; i<rules.size(); i++) {
             // Get the next rule in the prioritised list
-            WhitespaceRule rule = (WhitespaceRule)rules.elementAt(i);
+            WhitespaceRule rule = rules.get(i);
 
             // Returns the namespace for a node in the DOM
             final int gns = cpg.addInterfaceMethodref(DOM_INTF,
@@ -467,7 +465,7 @@
      *    - STRIP_SPACE    (always strip whitespace text-nodes)
      *    - PRESERVE_SPACE (always preserve whitespace text-nodes)
      */
-    public static int translateRules(Vector rules,
+    public static int translateRules(List<WhitespaceRule> rules,
                                      ClassGenerator classGen) {
         // Get the core rules in prioritized order
         final int defaultAction = prioritizeRules(rules);
@@ -485,7 +483,7 @@
     /**
      * Sorts a range of rules with regard to PRIORITY only
      */
-    private static void quicksort(Vector rules, int p, int r) {
+    private static void quicksort(List<WhitespaceRule> rules, int p, int r) {
         while (p < r) {
             final int q = partition(rules, p, r);
             quicksort(rules, p, q);
@@ -496,18 +494,18 @@
     /**
      * Used with quicksort method above
      */
-    private static int partition(Vector rules, int p, int r) {
-        final WhitespaceRule x = (WhitespaceRule)rules.elementAt((p+r) >>> 1);
+    private static int partition(List<WhitespaceRule> rules, int p, int r) {
+        final WhitespaceRule x = rules.get((p+r) >>> 1);
         int i = p - 1, j = r + 1;
         while (true) {
-            while (x.compareTo((WhitespaceRule)rules.elementAt(--j)) < 0) {
+            while (x.compareTo(rules.get(--j)) < 0) {
             }
-            while (x.compareTo((WhitespaceRule)rules.elementAt(++i)) > 0) {
+            while (x.compareTo(rules.get(++i)) > 0) {
             }
             if (i < j) {
-                final WhitespaceRule tmp = (WhitespaceRule)rules.elementAt(i);
-                rules.setElementAt(rules.elementAt(j), i);
-                rules.setElementAt(tmp, j);
+                final WhitespaceRule tmp = rules.get(i);
+                rules.set(i, rules.get(j));
+                rules.set(j, tmp);
             }
             else {
                 return j;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java	Wed Oct 18 13:25:49 2017 -0700
@@ -25,27 +25,27 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Stack;
-import java.util.Vector;
-import java.io.StringReader;
 import com.sun.java_cup.internal.runtime.*;
+import com.sun.org.apache.xalan.internal.xsltc.DOM;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
+import com.sun.org.apache.xalan.internal.xsltc.runtime.Operators;
+import com.sun.org.apache.xml.internal.dtm.Axis;
 import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Operators;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
 
 /**
  * CUP v0.10j generated parser.
  * This class was generated by CUP v0.10j on Thu Oct 06 10:09:26 PDT 2005.
  */
-public class XPathParser extends com.sun.java_cup.internal.runtime.lr_parser {
+public class XPathParser extends lr_parser {
 
   /** Default constructor. */
   public XPathParser() {super();}
 
   /** Constructor which sets the default scanner. */
-  public XPathParser(com.sun.java_cup.internal.runtime.Scanner s) {super(s);}
+  public XPathParser(Scanner s) {super(s);}
 
   /** Production table. */
   protected static final short _production_table[][] =
@@ -842,24 +842,24 @@
   public short[][] reduce_table() {return _reduce_table;}
 
   /** Instance of action encapsulation class. */
-  protected CUP$XPathParser$actions action_obj;
+  protected parser_actions action_obj;
 
   /** Action encapsulation object initializer. */
   protected void init_actions()
     {
-      action_obj = new CUP$XPathParser$actions(this);
+      action_obj = new parser_actions(this);
     }
 
   /** Invoke a user supplied parse action. */
-  public com.sun.java_cup.internal.runtime.Symbol do_action(
+  public Symbol do_action(
     int                        act_num,
-    com.sun.java_cup.internal.runtime.lr_parser parser,
-    java.util.Stack            stack,
+    lr_parser parser,
+    Stack<Symbol>            stack,
     int                        top)
     throws java.lang.Exception
   {
     /* call code in generated class */
-    return action_obj.CUP$XPathParser$do_action(act_num, parser, stack, top);
+    return action_obj.parser_do_action(act_num, parser, stack, top);
   }
 
   /** Indicates start state. */
@@ -878,7 +878,7 @@
     /**
      * Used by function calls with no args.
      */
-    static public final Vector EmptyArgs = new Vector(0);
+    static public final List<Expression> EmptyArgs = new ArrayList<>(0);
 
     /**
      * Reference to non-existing variable.
@@ -947,7 +947,7 @@
      * expansion to be correct, the priority of the pattern/template must be
      * set to -0.25 (when no other predicates are present).
      */
-    public StepPattern createStepPattern(int axis, Object test, Vector predicates) {
+    public StepPattern createStepPattern(int axis, Object test, List<Predicate> predicates) {
         int nodeType;
 
         if (test == null) {  // "*"
@@ -978,7 +978,7 @@
                 // Expand {uri}:* to *[namespace-uri() = 'uri'] - same for @*
                 if (uri != null && (local.equals("*") || local.equals("@*"))) {
                     if (predicates == null) {
-                        predicates = new Vector(2);
+                        predicates = new ArrayList<>(2);
                     }
 
                     // Priority is set by hand if no other predicates exist
@@ -1130,363 +1130,366 @@
 }
 
 /** Cup generated class to encapsulate user supplied action code.*/
-class CUP$XPathParser$actions {
+class parser_actions {
   private final XPathParser parser;
 
   /** Constructor */
-  CUP$XPathParser$actions(XPathParser parser) {
+  parser_actions(XPathParser parser) {
     this.parser = parser;
   }
 
   /** Method with the actual generated action code. */
-  public final com.sun.java_cup.internal.runtime.Symbol CUP$XPathParser$do_action(
-    int                        CUP$XPathParser$act_num,
-    com.sun.java_cup.internal.runtime.lr_parser CUP$XPathParser$parser,
-    java.util.Stack            CUP$XPathParser$stack,
-    int                        CUP$XPathParser$top)
+  public final Symbol parser_do_action(
+    int                        parser_act_num,
+    lr_parser parser_parser,
+    Stack<Symbol>            parser_stack,
+    int                        parser_top)
     throws java.lang.Exception
     {
       /* Symbol object for return from actions */
-      com.sun.java_cup.internal.runtime.Symbol CUP$XPathParser$result;
+      Symbol parser_result;
 
       /* select the action based on the action number */
-      switch (CUP$XPathParser$act_num)
+      switch (parser_act_num)
         {
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 140: // QName ::= ID
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("id");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 139: // QName ::= SELF
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("self");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 138: // QName ::= PRECEDINGSIBLING
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("preceding-sibling");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 137: // QName ::= PRECEDING
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("preceding");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 136: // QName ::= PARENT
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("parent");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 135: // QName ::= NAMESPACE
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("namespace");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 134: // QName ::= FOLLOWINGSIBLING
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("following-sibling");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 133: // QName ::= FOLLOWING
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("following");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 132: // QName ::= DESCENDANTORSELF
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("decendant-or-self");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 131: // QName ::= DESCENDANT
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("decendant");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 130: // QName ::= CHILD
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("child");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 129: // QName ::= ATTRIBUTE
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("attribute");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 128: // QName ::= ANCESTORORSELF
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("ancestor-or-self");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 127: // QName ::= ANCESTOR
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("child");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 126: // QName ::= KEY
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("key");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 125: // QName ::= MOD
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("mod");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 124: // QName ::= DIV
             {
               QName RESULT = null;
                  RESULT = parser.getQNameIgnoreDefaultNs("div");
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 123: // QName ::= QNAME
             {
               QName RESULT = null;
-                int qnameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int qnameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                String qname = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int qnameleft = (parser_stack.get(parser_top-0)).left;
+                int qnameright = (parser_stack.get(parser_top-0)).right;
+                String qname = (String)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = parser.getQNameIgnoreDefaultNs(qname);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 122: // NameTest ::= QName
             {
               Object RESULT = null;
-                int qnleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int qnright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                QName qn = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int qnleft = (parser_stack.get(parser_top-0)).left;
+                int qnright = (parser_stack.get(parser_top-0)).right;
+                QName qn = (QName)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = qn;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(26/*NameTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(26/*NameTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 121: // NameTest ::= STAR
             {
               Object RESULT = null;
                  RESULT = null;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(26/*NameTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(26/*NameTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 120: // NodeTest ::= PI
             {
               Object RESULT = null;
                  RESULT = Integer.valueOf(NodeTest.PI);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(25/*NodeTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 119: // NodeTest ::= PIPARAM LPAREN Literal RPAREN
             {
               Object RESULT = null;
-                int lleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int lright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                String l = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
+                int lleft = (parser_stack.get(parser_top-1)).left;
+                int lright = (parser_stack.get(parser_top-1)).right;
+                String l = (String)((Symbol) parser_stack.get(parser_top-1)).value;
 
            QName name = parser.getQNameIgnoreDefaultNs("name");
            Expression exp = new EqualityExpr(Operators.EQ,
                                              new NameCall(name),
                                              new LiteralExpr(l));
-           Vector predicates = new Vector();
-           predicates.addElement(new Predicate(exp));
+           List<Predicate> predicates = new ArrayList<>();
+           predicates.add(new Predicate(exp));
            RESULT = new Step(Axis.CHILD, NodeTest.PI, predicates);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(25/*NodeTest*/, (parser_stack.get(parser_top-3)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 118: // NodeTest ::= COMMENT
             {
               Object RESULT = null;
                  RESULT = Integer.valueOf(NodeTest.COMMENT);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(25/*NodeTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 117: // NodeTest ::= TEXT
             {
               Object RESULT = null;
                  RESULT = Integer.valueOf(NodeTest.TEXT);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(25/*NodeTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 116: // NodeTest ::= NODE
             {
               Object RESULT = null;
                  RESULT = Integer.valueOf(NodeTest.ANODE);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(25/*NodeTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 115: // NodeTest ::= NameTest
             {
               Object RESULT = null;
-                int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ntleft = (parser_stack.get(parser_top-0)).left;
+                int ntright = (parser_stack.get(parser_top-0)).right;
+                Object nt = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = nt;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(25/*NodeTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 114: // Argument ::= Expr
             {
               Expression RESULT = null;
-                int exleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int exright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ex = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int exleft = (parser_stack.get(parser_top-0)).left;
+                int exright = (parser_stack.get(parser_top-0)).right;
+                Expression ex = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = ex;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(3/*Argument*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(3/*Argument*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 113: // VariableName ::= QName
             {
               QName RESULT = null;
-                int vnameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int vnameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                QName vname = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int vnameleft = (parser_stack.get(parser_top-0)).left;
+                int vnameright = (parser_stack.get(parser_top-0)).right;
+                QName vname = (QName)((Symbol) parser_stack.get(parser_top-0)).value;
 
             RESULT = vname;
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(39/*VariableName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(39/*VariableName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 112: // FunctionName ::= QName
             {
               QName RESULT = null;
-                int fnameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int fnameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                QName fname = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int fnameleft = (parser_stack.get(parser_top-0)).left;
+                int fnameright = (parser_stack.get(parser_top-0)).right;
+                QName fname = (QName)((Symbol) parser_stack.get(parser_top-0)).value;
 
             RESULT = fname;
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(38/*FunctionName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(38/*FunctionName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 111: // NonemptyArgumentList ::= Argument COMMA NonemptyArgumentList
             {
-              Vector RESULT = null;
-                int argleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int argright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression arg = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int arglleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int arglright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Vector argl = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-                 argl.insertElementAt(arg, 0); RESULT = argl;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(36/*NonemptyArgumentList*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+                List<Expression> RESULT = null;
+                int argleft = (parser_stack.get(parser_top-2)).left;
+                int argright = (parser_stack.get(parser_top-2)).right;
+                Expression arg = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int arglleft = (parser_stack.get(parser_top-0)).left;
+                int arglright = (parser_stack.get(parser_top-0)).right;
+                @SuppressWarnings("unchecked")
+                List<Expression> argl = (ArrayList<Expression>)((Symbol) parser_stack.get(parser_top-0)).value;
+                argl.add(0, arg);
+                RESULT = argl;
+              parser_result = new Symbol(36/*NonemptyArgumentList*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 110: // NonemptyArgumentList ::= Argument
             {
-              Vector RESULT = null;
-                int argleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int argright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression arg = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+              List<Expression> RESULT = null;
+                int argleft = (parser_stack.get(parser_top-0)).left;
+                int argright = (parser_stack.get(parser_top-0)).right;
+                Expression arg = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
 
-            Vector temp = new Vector();
-            temp.addElement(arg);
+            List<Expression> temp = new ArrayList<>();
+            temp.add(arg);
             RESULT = temp;
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(36/*NonemptyArgumentList*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(36/*NonemptyArgumentList*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 109: // FunctionCall ::= FunctionName LPAREN NonemptyArgumentList RPAREN
             {
-              Expression RESULT = null;
-                int fnameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left;
-                int fnameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).right;
-                QName fname = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).value;
-                int arglleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int arglright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Vector argl = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
+                Expression RESULT = null;
+                int fnameleft = (parser_stack.get(parser_top-3)).left;
+                int fnameright = (parser_stack.get(parser_top-3)).right;
+                QName fname = (QName)((Symbol) parser_stack.get(parser_top-3)).value;
+                int arglleft = (parser_stack.get(parser_top-1)).left;
+                int arglright = (parser_stack.get(parser_top-1)).right;
+                @SuppressWarnings("unchecked")
+                List<Expression> argl = (ArrayList<Expression>)((Symbol) parser_stack.get(parser_top-1)).value;
 
           if (fname == parser.getQNameIgnoreDefaultNs("concat")) {
             RESULT = new ConcatCall(fname, argl);
@@ -1571,17 +1574,17 @@
             RESULT = new FunctionCall(fname, argl);
           }
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(16/*FunctionCall*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(16/*FunctionCall*/, (parser_stack.get(parser_top-3)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 108: // FunctionCall ::= FunctionName LPAREN RPAREN
             {
               Expression RESULT = null;
-                int fnameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int fnameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                QName fname = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
+                int fnameleft = (parser_stack.get(parser_top-2)).left;
+                int fnameright = (parser_stack.get(parser_top-2)).right;
+                QName fname = (QName)((Symbol) parser_stack.get(parser_top-2)).value;
 
 
           if (fname == parser.getQNameIgnoreDefaultNs("current")) {
@@ -1627,17 +1630,17 @@
             RESULT = new FunctionCall(fname, parser.EmptyArgs);
           }
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(16/*FunctionCall*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(16/*FunctionCall*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 107: // VariableReference ::= DOLLAR VariableName
             {
               Expression RESULT = null;
-                int varNameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int varNameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                QName varName = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int varNameleft = (parser_stack.get(parser_top-0)).left;
+                int varNameright = (parser_stack.get(parser_top-0)).right;
+                QName varName = (QName)((Symbol) parser_stack.get(parser_top-0)).value;
 
             // An empty qname prefix for a variable or parameter reference
             // should map to the null namespace and not the default URI.
@@ -1659,41 +1662,41 @@
                 RESULT = new UnresolvedRef(varName);
             }
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(15/*VariableReference*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(15/*VariableReference*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 106: // PrimaryExpr ::= FunctionCall
             {
               Expression RESULT = null;
-                int fcleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int fcright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression fc = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int fcleft = (parser_stack.get(parser_top-0)).left;
+                int fcright = (parser_stack.get(parser_top-0)).right;
+                Expression fc = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = fc;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 105: // PrimaryExpr ::= REAL
             {
               Expression RESULT = null;
-                int numleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int numright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Double num = (Double)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int numleft = (parser_stack.get(parser_top-0)).left;
+                int numright = (parser_stack.get(parser_top-0)).right;
+                Double num = (Double)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new RealExpr(num.doubleValue());
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 104: // PrimaryExpr ::= INT
             {
               Expression RESULT = null;
-                int numleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int numright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Long num = (Long)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int numleft = (parser_stack.get(parser_top-0)).left;
+                int numright = (parser_stack.get(parser_top-0)).right;
+                Long num = (Long)((Symbol) parser_stack.get(parser_top-0)).value;
 
            long value = num.longValue();
            if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
@@ -1710,17 +1713,17 @@
                    RESULT = new IntExpr(num.intValue());
            }
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 103: // PrimaryExpr ::= Literal
             {
               Expression RESULT = null;
-                int stringleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int stringright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                String string = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int stringleft = (parser_stack.get(parser_top-0)).left;
+                int stringright = (parser_stack.get(parser_top-0)).right;
+                String string = (String)((Symbol) parser_stack.get(parser_top-0)).value;
 
         /*
         * If the string appears to have the syntax of a QName, store
@@ -1738,278 +1741,281 @@
         RESULT = (namespace == null) ? new LiteralExpr(string)
                      : new LiteralExpr(string, namespace);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 102: // PrimaryExpr ::= LPAREN Expr RPAREN
             {
               Expression RESULT = null;
-                int exleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int exright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Expression ex = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
+                int exleft = (parser_stack.get(parser_top-1)).left;
+                int exright = (parser_stack.get(parser_top-1)).right;
+                Expression ex = (Expression)((Symbol) parser_stack.get(parser_top-1)).value;
                  RESULT = ex;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 101: // PrimaryExpr ::= VariableReference
             {
               Expression RESULT = null;
-                int vrleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int vrright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression vr = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int vrleft = (parser_stack.get(parser_top-0)).left;
+                int vrright = (parser_stack.get(parser_top-0)).right;
+                Expression vr = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = vr;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 100: // FilterExpr ::= PrimaryExpr Predicates
             {
               Expression RESULT = null;
-                int primaryleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int primaryright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Expression primary = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int primaryleft = (parser_stack.get(parser_top-1)).left;
+                int primaryright = (parser_stack.get(parser_top-1)).right;
+                Expression primary = (Expression)((Symbol) parser_stack.get(parser_top-1)).value;
+                int ppleft = (parser_stack.get(parser_top-0)).left;
+                int ppright = (parser_stack.get(parser_top-0)).right;
+                @SuppressWarnings("unchecked")
+                List<Expression> pp = (ArrayList<Expression>)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new FilterExpr(primary, pp);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(6/*FilterExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(6/*FilterExpr*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 99: // FilterExpr ::= PrimaryExpr
             {
               Expression RESULT = null;
-                int primaryleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int primaryright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression primary = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int primaryleft = (parser_stack.get(parser_top-0)).left;
+                int primaryright = (parser_stack.get(parser_top-0)).right;
+                Expression primary = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = primary;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(6/*FilterExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(6/*FilterExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 98: // AbbreviatedStep ::= DDOT
             {
               Expression RESULT = null;
                  RESULT = new Step(Axis.PARENT, NodeTest.ANODE, null);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(20/*AbbreviatedStep*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(20/*AbbreviatedStep*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 97: // AbbreviatedStep ::= DOT
             {
               Expression RESULT = null;
                  RESULT = new Step(Axis.SELF, NodeTest.ANODE, null);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(20/*AbbreviatedStep*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(20/*AbbreviatedStep*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 96: // AxisName ::= SELF
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.SELF);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 95: // AxisName ::= PRECEDINGSIBLING
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.PRECEDINGSIBLING);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 94: // AxisName ::= PRECEDING
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.PRECEDING);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 93: // AxisName ::= PARENT
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.PARENT);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 92: // AxisName ::= NAMESPACE
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.NAMESPACE);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 91: // AxisName ::= FOLLOWINGSIBLING
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.FOLLOWINGSIBLING);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 90: // AxisName ::= FOLLOWING
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.FOLLOWING);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 89: // AxisName ::= DESCENDANTORSELF
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.DESCENDANTORSELF);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 88: // AxisName ::= DESCENDANT
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.DESCENDANT);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 87: // AxisName ::= CHILD
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.CHILD);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 86: // AxisName ::= ATTRIBUTE
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.ATTRIBUTE);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 85: // AxisName ::= ANCESTORORSELF
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.ANCESTORORSELF);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 84: // AxisName ::= ANCESTOR
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.ANCESTOR);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(40/*AxisName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 83: // AxisSpecifier ::= ATSIGN
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.ATTRIBUTE);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(41/*AxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(41/*AxisSpecifier*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 82: // AxisSpecifier ::= AxisName DCOLON
             {
               Integer RESULT = null;
-                int anleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int anright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Integer an = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
+                int anleft = (parser_stack.get(parser_top-1)).left;
+                int anright = (parser_stack.get(parser_top-1)).right;
+                Integer an = (Integer)((Symbol) parser_stack.get(parser_top-1)).value;
                  RESULT = an;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(41/*AxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(41/*AxisSpecifier*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 81: // Step ::= AbbreviatedStep
             {
               Expression RESULT = null;
-                int abbrevleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int abbrevright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression abbrev = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int abbrevleft = (parser_stack.get(parser_top-0)).left;
+                int abbrevright = (parser_stack.get(parser_top-0)).right;
+                Expression abbrev = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = abbrev;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(7/*Step*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(7/*Step*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 80: // Step ::= AxisSpecifier NodeTest
             {
               Expression RESULT = null;
-                int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int ntestleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ntestright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Object ntest = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int axisleft = (parser_stack.get(parser_top-1)).left;
+                int axisright = (parser_stack.get(parser_top-1)).right;
+                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-1)).value;
+                int ntestleft = (parser_stack.get(parser_top-0)).left;
+                int ntestright = (parser_stack.get(parser_top-0)).right;
+                Object ntest = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new Step(axis.intValue(),
                              parser.findNodeType(axis.intValue(), ntest),
                              null);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(7/*Step*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(7/*Step*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 79: // Step ::= AxisSpecifier NodeTest Predicates
             {
               Expression RESULT = null;
-                int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int ntestleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int ntestright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Object ntest = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int axisleft = (parser_stack.get(parser_top-2)).left;
+                int axisright = (parser_stack.get(parser_top-2)).right;
+                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-2)).value;
+                int ntestleft = (parser_stack.get(parser_top-1)).left;
+                int ntestright = (parser_stack.get(parser_top-1)).right;
+                Object ntest = (Object)((Symbol) parser_stack.get(parser_top-1)).value;
+                int ppleft = (parser_stack.get(parser_top-0)).left;
+                int ppright = (parser_stack.get(parser_top-0)).right;
+                @SuppressWarnings("unchecked")
+                List<Predicate> pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new Step(axis.intValue(),
                              parser.findNodeType(axis.intValue(), ntest),
                              pp);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(7/*Step*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(7/*Step*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 78: // Step ::= NodeTest Predicates
             {
               Expression RESULT = null;
-                int ntestleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int ntestright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Object ntest = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ntestleft = (parser_stack.get(parser_top-1)).left;
+                int ntestright = (parser_stack.get(parser_top-1)).right;
+                Object ntest = (Object)((Symbol) parser_stack.get(parser_top-1)).value;
+                int ppleft = (parser_stack.get(parser_top-0)).left;
+                int ppright = (parser_stack.get(parser_top-0)).right;
+                @SuppressWarnings("unchecked")
+                List<Predicate> pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
 
             if (ntest instanceof Step) {
                 Step step = (Step)ntest;
@@ -2021,17 +2027,17 @@
                              parser.findNodeType(Axis.CHILD, ntest), pp);
             }
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(7/*Step*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(7/*Step*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 77: // Step ::= NodeTest
             {
               Expression RESULT = null;
-                int ntestleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ntestright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Object ntest = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ntestleft = (parser_stack.get(parser_top-0)).left;
+                int ntestright = (parser_stack.get(parser_top-0)).right;
+                Object ntest = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
 
             if (ntest instanceof Step) {
                 RESULT = (Step)ntest;
@@ -2042,17 +2048,17 @@
                              null);
             }
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(7/*Step*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(7/*Step*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 76: // AbbreviatedAbsoluteLocationPath ::= DSLASH RelativeLocationPath
             {
               Expression RESULT = null;
-                int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int rlpleft = (parser_stack.get(parser_top-0)).left;
+                int rlpright = (parser_stack.get(parser_top-0)).right;
+                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
 
            //
            // Expand '//' into '/descendant-or-self::node()/' or
@@ -2068,25 +2074,25 @@
            RESULT = new AbsoluteLocationPath(parser.insertStep(step,
                                 (RelativeLocationPath) rlp));
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(24/*AbbreviatedAbsoluteLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(24/*AbbreviatedAbsoluteLocationPath*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 75: // AbbreviatedRelativeLocationPath ::= RelativeLocationPath DSLASH Step
             {
               Expression RESULT = null;
-                int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int stepleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int stepright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression step = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int rlpleft = (parser_stack.get(parser_top-2)).left;
+                int rlpright = (parser_stack.get(parser_top-2)).right;
+                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int stepleft = (parser_stack.get(parser_top-0)).left;
+                int stepright = (parser_stack.get(parser_top-0)).right;
+                Expression step = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
 
            final Step right  = (Step)step;
            final int  axis   = right.getAxis();
            final int  type   = right.getNodeType();
-           final Vector predicates = right.getPredicates();
+           final List<Predicate> predicates = right.getPredicates();
 
            if ((axis == Axis.CHILD) && (type != NodeTest.ATTRIBUTE)) {
                // Compress './/child:E' into 'descendant::E' - if possible
@@ -2135,65 +2141,65 @@
                RESULT = new ParentLocationPath(left, ppl);
            }
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(22/*AbbreviatedRelativeLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(22/*AbbreviatedRelativeLocationPath*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 74: // AbsoluteLocationPath ::= AbbreviatedAbsoluteLocationPath
             {
               Expression RESULT = null;
-                int aalpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int aalpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression aalp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int aalpleft = (parser_stack.get(parser_top-0)).left;
+                int aalpright = (parser_stack.get(parser_top-0)).right;
+                Expression aalp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = aalp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(23/*AbsoluteLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(23/*AbsoluteLocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 73: // AbsoluteLocationPath ::= SLASH RelativeLocationPath
             {
               Expression RESULT = null;
-                int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int rlpleft = (parser_stack.get(parser_top-0)).left;
+                int rlpright = (parser_stack.get(parser_top-0)).right;
+                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new AbsoluteLocationPath(rlp);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(23/*AbsoluteLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(23/*AbsoluteLocationPath*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 72: // AbsoluteLocationPath ::= SLASH
             {
               Expression RESULT = null;
                  RESULT = new AbsoluteLocationPath();
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(23/*AbsoluteLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(23/*AbsoluteLocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 71: // RelativeLocationPath ::= AbbreviatedRelativeLocationPath
             {
               Expression RESULT = null;
-                int arlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int arlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression arlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int arlpleft = (parser_stack.get(parser_top-0)).left;
+                int arlpright = (parser_stack.get(parser_top-0)).right;
+                Expression arlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = arlp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(21/*RelativeLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(21/*RelativeLocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 70: // RelativeLocationPath ::= RelativeLocationPath SLASH Step
             {
               Expression RESULT = null;
-                int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int stepleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int stepright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression step = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int rlpleft = (parser_stack.get(parser_top-2)).left;
+                int rlpright = (parser_stack.get(parser_top-2)).right;
+                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int stepleft = (parser_stack.get(parser_top-0)).left;
+                int stepright = (parser_stack.get(parser_top-0)).right;
+                Expression step = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
 
         if (rlp instanceof Step && ((Step) rlp).isAbbreviatedDot()) {
               RESULT = step;       // Remove './' from the middle
@@ -2206,56 +2212,56 @@
                 new ParentLocationPath((RelativeLocationPath) rlp, step);
            }
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(21/*RelativeLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(21/*RelativeLocationPath*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 69: // RelativeLocationPath ::= Step
             {
               Expression RESULT = null;
-                int stepleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int stepright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression step = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int stepleft = (parser_stack.get(parser_top-0)).left;
+                int stepright = (parser_stack.get(parser_top-0)).right;
+                Expression step = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = step;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(21/*RelativeLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(21/*RelativeLocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 68: // LocationPath ::= AbsoluteLocationPath
             {
               Expression RESULT = null;
-                int alpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int alpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression alp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int alpleft = (parser_stack.get(parser_top-0)).left;
+                int alpright = (parser_stack.get(parser_top-0)).right;
+                Expression alp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = alp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(4/*LocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(4/*LocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 67: // LocationPath ::= RelativeLocationPath
             {
               Expression RESULT = null;
-                int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int rlpleft = (parser_stack.get(parser_top-0)).left;
+                int rlpright = (parser_stack.get(parser_top-0)).right;
+                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = rlp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(4/*LocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(4/*LocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 66: // PathExpr ::= FilterExpr DSLASH RelativeLocationPath
             {
               Expression RESULT = null;
-                int fexpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int fexpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression fexp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int fexpleft = (parser_stack.get(parser_top-2)).left;
+                int fexpright = (parser_stack.get(parser_top-2)).right;
+                Expression fexp = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int rlpleft = (parser_stack.get(parser_top-0)).left;
+                int rlpright = (parser_stack.get(parser_top-0)).right;
+                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
 
            //
            // Expand '//' into '/descendant-or-self::node()/' or
@@ -2275,887 +2281,892 @@
            }
            RESULT = fpp;
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(19/*PathExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(19/*PathExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 65: // PathExpr ::= FilterExpr SLASH RelativeLocationPath
             {
               Expression RESULT = null;
-                int fexpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int fexpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression fexp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int fexpleft = (parser_stack.get(parser_top-2)).left;
+                int fexpright = (parser_stack.get(parser_top-2)).right;
+                Expression fexp = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int rlpleft = (parser_stack.get(parser_top-0)).left;
+                int rlpright = (parser_stack.get(parser_top-0)).right;
+                Expression rlp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new FilterParentPath(fexp, rlp);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(19/*PathExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(19/*PathExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 64: // PathExpr ::= FilterExpr
             {
               Expression RESULT = null;
-                int fexpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int fexpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression fexp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int fexpleft = (parser_stack.get(parser_top-0)).left;
+                int fexpright = (parser_stack.get(parser_top-0)).right;
+                Expression fexp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = fexp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(19/*PathExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(19/*PathExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 63: // PathExpr ::= LocationPath
             {
               Expression RESULT = null;
-                int lpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int lpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression lp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int lpleft = (parser_stack.get(parser_top-0)).left;
+                int lpright = (parser_stack.get(parser_top-0)).right;
+                Expression lp = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = lp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(19/*PathExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(19/*PathExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 62: // UnionExpr ::= PathExpr VBAR UnionExpr
             {
               Expression RESULT = null;
-                int peleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int peright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression pe = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int restleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int restright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression rest = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int peleft = (parser_stack.get(parser_top-2)).left;
+                int peright = (parser_stack.get(parser_top-2)).right;
+                Expression pe = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int restleft = (parser_stack.get(parser_top-0)).left;
+                int restright = (parser_stack.get(parser_top-0)).right;
+                Expression rest = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new UnionPathExpr(pe, rest);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(18/*UnionExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(18/*UnionExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 61: // UnionExpr ::= PathExpr
             {
               Expression RESULT = null;
-                int peleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int peright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression pe = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int peleft = (parser_stack.get(parser_top-0)).left;
+                int peright = (parser_stack.get(parser_top-0)).right;
+                Expression pe = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = pe;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(18/*UnionExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(18/*UnionExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 60: // UnaryExpr ::= MINUS UnaryExpr
             {
               Expression RESULT = null;
-                int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ueleft = (parser_stack.get(parser_top-0)).left;
+                int ueright = (parser_stack.get(parser_top-0)).right;
+                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new UnaryOpExpr(ue);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(14/*UnaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(14/*UnaryExpr*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 59: // UnaryExpr ::= UnionExpr
             {
               Expression RESULT = null;
-                int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ueleft = (parser_stack.get(parser_top-0)).left;
+                int ueright = (parser_stack.get(parser_top-0)).right;
+                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = ue;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(14/*UnaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(14/*UnaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 58: // MultiplicativeExpr ::= MultiplicativeExpr MOD UnaryExpr
             {
               Expression RESULT = null;
-                int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int meleft = (parser_stack.get(parser_top-2)).left;
+                int meright = (parser_stack.get(parser_top-2)).right;
+                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int ueleft = (parser_stack.get(parser_top-0)).left;
+                int ueright = (parser_stack.get(parser_top-0)).right;
+                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.MOD, me, ue);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(13/*MultiplicativeExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 57: // MultiplicativeExpr ::= MultiplicativeExpr DIV UnaryExpr
             {
               Expression RESULT = null;
-                int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int meleft = (parser_stack.get(parser_top-2)).left;
+                int meright = (parser_stack.get(parser_top-2)).right;
+                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int ueleft = (parser_stack.get(parser_top-0)).left;
+                int ueright = (parser_stack.get(parser_top-0)).right;
+                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.DIV, me, ue);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(13/*MultiplicativeExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 56: // MultiplicativeExpr ::= MultiplicativeExpr STAR UnaryExpr
             {
               Expression RESULT = null;
-                int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int meleft = (parser_stack.get(parser_top-2)).left;
+                int meright = (parser_stack.get(parser_top-2)).right;
+                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int ueleft = (parser_stack.get(parser_top-0)).left;
+                int ueright = (parser_stack.get(parser_top-0)).right;
+                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.TIMES, me, ue);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(13/*MultiplicativeExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 55: // MultiplicativeExpr ::= UnaryExpr
             {
               Expression RESULT = null;
-                int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ueleft = (parser_stack.get(parser_top-0)).left;
+                int ueright = (parser_stack.get(parser_top-0)).right;
+                Expression ue = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = ue;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(13/*MultiplicativeExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 54: // AdditiveExpr ::= AdditiveExpr MINUS MultiplicativeExpr
             {
               Expression RESULT = null;
-                int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int aeleft = (parser_stack.get(parser_top-2)).left;
+                int aeright = (parser_stack.get(parser_top-2)).right;
+                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int meleft = (parser_stack.get(parser_top-0)).left;
+                int meright = (parser_stack.get(parser_top-0)).right;
+                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.MINUS, ae, me);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(12/*AdditiveExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(12/*AdditiveExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 53: // AdditiveExpr ::= AdditiveExpr PLUS MultiplicativeExpr
             {
               Expression RESULT = null;
-                int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int aeleft = (parser_stack.get(parser_top-2)).left;
+                int aeright = (parser_stack.get(parser_top-2)).right;
+                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int meleft = (parser_stack.get(parser_top-0)).left;
+                int meright = (parser_stack.get(parser_top-0)).right;
+                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.PLUS, ae, me);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(12/*AdditiveExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(12/*AdditiveExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 52: // AdditiveExpr ::= MultiplicativeExpr
             {
               Expression RESULT = null;
-                int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int meleft = (parser_stack.get(parser_top-0)).left;
+                int meright = (parser_stack.get(parser_top-0)).right;
+                Expression me = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = me;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(12/*AdditiveExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(12/*AdditiveExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 51: // RelationalExpr ::= RelationalExpr GE AdditiveExpr
             {
               Expression RESULT = null;
-                int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int releft = (parser_stack.get(parser_top-2)).left;
+                int reright = (parser_stack.get(parser_top-2)).right;
+                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int aeleft = (parser_stack.get(parser_top-0)).left;
+                int aeright = (parser_stack.get(parser_top-0)).right;
+                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.GE, re, ae);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(11/*RelationalExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 50: // RelationalExpr ::= RelationalExpr LE AdditiveExpr
             {
               Expression RESULT = null;
-                int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int releft = (parser_stack.get(parser_top-2)).left;
+                int reright = (parser_stack.get(parser_top-2)).right;
+                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int aeleft = (parser_stack.get(parser_top-0)).left;
+                int aeright = (parser_stack.get(parser_top-0)).right;
+                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.LE, re, ae);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(11/*RelationalExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 49: // RelationalExpr ::= RelationalExpr GT AdditiveExpr
             {
               Expression RESULT = null;
-                int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int releft = (parser_stack.get(parser_top-2)).left;
+                int reright = (parser_stack.get(parser_top-2)).right;
+                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int aeleft = (parser_stack.get(parser_top-0)).left;
+                int aeright = (parser_stack.get(parser_top-0)).right;
+                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.GT, re, ae);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(11/*RelationalExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 48: // RelationalExpr ::= RelationalExpr LT AdditiveExpr
             {
               Expression RESULT = null;
-                int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int releft = (parser_stack.get(parser_top-2)).left;
+                int reright = (parser_stack.get(parser_top-2)).right;
+                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int aeleft = (parser_stack.get(parser_top-0)).left;
+                int aeright = (parser_stack.get(parser_top-0)).right;
+                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.LT, re, ae);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(11/*RelationalExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 47: // RelationalExpr ::= AdditiveExpr
             {
               Expression RESULT = null;
-                int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int aeleft = (parser_stack.get(parser_top-0)).left;
+                int aeright = (parser_stack.get(parser_top-0)).right;
+                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = ae;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(11/*RelationalExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 46: // EqualityExpr ::= EqualityExpr NE RelationalExpr
             {
               Expression RESULT = null;
-                int eeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int eeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression ee = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int eeleft = (parser_stack.get(parser_top-2)).left;
+                int eeright = (parser_stack.get(parser_top-2)).right;
+                Expression ee = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int releft = (parser_stack.get(parser_top-0)).left;
+                int reright = (parser_stack.get(parser_top-0)).right;
+                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new EqualityExpr(Operators.NE, ee, re);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(10/*EqualityExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(10/*EqualityExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 45: // EqualityExpr ::= EqualityExpr EQ RelationalExpr
             {
               Expression RESULT = null;
-                int eeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int eeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression ee = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int eeleft = (parser_stack.get(parser_top-2)).left;
+                int eeright = (parser_stack.get(parser_top-2)).right;
+                Expression ee = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int releft = (parser_stack.get(parser_top-0)).left;
+                int reright = (parser_stack.get(parser_top-0)).right;
+                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new EqualityExpr(Operators.EQ, ee, re);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(10/*EqualityExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(10/*EqualityExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 44: // EqualityExpr ::= RelationalExpr
             {
               Expression RESULT = null;
-                int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int releft = (parser_stack.get(parser_top-0)).left;
+                int reright = (parser_stack.get(parser_top-0)).right;
+                Expression re = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = re;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(10/*EqualityExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(10/*EqualityExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 43: // AndExpr ::= AndExpr AND EqualityExpr
             {
               Expression RESULT = null;
-                int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int eeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int eeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ee = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int aeleft = (parser_stack.get(parser_top-2)).left;
+                int aeright = (parser_stack.get(parser_top-2)).right;
+                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int eeleft = (parser_stack.get(parser_top-0)).left;
+                int eeright = (parser_stack.get(parser_top-0)).right;
+                Expression ee = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new LogicalExpr(LogicalExpr.AND, ae, ee);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(9/*AndExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(9/*AndExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 42: // AndExpr ::= EqualityExpr
             {
               Expression RESULT = null;
-                int eleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int eright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression e = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int eleft = (parser_stack.get(parser_top-0)).left;
+                int eright = (parser_stack.get(parser_top-0)).right;
+                Expression e = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = e;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(9/*AndExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(9/*AndExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 41: // OrExpr ::= OrExpr OR AndExpr
             {
               Expression RESULT = null;
-                int oeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int oeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Expression oe = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int oeleft = (parser_stack.get(parser_top-2)).left;
+                int oeright = (parser_stack.get(parser_top-2)).right;
+                Expression oe = (Expression)((Symbol) parser_stack.get(parser_top-2)).value;
+                int aeleft = (parser_stack.get(parser_top-0)).left;
+                int aeright = (parser_stack.get(parser_top-0)).right;
+                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new LogicalExpr(LogicalExpr.OR, oe, ae);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(8/*OrExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(8/*OrExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 40: // OrExpr ::= AndExpr
             {
               Expression RESULT = null;
-                int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int aeleft = (parser_stack.get(parser_top-0)).left;
+                int aeright = (parser_stack.get(parser_top-0)).right;
+                Expression ae = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = ae;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(8/*OrExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(8/*OrExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 39: // Expr ::= OrExpr
             {
               Expression RESULT = null;
-                int exleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int exright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression ex = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int exleft = (parser_stack.get(parser_top-0)).left;
+                int exright = (parser_stack.get(parser_top-0)).right;
+                Expression ex = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = ex;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(2/*Expr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(2/*Expr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 38: // Predicate ::= LBRACK Expr RBRACK
             {
               Expression RESULT = null;
-                int eleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int eright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Expression e = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
+                int eleft = (parser_stack.get(parser_top-1)).left;
+                int eright = (parser_stack.get(parser_top-1)).right;
+                Expression e = (Expression)((Symbol) parser_stack.get(parser_top-1)).value;
 
                 RESULT = new Predicate(e);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(5/*Predicate*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(5/*Predicate*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 37: // Predicates ::= Predicate Predicates
             {
-              Vector RESULT = null;
-                int pleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int pright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Expression p = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-                 pp.insertElementAt(p, 0); RESULT = pp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(35/*Predicates*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+                List<Expression> RESULT = null;
+                int pleft = (parser_stack.get(parser_top-1)).left;
+                int pright = (parser_stack.get(parser_top-1)).right;
+                Expression p = (Expression)((Symbol) parser_stack.get(parser_top-1)).value;
+                int ppleft = (parser_stack.get(parser_top-0)).left;
+                int ppright = (parser_stack.get(parser_top-0)).right;
+                @SuppressWarnings("unchecked")
+                List<Expression> pp = (ArrayList<Expression>)((Symbol) parser_stack.get(parser_top-0)).value;
+                pp.add(0, p); RESULT = pp;
+              parser_result = new Symbol(35/*Predicates*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 36: // Predicates ::= Predicate
             {
-              Vector RESULT = null;
-                int pleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int pright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression p = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                List<Expression> RESULT = null;
+                int pleft = (parser_stack.get(parser_top-0)).left;
+                int pright = (parser_stack.get(parser_top-0)).right;
+                Expression p = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
 
-                Vector temp = new Vector();
-                temp.addElement(p);
+                List<Expression> temp = new ArrayList<>();
+                temp.add(p);
                 RESULT = temp;
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(35/*Predicates*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(35/*Predicates*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 35: // ChildOrAttributeAxisSpecifier ::= ATTRIBUTE DCOLON
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.ATTRIBUTE);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(42/*ChildOrAttributeAxisSpecifier*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 34: // ChildOrAttributeAxisSpecifier ::= CHILD DCOLON
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.CHILD);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(42/*ChildOrAttributeAxisSpecifier*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 33: // ChildOrAttributeAxisSpecifier ::= ATSIGN
             {
               Integer RESULT = null;
                  RESULT = Integer.valueOf(Axis.ATTRIBUTE);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(42/*ChildOrAttributeAxisSpecifier*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 32: // NameTestPattern ::= QName
             {
               Object RESULT = null;
-                int qnleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int qnright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                QName qn = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int qnleft = (parser_stack.get(parser_top-0)).left;
+                int qnright = (parser_stack.get(parser_top-0)).right;
+                QName qn = (QName)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = qn;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(34/*NameTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(34/*NameTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 31: // NameTestPattern ::= STAR
             {
               Object RESULT = null;
                  RESULT = null;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(34/*NameTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(34/*NameTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 30: // NodeTestPattern ::= PI
             {
               Object RESULT = null;
                  RESULT = Integer.valueOf(NodeTest.PI);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(33/*NodeTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 29: // NodeTestPattern ::= COMMENT
             {
               Object RESULT = null;
                  RESULT = Integer.valueOf(NodeTest.COMMENT);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(33/*NodeTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 28: // NodeTestPattern ::= TEXT
             {
               Object RESULT = null;
                  RESULT = Integer.valueOf(NodeTest.TEXT);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(33/*NodeTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 27: // NodeTestPattern ::= NODE
             {
               Object RESULT = null;
                  RESULT = Integer.valueOf(NodeTest.ANODE);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(33/*NodeTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 26: // NodeTestPattern ::= NameTestPattern
             {
               Object RESULT = null;
-                int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ntleft = (parser_stack.get(parser_top-0)).left;
+                int ntright = (parser_stack.get(parser_top-0)).right;
+                Object nt = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = nt;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(33/*NodeTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 25: // StepPattern ::= ChildOrAttributeAxisSpecifier ProcessingInstructionPattern Predicates
             {
               StepPattern RESULT = null;
-                int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int pipleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int pipright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                StepPattern pip = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int axisleft = (parser_stack.get(parser_top-2)).left;
+                int axisright = (parser_stack.get(parser_top-2)).right;
+                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-2)).value;
+                int pipleft = (parser_stack.get(parser_top-1)).left;
+                int pipright = (parser_stack.get(parser_top-1)).right;
+                StepPattern pip = (StepPattern)((Symbol) parser_stack.get(parser_top-1)).value;
+                int ppleft = (parser_stack.get(parser_top-0)).left;
+                int ppright = (parser_stack.get(parser_top-0)).right;
+                @SuppressWarnings("unchecked")
+                List<Predicate> pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
 
                // TODO: report error if axis is attribute
                RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 24: // StepPattern ::= ChildOrAttributeAxisSpecifier ProcessingInstructionPattern
             {
               StepPattern RESULT = null;
-                int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int pipleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int pipright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                StepPattern pip = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int axisleft = (parser_stack.get(parser_top-1)).left;
+                int axisright = (parser_stack.get(parser_top-1)).right;
+                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-1)).value;
+                int pipleft = (parser_stack.get(parser_top-0)).left;
+                int pipright = (parser_stack.get(parser_top-0)).right;
+                StepPattern pip = (StepPattern)((Symbol) parser_stack.get(parser_top-0)).value;
 
                RESULT = pip;    // TODO: report error if axis is attribute
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 23: // StepPattern ::= ChildOrAttributeAxisSpecifier NodeTestPattern Predicates
             {
               StepPattern RESULT = null;
-                int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int axisleft = (parser_stack.get(parser_top-2)).left;
+                int axisright = (parser_stack.get(parser_top-2)).right;
+                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-2)).value;
+                int ntleft = (parser_stack.get(parser_top-1)).left;
+                int ntright = (parser_stack.get(parser_top-1)).right;
+                Object nt = (Object)((Symbol) parser_stack.get(parser_top-1)).value;
+                int ppleft = (parser_stack.get(parser_top-0)).left;
+                int ppright = (parser_stack.get(parser_top-0)).right;
+                @SuppressWarnings("unchecked")
+               List<Predicate>pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
 
                RESULT = parser.createStepPattern(axis.intValue(), nt, pp);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 22: // StepPattern ::= ChildOrAttributeAxisSpecifier NodeTestPattern
             {
               StepPattern RESULT = null;
-                int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int axisleft = (parser_stack.get(parser_top-1)).left;
+                int axisright = (parser_stack.get(parser_top-1)).right;
+                Integer axis = (Integer)((Symbol) parser_stack.get(parser_top-1)).value;
+                int ntleft = (parser_stack.get(parser_top-0)).left;
+                int ntright = (parser_stack.get(parser_top-0)).right;
+                Object nt = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
 
                RESULT = parser.createStepPattern(axis.intValue(), nt, null);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 21: // StepPattern ::= ProcessingInstructionPattern Predicates
             {
               StepPattern RESULT = null;
-                int pipleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int pipright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                StepPattern pip = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int pipleft = (parser_stack.get(parser_top-1)).left;
+                int pipright = (parser_stack.get(parser_top-1)).right;
+                StepPattern pip = (StepPattern)((Symbol) parser_stack.get(parser_top-1)).value;
+                int ppleft = (parser_stack.get(parser_top-0)).left;
+                int ppright = (parser_stack.get(parser_top-0)).right;
+                @SuppressWarnings("unchecked")
+                List<Predicate> pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 20: // StepPattern ::= ProcessingInstructionPattern
             {
               StepPattern RESULT = null;
-                int pipleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int pipright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                StepPattern pip = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int pipleft = (parser_stack.get(parser_top-0)).left;
+                int pipright = (parser_stack.get(parser_top-0)).right;
+                StepPattern pip = (StepPattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = pip;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 19: // StepPattern ::= NodeTestPattern Predicates
             {
               StepPattern RESULT = null;
-                int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-                int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ntleft = (parser_stack.get(parser_top-1)).left;
+                int ntright = (parser_stack.get(parser_top-1)).right;
+                Object nt = (Object)((Symbol) parser_stack.get(parser_top-1)).value;
+                int ppleft = (parser_stack.get(parser_top-0)).left;
+                int ppright = (parser_stack.get(parser_top-0)).right;
+                @SuppressWarnings("unchecked")
+                List<Predicate> pp = (ArrayList<Predicate>)((Symbol) parser_stack.get(parser_top-0)).value;
 
                 RESULT = parser.createStepPattern(Axis.CHILD, nt, pp);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 18: // StepPattern ::= NodeTestPattern
             {
               StepPattern RESULT = null;
-                int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ntleft = (parser_stack.get(parser_top-0)).left;
+                int ntright = (parser_stack.get(parser_top-0)).right;
+                Object nt = (Object)((Symbol) parser_stack.get(parser_top-0)).value;
 
                 RESULT = parser.createStepPattern(Axis.CHILD, nt, null);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 17: // RelativePathPattern ::= StepPattern DSLASH RelativePathPattern
             {
               RelativePathPattern RESULT = null;
-                int spleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int spright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                StepPattern sp = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int spleft = (parser_stack.get(parser_top-2)).left;
+                int spright = (parser_stack.get(parser_top-2)).right;
+                StepPattern sp = (StepPattern)((Symbol) parser_stack.get(parser_top-2)).value;
+                int rppleft = (parser_stack.get(parser_top-0)).left;
+                int rppright = (parser_stack.get(parser_top-0)).right;
+                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new AncestorPattern(sp, rpp);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(31/*RelativePathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(31/*RelativePathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 16: // RelativePathPattern ::= StepPattern SLASH RelativePathPattern
             {
               RelativePathPattern RESULT = null;
-                int spleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int spright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                StepPattern sp = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int spleft = (parser_stack.get(parser_top-2)).left;
+                int spright = (parser_stack.get(parser_top-2)).right;
+                StepPattern sp = (StepPattern)((Symbol) parser_stack.get(parser_top-2)).value;
+                int rppleft = (parser_stack.get(parser_top-0)).left;
+                int rppright = (parser_stack.get(parser_top-0)).right;
+                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new ParentPattern(sp, rpp);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(31/*RelativePathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(31/*RelativePathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 15: // RelativePathPattern ::= StepPattern
             {
               RelativePathPattern RESULT = null;
-                int spleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int spright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                StepPattern sp = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int spleft = (parser_stack.get(parser_top-0)).left;
+                int spright = (parser_stack.get(parser_top-0)).right;
+                StepPattern sp = (StepPattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = sp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(31/*RelativePathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(31/*RelativePathPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 14: // ProcessingInstructionPattern ::= PIPARAM LPAREN Literal RPAREN
             {
               StepPattern RESULT = null;
-                int lleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int lright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                String l = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
+                int lleft = (parser_stack.get(parser_top-1)).left;
+                int lright = (parser_stack.get(parser_top-1)).right;
+                String l = (String)((Symbol) parser_stack.get(parser_top-1)).value;
                  RESULT = new ProcessingInstructionPattern(l);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(30/*ProcessingInstructionPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(30/*ProcessingInstructionPattern*/, (parser_stack.get(parser_top-3)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 13: // IdKeyPattern ::= KEY LPAREN Literal COMMA Literal RPAREN
             {
               IdKeyPattern RESULT = null;
-                int l1left = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left;
-                int l1right = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).right;
-                String l1 = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).value;
-                int l2left = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int l2right = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                String l2 = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
+                int l1left = (parser_stack.get(parser_top-3)).left;
+                int l1right = (parser_stack.get(parser_top-3)).right;
+                String l1 = (String)((Symbol) parser_stack.get(parser_top-3)).value;
+                int l2left = (parser_stack.get(parser_top-1)).left;
+                int l2right = (parser_stack.get(parser_top-1)).right;
+                String l2 = (String)((Symbol) parser_stack.get(parser_top-1)).value;
                  RESULT = new KeyPattern(l1, l2);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(27/*IdKeyPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-5)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(27/*IdKeyPattern*/, (parser_stack.get(parser_top-5)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 12: // IdKeyPattern ::= ID LPAREN Literal RPAREN
             {
               IdKeyPattern RESULT = null;
-                int lleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int lright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                String l = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
+                int lleft = (parser_stack.get(parser_top-1)).left;
+                int lright = (parser_stack.get(parser_top-1)).right;
+                String l = (String)((Symbol) parser_stack.get(parser_top-1)).value;
                  RESULT = new IdPattern(l);
                parser.setHasIdCall(true);
 
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(27/*IdKeyPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(27/*IdKeyPattern*/, (parser_stack.get(parser_top-3)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 11: // LocationPathPattern ::= RelativePathPattern
             {
               Pattern RESULT = null;
-                int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int rppleft = (parser_stack.get(parser_top-0)).left;
+                int rppright = (parser_stack.get(parser_top-0)).right;
+                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = rpp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 10: // LocationPathPattern ::= DSLASH RelativePathPattern
             {
               Pattern RESULT = null;
-                int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int rppleft = (parser_stack.get(parser_top-0)).left;
+                int rppright = (parser_stack.get(parser_top-0)).right;
+                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new AncestorPattern(rpp);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 9: // LocationPathPattern ::= IdKeyPattern DSLASH RelativePathPattern
             {
               Pattern RESULT = null;
-                int ikpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int ikpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                IdKeyPattern ikp = (IdKeyPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ikpleft = (parser_stack.get(parser_top-2)).left;
+                int ikpright = (parser_stack.get(parser_top-2)).right;
+                IdKeyPattern ikp = (IdKeyPattern)((Symbol) parser_stack.get(parser_top-2)).value;
+                int rppleft = (parser_stack.get(parser_top-0)).left;
+                int rppright = (parser_stack.get(parser_top-0)).right;
+                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new AncestorPattern(ikp, rpp);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 8: // LocationPathPattern ::= IdKeyPattern SLASH RelativePathPattern
             {
               Pattern RESULT = null;
-                int ikpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int ikpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                IdKeyPattern ikp = (IdKeyPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ikpleft = (parser_stack.get(parser_top-2)).left;
+                int ikpright = (parser_stack.get(parser_top-2)).right;
+                IdKeyPattern ikp = (IdKeyPattern)((Symbol) parser_stack.get(parser_top-2)).value;
+                int rppleft = (parser_stack.get(parser_top-0)).left;
+                int rppright = (parser_stack.get(parser_top-0)).right;
+                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new ParentPattern(ikp, rpp);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 7: // LocationPathPattern ::= IdKeyPattern
             {
               Pattern RESULT = null;
-                int ikpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int ikpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                IdKeyPattern ikp = (IdKeyPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int ikpleft = (parser_stack.get(parser_top-0)).left;
+                int ikpright = (parser_stack.get(parser_top-0)).right;
+                IdKeyPattern ikp = (IdKeyPattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = ikp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 6: // LocationPathPattern ::= SLASH RelativePathPattern
             {
               Pattern RESULT = null;
-                int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int rppleft = (parser_stack.get(parser_top-0)).left;
+                int rppright = (parser_stack.get(parser_top-0)).right;
+                RelativePathPattern rpp = (RelativePathPattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new AbsolutePathPattern(rpp);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 5: // LocationPathPattern ::= SLASH
             {
               Pattern RESULT = null;
                  RESULT = new AbsolutePathPattern(null);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 4: // Pattern ::= LocationPathPattern VBAR Pattern
             {
               Pattern RESULT = null;
-                int lppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
-                int lppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
-                Pattern lpp = (Pattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-                int pleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int pright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Pattern p = (Pattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int lppleft = (parser_stack.get(parser_top-2)).left;
+                int lppright = (parser_stack.get(parser_top-2)).right;
+                Pattern lpp = (Pattern)((Symbol) parser_stack.get(parser_top-2)).value;
+                int pleft = (parser_stack.get(parser_top-0)).left;
+                int pright = (parser_stack.get(parser_top-0)).right;
+                Pattern p = (Pattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = new AlternativePattern(lpp, p);
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(28/*Pattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(28/*Pattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 3: // Pattern ::= LocationPathPattern
             {
               Pattern RESULT = null;
-                int lppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int lppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Pattern lpp = (Pattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int lppleft = (parser_stack.get(parser_top-0)).left;
+                int lppright = (parser_stack.get(parser_top-0)).right;
+                Pattern lpp = (Pattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = lpp;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(28/*Pattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(28/*Pattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 2: // TopLevel ::= EXPRESSION Expr
             {
               SyntaxTreeNode RESULT = null;
-                int exprleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int exprright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Expression expr = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int exprleft = (parser_stack.get(parser_top-0)).left;
+                int exprright = (parser_stack.get(parser_top-0)).right;
+                Expression expr = (Expression)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = expr;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(1/*TopLevel*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(1/*TopLevel*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 1: // TopLevel ::= PATTERN Pattern
             {
               SyntaxTreeNode RESULT = null;
-                int patternleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
-                int patternright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
-                Pattern pattern = (Pattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
+                int patternleft = (parser_stack.get(parser_top-0)).left;
+                int patternright = (parser_stack.get(parser_top-0)).right;
+                Pattern pattern = (Pattern)((Symbol) parser_stack.get(parser_top-0)).value;
                  RESULT = pattern;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(1/*TopLevel*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(1/*TopLevel*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
-          return CUP$XPathParser$result;
+          return parser_result;
 
           /*. . . . . . . . . . . . . . . . . . . .*/
           case 0: // $START ::= TopLevel EOF
             {
               Object RESULT = null;
-                int start_valleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
-                int start_valright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
-                SyntaxTreeNode start_val = (SyntaxTreeNode)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
+                int start_valleft = (parser_stack.get(parser_top-1)).left;
+                int start_valright = (parser_stack.get(parser_top-1)).right;
+                SyntaxTreeNode start_val = (SyntaxTreeNode)((Symbol) parser_stack.get(parser_top-1)).value;
                 RESULT = start_val;
-              CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(0/*$START*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
+              parser_result = new Symbol(0/*$START*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
           /* ACCEPT */
-          CUP$XPathParser$parser.done_parsing();
-          return CUP$XPathParser$result;
+          parser_parser.done_parsing();
+          return parser_result;
 
           /* . . . . . .*/
           default:
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -36,12 +36,11 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
-import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Properties;
-import java.util.Vector;
 import java.util.jar.Attributes;
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
@@ -87,19 +86,19 @@
 
     // Name index tables
     private int       _nextGType;  // Next available element type
-    private Vector    _namesIndex; // Index of all registered QNames
+    private List<String>   _namesIndex; // Index of all registered QNames
     private Map<String, Integer> _elements;   // Map of all registered elements
     private Map<String, Integer> _attributes; // Map of all registered attributes
 
     // Namespace index tables
     private int       _nextNSType; // Next available namespace type
-    private Vector    _namespaceIndex; // Index of all registered namespaces
+    private List<String>   _namespaceIndex; // Index of all registered namespaces
     private Map<String, Integer> _namespaces; // Map of all registered namespaces
     private Map<String, Integer> _namespacePrefixes;// Map of all registered namespace prefixes
 
 
     // All literal text in the stylesheet
-    private ArrayList<StringBuilder> m_characterData;
+    private List<StringBuilder> m_characterData;
 
     // These define the various methods for outputting the translet
     public static final int JAR_OUTPUT         = 1;
@@ -117,8 +116,8 @@
     private File    _destDir = null;     // -d <directory-name>
     private int     _outputType = BYTEARRAY_OUTPUT; // by default
 
-    private ArrayList<ByteArrayOutputStream>  _classes;
-    private ArrayList<JavaClass>  _bcelClasses;
+    private List<ByteArrayOutputStream>  _classes;
+    private List<JavaClass>  _bcelClasses;
     private boolean _callsNodeset = false;
     private boolean _multiDocument = false;
     private boolean _hasIdCall = false;
@@ -309,8 +308,8 @@
      * The filtering of function types (external,internal) takes place in FunctionCall class
      *
      */
-    Class loadExternalFunction(String name) throws ClassNotFoundException {
-        Class loaded = null;
+    Class<?> loadExternalFunction(String name) throws ClassNotFoundException {
+        Class<?> loaded = null;
         //Check if the function is not loaded already
         if (_externalExtensionFunctions.containsKey(name)) {
             loaded = _externalExtensionFunctions.get(name);
@@ -322,7 +321,7 @@
             throw new ClassNotFoundException(name);
         }
         //Return loaded class
-        return (Class) loaded;
+        return loaded;
     }
 
     /*
@@ -342,8 +341,8 @@
         _attributes     = new HashMap<>();
         _namespaces     = new HashMap<>();
         _namespaces.put("", _nextNSType);
-        _namesIndex     = new Vector(128);
-        _namespaceIndex = new Vector(32);
+        _namesIndex     = new ArrayList<>(128);
+        _namespaceIndex = new ArrayList<>(32);
         _namespacePrefixes = new HashMap<>();
         _stylesheet     = null;
         _parser.init();
@@ -458,7 +457,7 @@
      */
     public boolean compile(InputSource input, String name) {
         try {
-            // Reset globals in case we're called by compile(Vector v);
+            // Reset globals in case we're called by compile(ArrayList v);
             reset();
 
             // The systemId may not be set, so we'll have to check the URL
@@ -531,11 +530,11 @@
     }
 
     /**
-     * Compiles a set of stylesheets pointed to by a Vector of URLs
-     * @param stylesheets A Vector containing URLs pointing to the stylesheets
+     * Compiles a set of stylesheets pointed to by a List of URLs
+     * @param stylesheets A List containing URLs pointing to the stylesheets
      * @return 'true' if the compilation was successful
      */
-    public boolean compile(Vector stylesheets) {
+    public boolean compile(List<URL> stylesheets) {
         // Get the number of stylesheets (ie. URLs) in the vector
         final int count = stylesheets.size();
 
@@ -545,21 +544,13 @@
         // Special handling needed if the URL count is one, becuase the
         // _className global must not be reset if it was set explicitly
         if (count == 1) {
-            final Object url = stylesheets.firstElement();
-            if (url instanceof URL)
-                return compile((URL)url);
-            else
-                return false;
+            return compile(stylesheets.get(0));
         }
         else {
             // Traverse all elements in the vector and compile
-            final Enumeration urls = stylesheets.elements();
-            while (urls.hasMoreElements()) {
+            for (URL url : stylesheets) {
                 _className = null; // reset, so that new name will be computed
-                final Object url = urls.nextElement();
-                if (url instanceof URL) {
-                    if (!compile((URL)url)) return false;
-                }
+                if (!compile(url)) return false;
             }
         }
         return true;
@@ -623,7 +614,7 @@
      * Get a list of all compile error messages
      * @return A List containing all compile error messages
      */
-    public ArrayList<ErrorMsg> getErrors() {
+    public List<ErrorMsg> getErrors() {
         return _parser.getErrors();
     }
 
@@ -631,7 +622,7 @@
      * Get a list of all compile warning messages
      * @return A List containing all compile error messages
      */
-    public ArrayList<ErrorMsg> getWarnings() {
+    public List<ErrorMsg> getWarnings() {
         return _parser.getWarnings();
     }
 
@@ -685,7 +676,7 @@
     /**
      * Set the class name for the generated translet. This class name is
      * overridden if multiple stylesheets are compiled in one go using the
-     * compile(Vector urls) method.
+     * compile(List urls) method.
      * @param className The name to assign to the translet class
      */
     public void setClassName(String className) {
@@ -791,9 +782,9 @@
             final String uri = name.getNamespace();
             final String local = "@"+name.getLocalPart();
             if ((uri != null) && (!uri.equals("")))
-                _namesIndex.addElement(uri+":"+local);
+                _namesIndex.add(uri+":"+local);
             else
-                _namesIndex.addElement(local);
+                _namesIndex.add(local);
             if (name.getLocalPart().equals("*")) {
                 registerNamespace(name.getNamespace());
             }
@@ -810,7 +801,7 @@
         Integer code = _elements.get(name.toString());
         if (code == null) {
             _elements.put(name.toString(), code = _nextGType++);
-            _namesIndex.addElement(name.toString());
+            _namesIndex.add(name.toString());
         }
         if (name.getLocalPart().equals("*")) {
             registerNamespace(name.getNamespace());
@@ -832,9 +823,9 @@
         final String uri = name.getNamespace();
         if ((uri != null) && (!uri.equals(""))){
             // namespace::ext2:ped2 will be made empty in TypedNamespaceIterator
-            _namesIndex.addElement("?");
+            _namesIndex.add("?");
         } else{
-           _namesIndex.addElement("?"+name.getLocalPart());
+           _namesIndex.add("?"+name.getLocalPart());
         }
     }
     return code.intValue();
@@ -849,7 +840,7 @@
         if (code == null) {
             code = _nextNSType++;
             _namespaces.put(namespaceURI,code);
-            _namespaceIndex.addElement(namespaceURI);
+            _namespaceIndex.add(namespaceURI);
         }
         return code;
     }
@@ -878,11 +869,11 @@
         return _attributeSetSerial++;
     }
 
-    public Vector getNamesIndex() {
+    public List<String> getNamesIndex() {
         return _namesIndex;
     }
 
-    public Vector getNamespaceIndex() {
+    public List<String> getNamespaceIndex() {
         return _namespaceIndex;
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,8 +24,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.bcel.internal.generic.ALOAD;
 import com.sun.org.apache.bcel.internal.generic.ASTORE;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
@@ -40,7 +39,6 @@
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
 import com.sun.org.apache.xml.internal.serializer.ElemDesc;
 import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
 import com.sun.org.apache.xml.internal.utils.XML11Char;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/BooleanType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/BooleanType.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -149,7 +149,7 @@
      * Translates an internal boolean into an external (Java) boolean.
      */
     public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-                            Class clazz) {
+                            Class<?> clazz) {
         if (clazz == java.lang.Boolean.TYPE) {
             methodGen.getInstructionList().append(NOP);
         }
@@ -168,7 +168,7 @@
      * Translates an external (Java) boolean into internal boolean.
      */
     public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen,
-                              Class clazz) {
+                              Class<?> clazz) {
         translateTo(classGen, methodGen, clazz);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/IntType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/IntType.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -188,7 +189,7 @@
      * type after coercion.
      */
     public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-                            Class clazz) {
+                            Class<?> clazz) {
         final InstructionList il = methodGen.getInstructionList();
         if (clazz == Character.TYPE) {
             il.append(I2C);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,14 +24,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Stack;
-
-
 import com.sun.org.apache.bcel.internal.Const;
 import com.sun.org.apache.bcel.internal.classfile.Field;
 import com.sun.org.apache.bcel.internal.classfile.Method;
@@ -46,23 +39,23 @@
 import com.sun.org.apache.bcel.internal.generic.GETFIELD;
 import com.sun.org.apache.bcel.internal.generic.GOTO;
 import com.sun.org.apache.bcel.internal.generic.ICONST;
-import com.sun.org.apache.bcel.internal.generic.IfInstruction;
 import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.IndexedInstruction;
 import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
 import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
 import com.sun.org.apache.bcel.internal.generic.ISTORE;
+import com.sun.org.apache.bcel.internal.generic.IfInstruction;
+import com.sun.org.apache.bcel.internal.generic.IndexedInstruction;
 import com.sun.org.apache.bcel.internal.generic.Instruction;
 import com.sun.org.apache.bcel.internal.generic.InstructionConst;
 import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.bcel.internal.generic.InstructionTargeter;
+import com.sun.org.apache.bcel.internal.generic.LLOAD;
+import com.sun.org.apache.bcel.internal.generic.LSTORE;
 import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
 import com.sun.org.apache.bcel.internal.generic.LocalVariableInstruction;
-import com.sun.org.apache.bcel.internal.generic.LLOAD;
-import com.sun.org.apache.bcel.internal.generic.LSTORE;
 import com.sun.org.apache.bcel.internal.generic.MethodGen;
 import com.sun.org.apache.bcel.internal.generic.NEW;
 import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
@@ -70,9 +63,15 @@
 import com.sun.org.apache.bcel.internal.generic.Select;
 import com.sun.org.apache.bcel.internal.generic.TargetLostException;
 import com.sun.org.apache.bcel.internal.generic.Type;
-
 import com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
 
 /**
  * @author Jacek Ambroziak
@@ -266,7 +265,7 @@
      */
     protected class LocalVariableRegistry {
         /**
-         * <p>A <code>java.lang.ArrayList</code> of all
+         * <p>A <code>java.lang.List</code> of all
          * {@link LocalVariableGen}s created for this method, indexed by the
          * slot number of the local variable.  The JVM stack frame of local
          * variables is divided into "slots".  A single slot can be used to
@@ -279,12 +278,12 @@
          * registered for the same slot; and if none occurs, the entry will be
          * <code>null</code>.
          */
-        protected ArrayList _variables = new ArrayList();
+        protected List<Object> _variables = new ArrayList<>();
 
         /**
          * Maps a name to a {@link LocalVariableGen}
          */
-        protected HashMap _nameToLVGMap = new HashMap();
+        protected Map<String, Object> _nameToLVGMap = new HashMap<>();
 
         /**
          * Registers a {@link org.apache.bcel.generic.LocalVariableGen}
@@ -298,6 +297,7 @@
          * </ul></p>
          * @param lvg The variable to be registered
          */
+        @SuppressWarnings("unchecked")
         protected void registerLocalVariable(LocalVariableGen lvg) {
             int slot = lvg.getIndex();
 
@@ -320,12 +320,12 @@
                 Object localsInSlot = _variables.get(slot);
                 if (localsInSlot != null) {
                     if (localsInSlot instanceof LocalVariableGen) {
-                        ArrayList listOfLocalsInSlot = new ArrayList();
-                        listOfLocalsInSlot.add(localsInSlot);
+                        List<LocalVariableGen> listOfLocalsInSlot = new ArrayList<>();
+                        listOfLocalsInSlot.add((LocalVariableGen)localsInSlot);
                         listOfLocalsInSlot.add(lvg);
                         _variables.set(slot, listOfLocalsInSlot);
                     } else {
-                        ((ArrayList) localsInSlot).add(lvg);
+                        ((List<LocalVariableGen>) localsInSlot).add(lvg);
                     }
                 } else {
                     _variables.set(slot, lvg);
@@ -369,12 +369,11 @@
                         return lvg;
                     }
                 } else {
-                    ArrayList listOfLocalsInSlot = (ArrayList) localsInSlot;
-                    int size = listOfLocalsInSlot.size();
+                    @SuppressWarnings("unchecked")
+                    List<LocalVariableGen> listOfLocalsInSlot =
+                            (List<LocalVariableGen>) localsInSlot;
 
-                    for (int i = 0; i < size; i++) {
-                        LocalVariableGen lvg =
-                            (LocalVariableGen)listOfLocalsInSlot.get(i);
+                    for (LocalVariableGen lvg : listOfLocalsInSlot) {
                         if (offsetInLocalVariableGenRange(lvg, offset)) {
                             return lvg;
                         }
@@ -403,20 +402,21 @@
          * {@link #removeByNameTracking(LocalVariableGen)}</P
          * @param lvg a <code>LocalVariableGen</code>
          */
+        @SuppressWarnings("unchecked")
         protected void registerByName(LocalVariableGen lvg) {
             Object duplicateNameEntry = _nameToLVGMap.get(lvg.getName());
 
             if (duplicateNameEntry == null) {
                 _nameToLVGMap.put(lvg.getName(), lvg);
             } else {
-                ArrayList sameNameList;
+                List<LocalVariableGen> sameNameList;
 
                 if (duplicateNameEntry instanceof ArrayList) {
-                    sameNameList = (ArrayList) duplicateNameEntry;
+                    sameNameList = (List<LocalVariableGen>)duplicateNameEntry;
                     sameNameList.add(lvg);
                 } else {
-                    sameNameList = new ArrayList();
-                    sameNameList.add(duplicateNameEntry);
+                    sameNameList = new ArrayList<>();
+                    sameNameList.add((LocalVariableGen)duplicateNameEntry);
                     sameNameList.add(lvg);
                 }
 
@@ -431,11 +431,13 @@
          * {@link #lookUpByName(String)}
          * @param lvg a <code>LocalVariableGen</code>
          */
+        @SuppressWarnings("unchecked")
         protected void removeByNameTracking(LocalVariableGen lvg) {
             Object duplicateNameEntry = _nameToLVGMap.get(lvg.getName());
 
             if (duplicateNameEntry instanceof ArrayList) {
-                ArrayList sameNameList = (ArrayList) duplicateNameEntry;
+                List<LocalVariableGen> sameNameList =
+                        (List<LocalVariableGen>)duplicateNameEntry;
                 for (int i = 0; i < sameNameList.size(); i++) {
                     if (sameNameList.get(i) == lvg) {
                         sameNameList.remove(i);
@@ -455,16 +457,18 @@
          * @param name
          * @return
          */
+        @SuppressWarnings("unchecked")
         protected LocalVariableGen lookUpByName(String name) {
             LocalVariableGen lvg = null;
             Object duplicateNameEntry = _nameToLVGMap.get(name);
 
             if (duplicateNameEntry instanceof ArrayList) {
-                ArrayList sameNameList = (ArrayList) duplicateNameEntry;
+                List<LocalVariableGen> sameNameList =
+                        (List<LocalVariableGen>)duplicateNameEntry;
 
                 for (int i = 0; i < sameNameList.size(); i++) {
-                    lvg = (LocalVariableGen)sameNameList.get(i);
-                    if (lvg.getName() == name) {
+                    lvg = sameNameList.get(i);
+                    if (lvg.getName() == null ? name == null : lvg.getName().equals(name)) {
                         break;
                     }
                 }
@@ -489,9 +493,10 @@
          * @return an array of <code>LocalVariableGen</code> containing all the
          * local variables
          */
+        @SuppressWarnings("unchecked")
         protected LocalVariableGen[] getLocals(boolean includeRemoved) {
             LocalVariableGen[] locals = null;
-            ArrayList allVarsEverDeclared = new ArrayList();
+            List<LocalVariableGen> allVarsEverDeclared = new ArrayList<>();
 
             if (includeRemoved) {
                 int slotCount = allVarsEverDeclared.size();
@@ -500,31 +505,29 @@
                     Object slotEntries = _variables.get(i);
                     if (slotEntries != null) {
                         if (slotEntries instanceof ArrayList) {
-                            ArrayList slotList = (ArrayList) slotEntries;
+                            List<LocalVariableGen> slotList =
+                                    (List<LocalVariableGen>)slotEntries;
 
                             for (int j = 0; j < slotList.size(); j++) {
                                 allVarsEverDeclared.add(slotList.get(i));
                             }
                         } else {
-                            allVarsEverDeclared.add(slotEntries);
+                            allVarsEverDeclared.add((LocalVariableGen)slotEntries);
                         }
                     }
                 }
             } else {
-                Iterator nameVarsPairsIter = _nameToLVGMap.entrySet().iterator();
-
-                while (nameVarsPairsIter.hasNext()) {
-                    Map.Entry nameVarsPair =
-                                  (Map.Entry) nameVarsPairsIter.next();
+                for (Map.Entry<String, Object> nameVarsPair : _nameToLVGMap.entrySet()) {
                     Object vars = nameVarsPair.getValue();
                     if (vars != null) {
                         if (vars instanceof ArrayList) {
-                            ArrayList varsList = (ArrayList) vars;
+                            List<LocalVariableGen> varsList =
+                                    (List<LocalVariableGen>) vars;
                             for (int i = 0; i < varsList.size(); i++) {
                                 allVarsEverDeclared.add(varsList.get(i));
                             }
                         } else {
-                            allVarsEverDeclared.add(vars);
+                            allVarsEverDeclared.add((LocalVariableGen)vars);
                         }
                     }
                 }
@@ -720,7 +723,7 @@
      * current method.  See {@link OutlineableChunkStart} and
      * {@link OutlineableChunkEnd} for more information.
      */
-    private class Chunk implements Comparable {
+    private class Chunk implements Comparable<Object> {
         /**
          * {@link InstructionHandle} of the first instruction in the outlineable
          * chunk.
@@ -821,15 +824,15 @@
      * @param classGen The {@link ClassGen} with which the generated methods
      *                 will be associated
      * @param totalMethodSize the size of the bytecode in the original method
-     * @return a <code>java.util.ArrayList</code> containing the
+     * @return a <code>java.util.List</code> containing the
      *  {@link MethodGenerator.Chunk}s that may be outlined from this method
      */
-    private ArrayList getCandidateChunks(ClassGenerator classGen,
+    private List<Chunk> getCandidateChunks(ClassGenerator classGen,
                                          int totalMethodSize) {
-        Iterator instructions = getInstructionList().iterator();
-        ArrayList candidateChunks = new ArrayList();
-        ArrayList currLevelChunks = new ArrayList();
-        Stack subChunkStack = new Stack();
+        Iterator<InstructionHandle> instructions = getInstructionList().iterator();
+        List<Chunk> candidateChunks = new ArrayList<>();
+        List<InstructionHandle> currLevelChunks = new ArrayList<>();
+        Stack<List<InstructionHandle>> subChunkStack = new Stack<>();
         boolean openChunkAtCurrLevel = false;
         boolean firstInstruction = true;
 
@@ -884,7 +887,7 @@
                 // from the outer level onto the stack
                 if (openChunkAtCurrLevel) {
                     subChunkStack.push(currLevelChunks);
-                    currLevelChunks = new ArrayList();
+                    currLevelChunks = new ArrayList<>();
                 }
 
                 openChunkAtCurrLevel = true;
@@ -892,7 +895,7 @@
             // Close off an open chunk
             } else if (currentHandle == null
                            || inst instanceof OutlineableChunkEnd) {
-                ArrayList nestedSubChunks = null;
+                List<InstructionHandle> nestedSubChunks = null;
 
                 // If the last MarkerInstruction encountered was an
                 // OutlineableChunkEnd, it means that the current instruction
@@ -901,7 +904,7 @@
                 // are better candidates for outlining than the current chunk.
                 if (!openChunkAtCurrLevel) {
                     nestedSubChunks = currLevelChunks;
-                    currLevelChunks = (ArrayList)subChunkStack.pop();
+                    currLevelChunks = (List<InstructionHandle>)subChunkStack.pop();
                 }
 
                 // Get the handle for the start of this chunk (the last entry
@@ -948,14 +951,12 @@
                             }
 
                             // Merge adjacent siblings
-                            ArrayList mergedChildChunks =
+                            List<Chunk> mergedChildChunks =
                                         mergeAdjacentChunks(childChunks);
 
                             // Add chunks that mean minimum size requirements
                             // to the list of candidate chunks for outlining
-                            for (int i = 0; i < mergedChildChunks.size(); i++) {
-                                Chunk mergedChunk =
-                                    (Chunk)mergedChildChunks.get(i);
+                            for (Chunk mergedChunk : mergedChildChunks) {
                                 int mergedSize = mergedChunk.getChunkSize();
 
                                 if (mergedSize >= MINIMUM_OUTLINEABLE_CHUNK_SIZE
@@ -987,10 +988,10 @@
      * @param chunks array of sibling {@link MethodGenerator.Chunk}s that are
      *               under consideration for outlining.  Chunks must be in
      *               the order encountered in the {@link InstructionList}
-     * @return a <code>java.util.ArrayList</code> of
+     * @return a <code>java.util.List</code> of
      *         <code>MethodGenerator.Chunk</code>s maximally merged
      */
-    private ArrayList mergeAdjacentChunks(Chunk[] chunks) {
+    private List<Chunk> mergeAdjacentChunks(Chunk[] chunks) {
         int[] adjacencyRunStart = new int[chunks.length];
         int[] adjacencyRunLength = new int[chunks.length];
         boolean[] chunkWasMerged = new boolean[chunks.length];
@@ -999,7 +1000,7 @@
         int startOfCurrentRun;
         int numAdjacentRuns = 0;
 
-        ArrayList mergedChunks = new ArrayList();
+        List<Chunk> mergedChunks = new ArrayList<>();
 
         startOfCurrentRun = 0;
 
@@ -1133,7 +1134,7 @@
      */
     public Method[] outlineChunks(ClassGenerator classGen,
                                   int originalMethodSize) {
-        ArrayList methodsOutlined = new ArrayList();
+        List<Method> methodsOutlined = new ArrayList<>();
         int currentMethodSize = originalMethodSize;
 
         int outlinedCount = 0;
@@ -1154,7 +1155,7 @@
         do {
             // Get all the best candidates for outlining, and sort them in
             // ascending order of size
-            ArrayList candidateChunks = getCandidateChunks(classGen,
+            List<Chunk> candidateChunks = getCandidateChunks(classGen,
                                                            currentMethodSize);
             Collections.sort(candidateChunks);
 
@@ -1352,14 +1353,14 @@
         // method to instruction handles in the outlined method.  Only need
         // to track instructions that are targeted by something else in the
         // generated BCEL
-        HashMap targetMap   = new HashMap();
+        HashMap<InstructionHandle, InstructionHandle> targetMap = new HashMap<>();
 
         // Keeps track of the mapping from local variables in the old method
         // to local variables in the outlined method.
-        HashMap localVarMap = new HashMap();
+        HashMap<LocalVariableGen, LocalVariableGen> localVarMap = new HashMap<>();
 
-        HashMap revisedLocalVarStart = new HashMap();
-        HashMap revisedLocalVarEnd = new HashMap();
+        HashMap<LocalVariableGen, InstructionHandle> revisedLocalVarStart = new HashMap<>();
+        HashMap<LocalVariableGen, InstructionHandle> revisedLocalVarEnd = new HashMap<>();
 
         // Pass 1: Make copies of all instructions, append them to the new list
         // and associate old instruction references with the new ones, i.e.,
@@ -1415,8 +1416,7 @@
                             getLocalVariableRegistry()
                                 .lookupRegisteredLocalVariable(oldLocalVarIndex,
                                                               ih.getPosition());
-                    LocalVariableGen newLVG =
-                            (LocalVariableGen)localVarMap.get(oldLVG);
+                    LocalVariableGen newLVG = localVarMap.get(oldLVG);
 
                     // Has the code already mapped this local variable to a
                     // local in the new method?
@@ -1574,8 +1574,7 @@
                 InstructionHandle itarget = bi.getTarget(); // old target
 
                 // New target must be in targetMap
-                InstructionHandle newTarget =
-                    (InstructionHandle)targetMap.get(itarget);
+                InstructionHandle newTarget = targetMap.get(itarget);
 
                 bc.setTarget(newTarget);
 
@@ -1587,8 +1586,7 @@
 
                     // Update all targets
                     for (int j=0; j < itargets.length; j++) {
-                        ctargets[j] =
-                            (InstructionHandle)targetMap.get(itargets[j]);
+                        ctargets[j] = targetMap.get(itargets[j]);
                     }
                 }
             }  else if (i instanceof LocalVariableInstruction
@@ -1602,8 +1600,7 @@
                         getLocalVariableRegistry()
                                 .lookupRegisteredLocalVariable(oldLocalVarIndex,
                                                               ih.getPosition());
-                LocalVariableGen newLVG =
-                        (LocalVariableGen)localVarMap.get(oldLVG);
+                LocalVariableGen newLVG = localVarMap.get(oldLVG);
                 int newLocalVarIndex;
 
                 if (newLVG == null) {
@@ -1645,10 +1642,9 @@
 
                     if (targeter instanceof LocalVariableGen
                             && ((LocalVariableGen)targeter).getEnd()==ih) {
-                        Object newLVG = localVarMap.get(targeter);
+                        LocalVariableGen newLVG = localVarMap.get(targeter);
                         if (newLVG != null) {
-                            outlinedMethodGen.removeLocalVariable(
-                                                  (LocalVariableGen)newLVG);
+                            outlinedMethodGen.removeLocalVariable(newLVG);
                         }
                     }
                 }
@@ -1667,29 +1663,18 @@
         // POP the reference to the CopyLocals object from the stack
         oldMethCopyOutIL.append(InstructionConst.POP);
 
-        // Now that the generation of the outlined code is complete, update
-        // the old local variables with new start and end ranges, as required.
-        Iterator revisedLocalVarStartPairIter = revisedLocalVarStart.entrySet()
-                                                                    .iterator();
-        while (revisedLocalVarStartPairIter.hasNext()) {
-            Map.Entry lvgRangeStartPair =
-                    (Map.Entry)revisedLocalVarStartPairIter.next();
-            LocalVariableGen lvg = (LocalVariableGen)lvgRangeStartPair.getKey();
-            InstructionHandle startInst =
-                    (InstructionHandle)lvgRangeStartPair.getValue();
+        for (Map.Entry<LocalVariableGen, InstructionHandle> lvgRangeStartPair :
+                revisedLocalVarStart.entrySet()) {
+            LocalVariableGen lvg = lvgRangeStartPair.getKey();
+            InstructionHandle startInst = lvgRangeStartPair.getValue();
 
             lvg.setStart(startInst);
-
         }
 
-        Iterator revisedLocalVarEndPairIter = revisedLocalVarEnd.entrySet()
-                                                                .iterator();
-        while (revisedLocalVarEndPairIter.hasNext()) {
-            Map.Entry lvgRangeEndPair =
-                    (Map.Entry)revisedLocalVarEndPairIter.next();
-            LocalVariableGen lvg = (LocalVariableGen)lvgRangeEndPair.getKey();
-            InstructionHandle endInst =
-                    (InstructionHandle)lvgRangeEndPair.getValue();
+        for (Map.Entry<LocalVariableGen, InstructionHandle> lvgRangeEndPair :
+                revisedLocalVarEnd.entrySet()) {
+            LocalVariableGen lvg = lvgRangeEndPair.getKey();
+            InstructionHandle endInst = lvgRangeEndPair.getValue();
 
             lvg.setEnd(endInst);
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.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,7 +21,8 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
 
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -29,7 +30,7 @@
  */
 public final class MethodType extends Type {
     private final Type _resultType;
-    private final Vector _argsType;
+    private final List<Type> _argsType;
 
     public MethodType(Type resultType) {
         _argsType = null;
@@ -38,8 +39,8 @@
 
     public MethodType(Type resultType, Type arg1) {
         if (arg1 != Type.Void) {
-            _argsType = new Vector();
-            _argsType.addElement(arg1);
+            _argsType = new ArrayList<>();
+            _argsType.add(arg1);
         }
         else {
             _argsType = null;
@@ -48,21 +49,21 @@
     }
 
     public MethodType(Type resultType, Type arg1, Type arg2) {
-        _argsType = new Vector(2);
-        _argsType.addElement(arg1);
-        _argsType.addElement(arg2);
+        _argsType = new ArrayList<>(2);
+        _argsType.add(arg1);
+        _argsType.add(arg2);
         _resultType = resultType;
     }
 
     public MethodType(Type resultType, Type arg1, Type arg2, Type arg3) {
-        _argsType = new Vector(3);
-        _argsType.addElement(arg1);
-        _argsType.addElement(arg2);
-        _argsType.addElement(arg3);
+        _argsType = new ArrayList<>(3);
+        _argsType.add(arg1);
+        _argsType.add(arg2);
+        _argsType.add(arg3);
         _resultType = resultType;
     }
 
-    public MethodType(Type resultType, Vector argsType) {
+    public MethodType(Type resultType, List<Type> argsType) {
         _resultType = resultType;
         _argsType = argsType.size() > 0 ? argsType : null;
     }
@@ -72,7 +73,7 @@
         if (_argsType != null) {
             final int count = _argsType.size();
             for (int i=0; i<count; i++) {
-                result.append(_argsType.elementAt(i));
+                result.append(_argsType.get(i));
                 if (i != (count-1)) result.append(',');
             }
         }
@@ -97,7 +98,7 @@
         if (_argsType != null) {
             final int n = _argsType.size();
             for (int i = 0; i < n; i++) {
-                buffer.append(((Type)_argsType.elementAt(i)).toSignature());
+                buffer.append((_argsType.get(i)).toSignature());
             }
         }
         return buffer
@@ -119,8 +120,8 @@
                 final int len = argsCount();
                 result = len == temp.argsCount();
                 for (int i = 0; i < len && result; i++) {
-                    final Type arg1 = (Type)_argsType.elementAt(i);
-                    final Type arg2 = (Type)temp._argsType.elementAt(i);
+                    final Type arg1 = _argsType.get(i);
+                    final Type arg2 = temp._argsType.get(i);
                     result = arg1.identicalTo(arg2);
                 }
             }
@@ -137,8 +138,8 @@
                 if (len == mtype._argsType.size()) {
                     result = 0;
                     for (int i = 0; i < len; i++) {
-                        Type arg1 = (Type) _argsType.elementAt(i);
-                        Type arg2 = (Type) mtype._argsType.elementAt(i);
+                        Type arg1 = _argsType.get(i);
+                        Type arg2 = mtype._argsType.get(i);
                         final int temp = arg1.distanceTo(arg2);
                         if (temp == Integer.MAX_VALUE) {
                             result = temp;  // return MAX_VALUE
@@ -161,7 +162,7 @@
         return _resultType;
     }
 
-    public Vector argsType() {
+    public List<Type> argsType() {
         return _argsType;
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -98,7 +98,7 @@
      * Expects the Java object on the stack, pushes the internal type
      */
     public void translateFrom(ClassGenerator classGen,
-        MethodGenerator methodGen, Class clazz)
+        MethodGenerator methodGen, Class<?> clazz)
     {
 
         InstructionList il = methodGen.getInstructionList();
@@ -242,7 +242,7 @@
      * type after coercion.
      */
     public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-                            Class clazz) {
+                            Class<?> clazz) {
         final ConstantPoolGen cpg = classGen.getConstantPool();
         final InstructionList il = methodGen.getInstructionList();
         final String className = clazz.getName();
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -251,7 +251,7 @@
      * type after coercion.
      */
     public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-                            Class clazz) {
+                            Class<?> clazz) {
         final ConstantPoolGen cpg = classGen.getConstantPool();
         final InstructionList il = methodGen.getInstructionList();
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.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
@@ -31,8 +31,8 @@
 import com.sun.org.apache.bcel.internal.generic.Instruction;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.bcel.internal.generic.PUSH;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
 
 /**
  * @author Todd Miller
@@ -41,7 +41,7 @@
 public final class ObjectType extends Type {
 
     private String _javaClassName = "java.lang.Object";
-    private Class  _clazz = java.lang.Object.class;
+    private Class<?>  _clazz = java.lang.Object.class;
 
     /**
      * Used to represent a Java Class type such is required to support
@@ -59,7 +59,7 @@
         }
     }
 
-    protected ObjectType(Class clazz) {
+    protected ObjectType(Class<?> clazz) {
         _clazz = clazz;
         _javaClassName = clazz.getName();
     }
@@ -80,7 +80,7 @@
         return _javaClassName;
     }
 
-    public Class getJavaClass() {
+    public Class<?> getJavaClass() {
         return _clazz;
     }
 
@@ -149,7 +149,7 @@
      * when external functions are called.
      */
     public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-                            Class clazz) {
+                            Class<?> clazz) {
         if (clazz.isAssignableFrom(_clazz))
             methodGen.getInstructionList().append(NOP);
         else {
@@ -163,7 +163,7 @@
      * Translates an external Java type into an Object type
      */
     public void translateFrom(ClassGenerator classGen,
-                              MethodGenerator methodGen, Class clazz) {
+                              MethodGenerator methodGen, Class<?> clazz) {
         methodGen.getInstructionList().append(NOP);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -208,7 +209,7 @@
      * type after coercion.
      */
     public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-                            final Class clazz) {
+                            final Class<?> clazz) {
         final InstructionList il = methodGen.getInstructionList();
         if (clazz == Character.TYPE) {
             il.append(D2I);
@@ -250,7 +251,7 @@
      * object on the stack and pushes a real (i.e., a double).
      */
     public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen,
-                              Class clazz) {
+                              Class<?> clazz) {
         InstructionList il = methodGen.getInstructionList();
 
         if (clazz == Character.TYPE || clazz == Byte.TYPE ||
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,7 +21,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
 
-import com.sun.org.apache.bcel.internal.generic.PUSH;
 import com.sun.org.apache.bcel.internal.generic.ALOAD;
 import com.sun.org.apache.bcel.internal.generic.ASTORE;
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
@@ -31,10 +30,9 @@
 import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.Instruction;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
-
+import com.sun.org.apache.bcel.internal.generic.PUSH;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.FlowList;
-
 import com.sun.org.apache.xml.internal.dtm.DTM;
 
 /**
@@ -224,7 +222,7 @@
      * Translates a reference into the Java type denoted by <code>clazz</code>.
      */
     public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-                            Class clazz) {
+                            Class<?> clazz) {
         final ConstantPoolGen cpg = classGen.getConstantPool();
         final InstructionList il = methodGen.getInstructionList();
 
@@ -326,7 +324,7 @@
      * allowed is from java.lang.Object.
      */
     public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen,
-                              Class clazz) {
+                              Class<?> clazz) {
         if (clazz.getName().equals("java.lang.Object")) {
             methodGen.getInstructionList().append(NOP);
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -398,7 +398,7 @@
      * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
      */
     public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-                            Class clazz) {
+                            Class<?> clazz) {
         final String className = clazz.getName();
         final ConstantPoolGen cpg = classGen.getConstantPool();
         final InstructionList il = methodGen.getInstructionList();
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.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
@@ -27,17 +27,17 @@
  * @author Jacek Ambroziak
  * @author Santiago Pericas-Geertsen
  */
-public final class StringStack extends Stack {
+public final class StringStack extends Stack<String> {
     static final long serialVersionUID = -1506910875640317898L;
     public String peekString() {
-        return (String) super.peek();
+        return super.peek();
     }
 
     public String popString() {
-        return (String) super.pop();
+        return super.pop();
     }
 
     public String pushString(String val) {
-        return (String) super.push(val);
+        return super.push(val);
     }
 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -156,7 +156,7 @@
      * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateFrom
      */
     public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-                            Class clazz)
+                            Class<?> clazz)
     {
         // Is String <: clazz? I.e. clazz in { String, Object }
         if (clazz.isAssignableFrom(java.lang.String.class)) {
@@ -175,7 +175,7 @@
      * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateFrom
      */
     public void translateFrom(ClassGenerator classGen,
-        MethodGenerator methodGen, Class clazz)
+        MethodGenerator methodGen, Class<?> clazz)
     {
         final ConstantPoolGen cpg = classGen.getConstantPool();
         final InstructionList il = methodGen.getInstructionList();
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.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
@@ -76,7 +76,7 @@
      * Factory method to instantiate object types. Returns a pre-defined
      * instance for java.lang.Object.class and java.lang.String.class.
      */
-    public static Type newObjectType(Class clazz) {
+    public static Type newObjectType(Class<?> clazz) {
         if (clazz == java.lang.Object.class) {
             return Type.Object;
         }
@@ -189,7 +189,7 @@
      * when external functions are called.
      */
     public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
-                            Class clazz) {
+                            Class<?> clazz) {
         ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
                                     toString(), clazz.getClass().toString());
         classGen.getParser().reportError(Constants.FATAL, err);
@@ -201,7 +201,7 @@
      * when external functions are called.
      */
     public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen,
-                              Class clazz) {
+                              Class<?> clazz) {
         ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
                                     clazz.getClass().toString(), toString());
         classGen.getParser().reportError(Constants.FATAL, err);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -88,7 +88,7 @@
      * Only an external "void" can be converted to this class.
      */
     public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen,
-                              Class clazz) {
+                              Class<?> clazz) {
         if (!clazz.getName().equals("void")) {
             ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
                                         toString(), clazz.getName());
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -59,7 +60,7 @@
     /**
      * A mapping from a document node to the mapping between values and nodesets
      */
-    private Map<Integer, Map> _rootToIndexMap = new HashMap<>();
+    private Map<Integer, Map<String, IntegerArray>> _rootToIndexMap = new HashMap<>();
 
     /**
      * The node set associated to the current value passed
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.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,12 +21,12 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.dom;
 
-import java.util.Vector;
-
 import com.sun.org.apache.xalan.internal.xsltc.DOM;
 import com.sun.org.apache.xalan.internal.xsltc.Translet;
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Jacek Ambroziak
@@ -52,8 +52,8 @@
 
     private boolean _separFirst = true;
     private boolean _separLast = false;
-    private Vector _separToks = new Vector();
-    private Vector _formatToks = new Vector();
+    private List<String> _separToks = new ArrayList<>();
+    private List<String> _formatToks = new ArrayList<>();
     private int _nSepars  = 0;
     private int _nFormats = 0;
 
@@ -204,10 +204,10 @@
                  }
                  if (i > j) {
                      if (isFirst) {
-                         _separToks.addElement(".");
+                         _separToks.add(".");
                          isFirst = _separFirst = false;
                      }
-                     _formatToks.addElement(format.substring(j, i));
+                     _formatToks.add(format.substring(j, i));
                  }
 
                  if (i == length) break;
@@ -219,7 +219,7 @@
                      isFirst = false;
                  }
                  if (i > j) {
-                     _separToks.addElement(format.substring(j, i));
+                     _separToks.add(format.substring(j, i));
                  }
              }
 
@@ -230,7 +230,7 @@
          if (_separFirst) _nSepars--;
          if (_separLast) _nSepars--;
          if (_nSepars == 0) {
-             _separToks.insertElementAt(".", 1);
+             _separToks.add(1, ".");
              _nSepars++;
          }
          if (_separFirst) _nSepars ++;
@@ -305,14 +305,14 @@
     final StringBuilder buffer = _tempBuffer;
 
     // Append separation token before first digit/letter/numeral
-    if (_separFirst) buffer.append((String)_separToks.elementAt(0));
+    if (_separFirst) buffer.append(_separToks.get(0));
 
     // Append next digit/letter/numeral and separation token
     while (n < nValues) {
         final int value = values[n];
         if (value != Integer.MIN_VALUE) {
-        if (!isFirst) buffer.append((String) _separToks.elementAt(s++));
-        formatValue(value, (String)_formatToks.elementAt(t++), buffer);
+        if (!isFirst) buffer.append(_separToks.get(s++));
+        formatValue(value, _formatToks.get(t++), buffer);
         if (t == _nFormats) t--;
         if (s >= _nSepars) s--;
         isFirst = false;
@@ -321,7 +321,7 @@
     }
 
     // Append separation token after last digit/letter/numeral
-    if (_separLast) buffer.append((String)_separToks.lastElement());
+    if (_separLast) buffer.append(_separToks.get(_separToks.size() - 1));
     return buffer.toString();
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -27,7 +27,6 @@
 import com.sun.org.apache.xalan.internal.xsltc.TransletException;
 import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
 import com.sun.org.apache.xml.internal.utils.StringComparable;
-import java.text.CollationKey;
 import java.text.Collator;
 import java.util.Locale;
 import jdk.xml.internal.SecuritySupport;
@@ -157,6 +156,7 @@
      * element. The value is extracted from the DOM if it is not already in
      * our sort key vector.
      */
+    @SuppressWarnings({"rawtypes", "unchecked"})
     private final Comparable stringValue(int level) {
         // Get value from our array if possible
         if (_scanned <= level) {
@@ -167,10 +167,8 @@
             // Get value from DOM if accessed for the first time
             final String str = extractValueFromDOM(_dom, _node, level,
                                                    translet, _last);
-            final Comparable key =
-                StringComparable.getComparator(str, locales[level],
-                                               _collators[level],
-                                               caseOrder[level]);
+            final Comparable key = StringComparable.getComparator(
+                    str, locales[level], _collators[level], caseOrder[level]);
             _values[_scanned++] = key;
             return(key);
         }
@@ -206,6 +204,7 @@
      *
      * !!!!MUST OPTIMISE - THIS IS REALLY, REALLY SLOW!!!!
      */
+    @SuppressWarnings({"rawtypes", "unchecked"})
     public int compareTo(NodeSortRecord other) {
         int cmp, level;
         int[] sortOrder = _settings.getSortOrders();
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -20,15 +21,15 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.dom;
 
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
 import com.sun.org.apache.xalan.internal.xsltc.DOM;
 import com.sun.org.apache.xalan.internal.xsltc.Translet;
 import com.sun.org.apache.xalan.internal.xsltc.TransletException;
 import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
 import com.sun.org.apache.xml.internal.utils.LocaleUtility;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
 import java.lang.reflect.InvocationTargetException;
+import java.text.Collator;
 import java.util.Locale;
-import java.text.Collator;
 
 public class NodeSortRecordFactory {
 
@@ -37,7 +38,7 @@
 
     private final DOM      _dom;
     private final String   _className;
-    private Class _class;
+    private Class<?> _class;
     private SortSettings _sortSettings;
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -33,15 +34,14 @@
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
 import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xml.internal.serializer.ToStream;
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.text.DecimalFormat;
 import java.text.DecimalFormatSymbols;
 import java.util.ArrayList;
-import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -71,7 +71,7 @@
     public String  _doctypeSystem = null;
     public boolean _indent = false;
     public String  _mediaType = null;
-    public ArrayList<String> _cdata = null;
+    public List<String> _cdata = null;
     public int _indentamount = -1;
 
     public static final int FIRST_TRANSLET_VERSION = 100;
@@ -149,7 +149,7 @@
     // Parameter's stack: <tt>pbase</tt> and <tt>pframe</tt> are used
     // to denote the current parameter frame.
     protected int pbase = 0, pframe = 0;
-    protected ArrayList paramsStack = new ArrayList();
+    protected List<Object> paramsStack = new ArrayList<>();
 
     /**
      * Push a new parameter frame.
@@ -164,7 +164,7 @@
      */
     public final void popParamFrame() {
         if (pbase > 0) {
-            final int oldpbase = ((Integer)paramsStack.get(--pbase)).intValue();
+            final int oldpbase = ((Integer)paramsStack.get(--pbase));
             for (int i = pframe - 1; i >= pbase; i--) {
                 paramsStack.remove(i);
             }
@@ -716,7 +716,7 @@
 
     private Map<String, Class<?>> _auxClasses = null;
 
-    public void addAuxiliaryClass(Class auxClass) {
+    public void addAuxiliaryClass(Class<?> auxClass) {
         if (_auxClasses == null) _auxClasses = new HashMap<>();
         _auxClasses.put(auxClass.getName(), auxClass);
     }
@@ -725,7 +725,7 @@
         _auxClasses = auxClasses;
     }
 
-    public Class getAuxiliaryClass(String className) {
+    public Class<?> getAuxiliaryClass(String className) {
         if (_auxClasses == null) return null;
         return((Class)_auxClasses.get(className));
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -25,6 +26,7 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Stack;
 import org.w3c.dom.NamedNodeMap;
@@ -103,7 +105,7 @@
             }
         } else {
             _sax.startPrefixMapping(prefix, uri);
-            _nsPrefixes.put(prefix, uriStack = new Stack());
+            _nsPrefixes.put(prefix, uriStack = new Stack<>());
             uriStack.push(uri);
         }
         return pushed;
@@ -194,7 +196,7 @@
             break;
         case Node.ELEMENT_NODE:
             String prefix;
-            ArrayList<String> pushedPrefixes = new ArrayList<>();
+            List<String> pushedPrefixes = new ArrayList<>();
             final AttributesImpl attrs = new AttributesImpl();
             final NamedNodeMap map = node.getAttributes();
             final int length = map.getLength();
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.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
@@ -22,21 +22,19 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
 
+import com.sun.org.apache.xalan.internal.xsltc.runtime.Constants;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Stack;
-import java.util.Vector;
 import javax.xml.parsers.DocumentBuilder;
-
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Constants;
-
 import org.w3c.dom.Comment;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
+import org.w3c.dom.ProcessingInstruction;
 import org.w3c.dom.Text;
-import org.w3c.dom.ProcessingInstruction;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.Locator;
@@ -54,8 +52,8 @@
     private Node _root = null;
     private Document _document = null;
     private Node _nextSibling = null;
-    private Stack _nodeStk = new Stack();
-    private Vector _namespaceDecls = null;
+    private Stack<Node> _nodeStk = new Stack<>();
+    private List<String> _namespaceDecls = null;
     private Node _lastSibling = null;
     private Locator locator = null;
     private boolean needToSetDocumentInfo = true;
@@ -107,7 +105,7 @@
             return;
         }
 
-        final Node last = (Node)_nodeStk.peek();
+        final Node last = _nodeStk.peek();
 
         // No text nodes can be children of root (DOM006 exception)
         if (last != _document) {
@@ -117,7 +115,7 @@
     }
     private void appendTextNode() {
         if (_textBuffer.length() > 0) {
-            final Node last = (Node)_nodeStk.peek();
+            final Node last = _nodeStk.peek();
             if (last == _root && _nextSiblingCache != null) {
                 _lastSibling = last.insertBefore(_document.createTextNode(_textBuffer.toString()), _nextSiblingCache);
             }
@@ -159,15 +157,15 @@
         if (_namespaceDecls != null) {
             final int nDecls = _namespaceDecls.size();
             for (int i = 0; i < nDecls; i++) {
-                final String prefix = (String) _namespaceDecls.elementAt(i++);
+                final String prefix = _namespaceDecls.get(i++);
 
                 if (prefix == null || prefix.equals(EMPTYSTRING)) {
                     tmp.setAttributeNS(XMLNS_URI, XMLNS_PREFIX,
-                        (String) _namespaceDecls.elementAt(i));
+                        _namespaceDecls.get(i));
                 }
                 else {
                     tmp.setAttributeNS(XMLNS_URI, XMLNS_STRING + prefix,
-                        (String) _namespaceDecls.elementAt(i));
+                        _namespaceDecls.get(i));
                 }
             }
             _namespaceDecls.clear();
@@ -207,7 +205,7 @@
 
 
         // Append this new node onto current stack node
-        Node last = (Node)_nodeStk.peek();
+        Node last = _nodeStk.peek();
 
         // If the SAX2DOM is created with a non-null next sibling node,
         // insert the result nodes before the next sibling under the root.
@@ -229,10 +227,10 @@
 
     public void startPrefixMapping(String prefix, String uri) {
         if (_namespaceDecls == null) {
-            _namespaceDecls = new Vector(2);
+            _namespaceDecls = new ArrayList<>(2);
         }
-        _namespaceDecls.addElement(prefix);
-        _namespaceDecls.addElement(uri);
+        _namespaceDecls.add(prefix);
+        _namespaceDecls.add(uri);
     }
 
     public void endPrefixMapping(String prefix) {
@@ -251,7 +249,7 @@
      */
     public void processingInstruction(String target, String data) {
         appendTextNode();
-        final Node last = (Node)_nodeStk.peek();
+        final Node last = _nodeStk.peek();
         ProcessingInstruction pi = _document.createProcessingInstruction(
                 target, data);
         if (pi != null){
@@ -285,7 +283,7 @@
      */
     public void comment(char[] ch, int start, int length) {
         appendTextNode();
-        final Node last = (Node)_nodeStk.peek();
+        final Node last = _nodeStk.peek();
         Comment comment = _document.createComment(new String(ch,start,length));
         if (comment != null){
           if (last == _root && _nextSibling != null)
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +26,11 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
 
-import java.util.Vector;
-
+import java.util.ArrayList;
+import java.util.List;
 import javax.xml.stream.Location;
 import javax.xml.stream.XMLReporter;
 import javax.xml.stream.XMLStreamException;
-
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -48,7 +48,7 @@
 
         protected StringBuffer CDATABuffer;
 
-        protected Vector namespaces;
+        protected List<String> namespaces;
 
         protected Locator docLocator;
 
@@ -92,7 +92,7 @@
         }
 
         public void startDocument() throws SAXException {
-                    namespaces = new Vector(2);
+                    namespaces = new ArrayList<>(2);
         }
 
         public void endDocument() throws SAXException {
@@ -119,10 +119,10 @@
                 }
 
                 if (namespaces == null) {
-                    namespaces = new Vector(2);
+                    namespaces = new ArrayList<>(2);
                 }
-                namespaces.addElement(prefix);
-                namespaces.addElement(uri);
+                namespaces.add(prefix);
+                namespaces.add(uri);
         }
 
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,12 +33,10 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-
 import javax.xml.stream.XMLEventFactory;
+import javax.xml.stream.XMLEventWriter;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.*;
-import javax.xml.stream.XMLEventWriter;
-
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.ext.Locator2;
@@ -54,7 +53,7 @@
     private XMLEventFactory eventFactory;
 
 
-    private List namespaceStack = new ArrayList();
+    private List<Collection<Namespace>> namespaceStack = new ArrayList<>();
 
 
     private boolean needToCallStartDocument = false;
@@ -169,6 +168,7 @@
 
     }
 
+    @SuppressWarnings({"rawtypes", "unchecked"})
     public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
 
         if (needToCallStartDocument) {
@@ -216,8 +216,8 @@
         parseQName(qName, qname);
 
         // get namespaces
-        Collection nsList = (Collection) namespaceStack.remove(namespaceStack.size() - 1);
-        Iterator nsIter = nsList.iterator();
+        Collection<Namespace> nsList = namespaceStack.remove(namespaceStack.size() - 1);
+        Iterator<Namespace> nsIter = nsList.iterator();
 
         try {
 
@@ -327,21 +327,21 @@
 
     }
 
-
-    protected void createStartEvents(Attributes attributes, Collection[] events) {
+    @SuppressWarnings({"rawtypes", "unchecked"})
+    protected void createStartEvents(Attributes attributes, Collection<Attribute>[] events) {
 
-        Map nsMap = null;
-        List attrs = null;
+        Map<String, Attribute> nsMap = null;
+        List<Attribute> attrs = null;
 
         // create namespaces
         if (namespaces != null) {
             final int nDecls = namespaces.size();
             for (int i = 0; i < nDecls; i++) {
-                final String prefix = (String) namespaces.elementAt(i++);
-                String uri = (String) namespaces.elementAt(i);
+                final String prefix = (String) namespaces.get(i++);
+                String uri = (String) namespaces.get(i);
                 Namespace ns = createNamespace(prefix, uri);
                 if (nsMap == null) {
-                    nsMap = new HashMap();
+                    nsMap = new HashMap<>();
                 }
                 nsMap.put(prefix, ns);
             }
@@ -365,7 +365,7 @@
                 // namespace has already been declared, skip it, otherwise
                 // write it as an namespace
                 if (nsMap == null) {
-                    nsMap = new HashMap();
+                    nsMap = new HashMap<>();
                 }
 
                 if (!nsMap.containsKey(attrLocal)) {
@@ -389,9 +389,7 @@
                 }
 
                 if (attrs == null) {
-
-                    attrs = new ArrayList();
-
+                    attrs = new ArrayList<>();
                 }
                 attrs.add(attribute);
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +26,21 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
 
+import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
 import java.io.IOException;
 import java.util.Iterator;
-
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.Characters;
+import javax.xml.stream.events.EndElement;
+import javax.xml.stream.events.Namespace;
+import javax.xml.stream.events.ProcessingInstruction;
+import javax.xml.stream.events.StartDocument;
+import javax.xml.stream.events.StartElement;
+import javax.xml.stream.events.XMLEvent;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.DTDHandler;
@@ -40,22 +53,8 @@
 import org.xml.sax.SAXNotSupportedException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.ext.Locator2;
 import org.xml.sax.helpers.AttributesImpl;
-import org.xml.sax.ext.Locator2;
-import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.Characters;
-import javax.xml.stream.events.EndElement;
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.ProcessingInstruction;
-import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.stream.events.StartDocument;
 
 
 /**
@@ -337,8 +336,8 @@
                 qname);
 
             // end namespace bindings
-            for( Iterator i = event.getNamespaces(); i.hasNext();) {
-                String prefix = (String)i.next();
+            for( Iterator<Namespace> i = event.getNamespaces(); i.hasNext();) {
+                String prefix = (i.next()).getPrefix();
                 if( prefix == null ) { // true for default namespace
                     prefix = "";
                 }
@@ -353,8 +352,8 @@
         throws XMLStreamException {
         try {
             // start namespace bindings
-            for (Iterator i = event.getNamespaces(); i.hasNext();) {
-                String prefix = ((Namespace)i.next()).getPrefix();
+            for (Iterator<Namespace> i = event.getNamespaces(); i.hasNext();) {
+                String prefix = (i.next()).getPrefix();
                 if (prefix == null) { // true for default namespace
                     prefix = "";
                 }
@@ -402,8 +401,8 @@
         // we don't use it.) So don't add xmlns:* to attributes.
 
         // gather non-namespace attrs
-        for (Iterator i = event.getAttributes(); i.hasNext();) {
-            Attribute staxAttr = (javax.xml.stream.events.Attribute)i.next();
+        for (Iterator<Attribute> i = event.getAttributes(); i.hasNext();) {
+            Attribute staxAttr = i.next();
 
             String uri = staxAttr.getName().getNamespaceURI();
             if (uri == null) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -97,7 +97,7 @@
      * Contains the translet class definition(s). These are created when
      * this Templates is created or when it is read back from disk.
      */
-    private Class[] _class = null;
+    private Class<?>[] _class = null;
 
     /**
      * The index of the main translet class in the arrays _class[] and
@@ -133,7 +133,7 @@
      * multiple threads.
      * Declaring it transient to fix bug 22438
      */
-    private transient ThreadLocal _sdom = new ThreadLocal();
+    private transient ThreadLocal<DOM> _sdom = new ThreadLocal<>();
 
     /**
      * A reference to the transformer factory that this templates
@@ -199,11 +199,11 @@
         /**
          * Access to final protected superclass member from outer class.
          */
-        Class defineClass(final byte[] b) {
+        Class<?> defineClass(final byte[] b) {
             return defineClass(null, b, 0, b.length);
         }
 
-        Class defineClass(final byte[] b, ProtectionDomain pd) {
+        Class<?> defineClass(final byte[] b, ProtectionDomain pd) {
             return defineClass(null, b, 0, b.length, pd);
         }
     }
@@ -275,7 +275,7 @@
         ObjectInputStream.GetField gf = is.readFields();
         _name = (String)gf.get("_name", null);
         _bytecodes = (byte[][])gf.get("_bytecodes", null);
-        _class = (Class[])gf.get("_class", null);
+        _class = (Class<?>[])gf.get("_class", null);
         _transletIndex = gf.get("_transletIndex", -1);
 
         _outputProperties = (Properties)gf.get("_outputProperties", null);
@@ -368,7 +368,7 @@
      * that the privateness of this method is maintained (that
      * is why it wasn't removed).
      */
-    private synchronized Class[] getTransletClasses() {
+    private synchronized Class<?>[] getTransletClasses() {
         try {
             if (_class == null) defineTransletClasses();
         }
@@ -461,16 +461,17 @@
             throw new TransformerConfigurationException(err.toString());
         }
 
-        TransletClassLoader loader = (TransletClassLoader)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return new TransletClassLoader(ObjectFactory.findClassLoader(),_tfactory.getExternalExtensionsMap());
+        TransletClassLoader loader =
+                AccessController.doPrivileged(new PrivilegedAction<TransletClassLoader>() {
+                public TransletClassLoader run() {
+                    return new TransletClassLoader(ObjectFactory.findClassLoader(),
+                            _tfactory.getExternalExtensionsMap());
                 }
             });
 
         try {
             final int classCount = _bytecodes.length;
-            _class = new Class[classCount];
+            _class = new Class<?>[classCount];
 
             if (classCount > 1) {
                 _auxClasses = new HashMap<>();
@@ -511,7 +512,7 @@
 
             for (int i = 0; i < classCount; i++) {
                 _class[i] = loader.defineClass(_bytecodes[i], pd);
-                final Class superClass = _class[i].getSuperclass();
+                final Class<?> superClass = _class[i].getSuperclass();
 
                 // Check if this is the main class
                 if (superClass.getName().equals(ABSTRACT_TRANSLET)) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -45,9 +45,9 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Vector;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 import javax.xml.XMLConstants;
@@ -841,7 +841,7 @@
     /**
      * Pass warning messages from the compiler to the error listener
      */
-    private void passWarningsToListener(ArrayList<ErrorMsg> messages)
+    private void passWarningsToListener(List<ErrorMsg> messages)
         throws TransformerException
     {
         if (_errorListener == null || messages == null) {
@@ -864,7 +864,7 @@
     /**
      * Pass error messages from the compiler to the error listener
      */
-    private void passErrorsToListener(ArrayList<ErrorMsg> messages) {
+    private void passErrorsToListener(List<ErrorMsg> messages) {
         try {
             if (_errorListener == null || messages == null) {
                 return;
@@ -1062,7 +1062,7 @@
 
         // Check that the transformation went well before returning
         if (bytecodes == null) {
-            ArrayList<ErrorMsg> errs = xsltc.getErrors();
+            List<ErrorMsg> errs = xsltc.getErrors();
             ErrorMsg err;
             if (errs != null) {
                 err = errs.get(errs.size()-1);
@@ -1443,7 +1443,7 @@
         }
 
         // Load the translet into a bytecode array.
-        Vector bytecodes = new Vector();
+        List<byte[]> bytecodes = new ArrayList<>();
         int fileLength = (int)transletFile.length();
         if (fileLength > 0) {
             FileInputStream input;
@@ -1463,7 +1463,7 @@
                 return null;
             }
 
-            bytecodes.addElement(bytes);
+            bytecodes.add(bytes);
         }
         else
             return null;
@@ -1509,16 +1509,16 @@
                     continue;
                 }
 
-                bytecodes.addElement(bytes);
+                bytecodes.add(bytes);
             }
         }
 
-        // Convert the Vector of byte[] to byte[][].
+        // Convert the ArrayList of byte[] to byte[][].
         final int count = bytecodes.size();
         if ( count > 0) {
             final byte[][] result = new byte[count][1];
             for (int i = 0; i < count; i++) {
-                result[i] = (byte[])bytecodes.elementAt(i);
+                result[i] = (byte[])bytecodes.get(i);
             }
 
             return result;
@@ -1579,11 +1579,11 @@
         String transletAuxPrefix = transletPath + "$";
         String transletFullName = transletPath + ".class";
 
-        Vector bytecodes = new Vector();
+        List<byte[]> bytecodes = new ArrayList<>();
 
         // Iterate through all entries in the jar file to find the
         // translet and auxiliary classes.
-        Enumeration entries = jarFile.entries();
+        Enumeration<? extends ZipEntry> entries = jarFile.entries();
         while (entries.hasMoreElements())
         {
             ZipEntry entry = (ZipEntry)entries.nextElement();
@@ -1599,7 +1599,7 @@
                     byte[] bytes = new byte[size];
                     readFromInputStream(bytes, input, size);
                     input.close();
-                    bytecodes.addElement(bytes);
+                    bytecodes.add(bytes);
                 }
                 catch (IOException e) {
                     return null;
@@ -1607,12 +1607,12 @@
             }
         }
 
-        // Convert the Vector of byte[] to byte[][].
+        // Convert the ArrayList of byte[] to byte[][].
         final int count = bytecodes.size();
         if (count > 0) {
             final byte[][] result = new byte[count][1];
             for (int i = 0; i < count; i++) {
-                result[i] = (byte[])bytecodes.elementAt(i);
+                result[i] = (byte[])bytecodes.get(i);
             }
 
             return result;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -53,6 +54,7 @@
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.StringTokenizer;
@@ -914,7 +916,7 @@
         throws IllegalArgumentException
     {
         if (properties != null) {
-            final Enumeration names = properties.propertyNames();
+            final Enumeration<?> names = properties.propertyNames();
 
             while (names.hasMoreElements()) {
                 final String name = (String) names.nextElement();
@@ -967,7 +969,7 @@
         if (_properties == null) return;
 
         // Get a list of all the defined properties
-        Enumeration names = _properties.propertyNames();
+        Enumeration<?> names = _properties.propertyNames();
         while (names.hasMoreElements()) {
             // Note the use of get() instead of getProperty()
             String name  = (String) names.nextElement();
@@ -1046,7 +1048,7 @@
         String doctypeSystem = null;
 
         // Get a list of all the defined properties
-        Enumeration names = _properties.propertyNames();
+        Enumeration<?> names = _properties.propertyNames();
         while (names.hasMoreElements()) {
             // Note the use of get() instead of getProperty()
             String name  = (String) names.nextElement();
@@ -1097,7 +1099,7 @@
             else if (name.equals(OutputKeys.CDATA_SECTION_ELEMENTS)) {
                 if (value != null) {
                     StringTokenizer e = new StringTokenizer(value);
-                    ArrayList<String> uriAndLocalNames = null;
+                    List<String> uriAndLocalNames = null;
                     while (e.hasMoreTokens()) {
                         final String token = e.nextToken();
 
@@ -1147,7 +1149,7 @@
         // Copy propeties set in stylesheet to base
         final Properties base = new Properties(defaults);
         if (outputProperties != null) {
-            final Enumeration names = outputProperties.propertyNames();
+            final Enumeration<?> names = outputProperties.propertyNames();
             while (names.hasMoreElements()) {
                 final String name = (String) names.nextElement();
                 base.setProperty(name, outputProperties.getProperty(name));
@@ -1184,12 +1186,12 @@
                 final Properties method_props =
                         OutputPropertiesFactory.getDefaultMethodProperties(method);
                 {
-                        final Enumeration names = method_props.propertyNames();
-                        while (names.hasMoreElements())
-                        {
-                                final String name = (String)names.nextElement();
-                                props.setProperty(name, method_props.getProperty(name));
-                        }
+                    final Enumeration<?> names = method_props.propertyNames();
+                    while (names.hasMoreElements())
+                    {
+                        final String name = (String)names.nextElement();
+                        props.setProperty(name, method_props.getProperty(name));
+                    }
                 }
         }
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.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
@@ -22,9 +22,6 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
 
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-
 import com.sun.org.apache.xalan.internal.xsltc.DOM;
 import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
@@ -32,7 +29,8 @@
 import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
 import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
 import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
 import org.xml.sax.SAXException;
 
 /**
@@ -42,7 +40,7 @@
 
     private String     _systemId = null;
     private Source     _source   = null;
-    private ThreadLocal _dom     = new ThreadLocal();
+    private ThreadLocal<SAXImpl> _dom     = new ThreadLocal<>();
 
     /**
      * Create a new XSLTC-specific source from a system ID
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/AttributeMap.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/AttributeMap.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
@@ -23,7 +23,6 @@
 
 import java.util.ArrayList;
 import java.util.List;
-
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Node;
 
@@ -118,7 +117,7 @@
         } else {
             i = -1 - i; // Insert point (may be end of list)
             if (null == nodes) {
-                nodes = new ArrayList(5);
+                nodes = new ArrayList<>(5);
             }
             nodes.add(i, arg);
         }
@@ -194,7 +193,7 @@
             } else {
                 i = -1 - i; // Insert point (may be end of list)
                 if (null == nodes) {
-                    nodes = new ArrayList(5);
+                    nodes = new ArrayList<>(5);
                 }
                 nodes.add(i, arg);
             }
@@ -488,12 +487,12 @@
      * Override parent's method to set the ownerNode correctly
      */
     protected void cloneContent(NamedNodeMapImpl srcmap) {
-        List srcnodes = srcmap.nodes;
+        List<Node> srcnodes = srcmap.nodes;
         if (srcnodes != null) {
             int size = srcnodes.size();
             if (size != 0) {
                 if (nodes == null) {
-                    nodes = new ArrayList(size);
+                    nodes = new ArrayList<>(size);
                 }
                 else {
                     nodes.clear();
@@ -592,7 +591,7 @@
             else {
                 i = -1 - i; // Insert point (may be end of list)
                 if (null == nodes) {
-                    nodes = new ArrayList(5);
+                    nodes = new ArrayList<>(5);
                 }
                 nodes.add(i, arg);
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -51,6 +51,7 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Locale;
 import javax.xml.XMLConstants;
 import javax.xml.catalog.CatalogFeatures;
@@ -195,7 +196,7 @@
     protected SymbolTable fSymbolTable;
 
     /** Components. */
-    protected ArrayList<XMLComponent> fComponents;
+    protected List<XMLComponent> fComponents;
 
     protected ValidationManager fValidationManager;
 
@@ -244,8 +245,8 @@
 
 
         // create table for features and properties
-        fFeatures = new HashMap();
-        fProperties = new HashMap();
+        fFeatures = new HashMap<>();
+        fProperties = new HashMap<>();
 
         // add default recognized features
         final String[] recognizedFeatures = {
@@ -990,7 +991,7 @@
      */
     public DOMStringList getParameterNames() {
         if (fRecognizedParameters == null){
-            ArrayList parameters = new ArrayList();
+            List<String> parameters = new ArrayList<>();
 
             //Add DOM recognized parameters
             //REVISIT: Would have been nice to have a list of
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.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,9 +21,10 @@
 
 package com.sun.org.apache.xerces.internal.dom;
 
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
+import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.DOMImplementationList;
-import org.w3c.dom.DOMImplementation;
 
 /**
  * <p>This class implements the DOM Level 3 Core interface DOMImplementationList.</p>
@@ -36,19 +37,19 @@
 public class DOMImplementationListImpl implements DOMImplementationList {
 
     //A collection of DOMImplementations
-    private Vector fImplementations;
+    private List<DOMImplementation> fImplementations;
 
     /**
      * Construct an empty list of DOMImplementations
      */
     public DOMImplementationListImpl() {
-        fImplementations = new Vector();
+        fImplementations = new ArrayList<>();
     }
 
     /**
      * Construct an empty list of DOMImplementations
      */
-    public DOMImplementationListImpl(Vector params) {
+    public DOMImplementationListImpl(List<DOMImplementation> params) {
         fImplementations = params;
     }
 
@@ -59,8 +60,8 @@
      */
     public DOMImplementation item(int index) {
         try {
-            return (DOMImplementation) fImplementations.elementAt(index);
-        } catch (ArrayIndexOutOfBoundsException e) {
+            return fImplementations.get(index);
+        } catch (IndexOutOfBoundsException e) {
             return null;
         }
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.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,12 +21,12 @@
 
 package com.sun.org.apache.xerces.internal.dom;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.StringTokenizer;
-import java.util.Vector;
+import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.DOMImplementationList;
 import org.w3c.dom.DOMImplementationSource;
-import org.w3c.dom.DOMImplementation;
-import com.sun.org.apache.xerces.internal.dom.DOMImplementationListImpl;
 
 /**
  * Supply one the right implementation, based upon requested features. Each
@@ -34,7 +34,9 @@
  * binding-specific list of available sources so that its
  * <code>DOMImplementation</code> objects are made available.
  *
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMImplementationSource'>Document Object Model (DOM) Level 3 Core Specification</a>.
+ * <p>See also the
+ * <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMImplementationSource'>
+ * Document Object Model (DOM) Level 3 Core Specification</a>.
  *
  * @xerces.internal
  *
@@ -81,13 +83,13 @@
     public DOMImplementationList getDOMImplementationList(String features) {
         // first check whether the CoreDOMImplementation would do
         DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
-                final Vector implementations = new Vector();
+        final List<DOMImplementation> implementations = new ArrayList<>();
         if (testImpl(impl, features)) {
-                        implementations.addElement(impl);
+            implementations.add(impl);
         }
         impl = DOMImplementationImpl.getDOMImplementation();
         if (testImpl(impl, features)) {
-                        implementations.addElement(impl);
+            implementations.add(impl);
         }
 
         return new DOMImplementationListImpl(implementations);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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,10 +22,6 @@
 package com.sun.org.apache.xerces.internal.dom;
 
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.io.StringReader;
-import java.util.Vector;
 
 import com.sun.org.apache.xerces.internal.dom.AbortException;
 import com.sun.org.apache.xerces.internal.impl.Constants;
@@ -59,6 +56,11 @@
 import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
 import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Comment;
 import org.w3c.dom.DOMError;
@@ -146,7 +148,7 @@
     protected final NamespaceContext fLocalNSBinder = new NamespaceSupport();
 
     /** list of attributes */
-    protected final ArrayList fAttributeList = new ArrayList(5);
+    protected final List<Node> fAttributeList = new ArrayList<>(5);
 
     /** DOM Locator -  for namespace fixup algorithm */
     protected final DOMLocatorImpl fLocator = new DOMLocatorImpl();
@@ -1445,7 +1447,7 @@
         protected CoreDocumentImpl fDocument;
         protected ElementImpl fElement;
 
-        protected final Vector fAugmentations = new Vector(5);
+        protected final Vector<Augmentations> fAugmentations = new Vector<>(5);
 
 
         public void setAttributes(AttributeMap attributes, CoreDocumentImpl doc, ElementImpl elem) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.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
@@ -22,8 +22,7 @@
 package com.sun.org.apache.xerces.internal.dom;
 
 import java.util.ArrayList;
-import java.util.Vector;
-
+import java.util.List;
 import org.w3c.dom.DOMStringList;
 
 /**
@@ -38,30 +37,23 @@
 public class DOMStringListImpl implements DOMStringList {
 
     // A collection of DOMString values
-    private final ArrayList fStrings;
+    private final List<String> fStrings;
 
     /**
      * Construct an empty list of DOMStringListImpl
      */
     public DOMStringListImpl() {
-        fStrings = new ArrayList();
+        fStrings = new ArrayList<>();
     }
 
     /**
      * Construct a DOMStringListImpl from an ArrayList
      */
-    public DOMStringListImpl(ArrayList params) {
+    public DOMStringListImpl(List<String> params) {
         fStrings = params;
     }
 
     /**
-     * Construct a DOMStringListImpl from a Vector
-     */
-    public DOMStringListImpl(Vector params) {
-        fStrings = new ArrayList(params);
-    }
-
-    /**
      * @see org.w3c.dom.DOMStringList#item(int)
      */
     public String item(int index) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.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
@@ -22,14 +22,17 @@
 package com.sun.org.apache.xerces.internal.dom;
 
 import com.sun.org.apache.xerces.internal.impl.xs.XSImplementationImpl;
-import org.w3c.dom.DOMImplementationList;
+import java.util.ArrayList;
+import java.util.List;
 import org.w3c.dom.DOMImplementation;
-import java.util.Vector;
+import org.w3c.dom.DOMImplementationList;
 
 /**
  * Allows to retrieve <code>XSImplementation</code>, DOM Level 3 Core and LS implementations
  * and PSVI implementation.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMImplementationSource'>Document Object Model (DOM) Level 3 Core Specification</a>.
+ * <p>See also the
+ * <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMImplementationSource'>
+ * Document Object Model (DOM) Level 3 Core Specification</a>.
  *
  * @xerces.internal
  *
@@ -78,23 +81,23 @@
      *   features.
      */
     public DOMImplementationList getDOMImplementationList(String features) {
-        final Vector implementations = new Vector();
+        final List<DOMImplementation> implementations = new ArrayList<>();
 
         // first check whether the CoreDOMImplementation would do
         DOMImplementationList list = super.getDOMImplementationList(features);
         //Add core DOMImplementations
         for (int i=0; i < list.getLength(); i++ ) {
-            implementations.addElement(list.item(i));
+            implementations.add(list.item(i));
         }
 
         DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
         if (testImpl(impl, features)) {
-            implementations.addElement(impl);
+            implementations.add(impl);
         }
 
         impl = XSImplementationImpl.getDOMImplementation();
         if (testImpl(impl, features)) {
-            implementations.addElement(impl);
+            implementations.add(impl);
         }
         return new DOMImplementationListImpl(implementations);
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.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
@@ -18,14 +18,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package com.sun.org.apache.xerces.internal.dom;
 
+import java.util.ArrayList;
+import java.util.List;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import java.util.Vector;
-
 /**
  * This class implements the DOM's NodeList behavior for
  * Element.getElementsByTagName()
@@ -75,16 +74,15 @@
  * @since  PR-DOM-Level-1-19980818.
  */
 public class DeepNodeListImpl
-    implements NodeList {
+        implements NodeList {
 
     //
     // Data
     //
-
     protected NodeImpl rootNode; // Where the search started
     protected String tagName;   // Or "*" to mean all-tags-acceptable
-    protected int changes=0;
-    protected Vector nodes;
+    protected int changes = 0;
+    protected List<Node> nodes;
 
     protected String nsName;
     protected boolean enableNS = false;
@@ -96,15 +94,15 @@
     /** Constructor. */
     public DeepNodeListImpl(NodeImpl rootNode, String tagName) {
         this.rootNode = rootNode;
-        this.tagName  = tagName;
-        nodes = new Vector();
+        this.tagName = tagName;
+        nodes = new ArrayList<>();
     }
 
     /** Constructor for Namespace support. */
     public DeepNodeListImpl(NodeImpl rootNode,
-                            String nsName, String tagName) {
+            String nsName, String tagName) {
         this(rootNode, tagName);
-        this.nsName = (nsName != null && !nsName.equals("")) ? nsName : null;
+        this.nsName = (nsName != null && nsName.length() != 0) ? nsName : null;
         enableNS = true;
     }
 
@@ -124,34 +122,36 @@
         Node thisNode;
 
         // Tree changed. Do it all from scratch!
-        if(rootNode.changes() != changes) {
-            nodes   = new Vector();
+        if (rootNode.changes() != changes) {
+            nodes = new ArrayList<>();
             changes = rootNode.changes();
         }
 
         // In the cache
-        if (index < nodes.size())
-            return (Node)nodes.elementAt(index);
-
-        // Not yet seen
+        final int currentSize = nodes.size();
+        if (index < currentSize) {
+            return nodes.get(index);
+        } // Not yet seen
         else {
 
             // Pick up where we left off (Which may be the beginning)
-                if (nodes.size() == 0)
-                    thisNode = rootNode;
-                else
-                    thisNode=(NodeImpl)(nodes.lastElement());
+            if (currentSize == 0) {
+                thisNode = rootNode;
+            } else {
+                thisNode = (NodeImpl) (nodes.get(currentSize - 1));
+            }
 
-                // Add nodes up to the one we're looking for
-                while(thisNode != null && index >= nodes.size()) {
-                        thisNode=nextMatchingElementAfter(thisNode);
-                        if (thisNode != null)
-                            nodes.addElement(thisNode);
-                    }
+            // Add nodes up to the one we're looking for
+            while (thisNode != null && index >= nodes.size()) {
+                thisNode = nextMatchingElementAfter(thisNode);
+                if (thisNode != null) {
+                    nodes.add(thisNode);
+                }
+            }
 
             // Either what we want, or null (not avail.)
-                    return thisNode;
-            }
+            return thisNode;
+        }
 
     } // item(int):Node
 
@@ -166,82 +166,76 @@
      */
     protected Node nextMatchingElementAfter(Node current) {
 
-            Node next;
-            while (current != null) {
-                    // Look down to first child.
-                    if (current.hasChildNodes()) {
-                            current = (current.getFirstChild());
-                    }
-
-                    // Look right to sibling (but not from root!)
-                    else if (current != rootNode && null != (next = current.getNextSibling())) {
-                                current = next;
-                        }
+        Node next;
+        while (current != null) {
+            // Look down to first child.
+            if (current.hasChildNodes()) {
+                current = (current.getFirstChild());
+            } // Look right to sibling (but not from root!)
+            else if (current != rootNode && null != (next = current.getNextSibling())) {
+                current = next;
+            } // Look up and right (but not past root!)
+            else {
+                next = null;
+                for (; current != rootNode; // Stop when we return to starting point
+                        current = current.getParentNode()) {
 
-                        // Look up and right (but not past root!)
-                        else {
-                                next = null;
-                                for (; current != rootNode; // Stop when we return to starting point
-                                        current = current.getParentNode()) {
-
-                                        next = current.getNextSibling();
-                                        if (next != null)
-                                                break;
-                                }
-                                current = next;
-                        }
+                    next = current.getNextSibling();
+                    if (next != null) {
+                        break;
+                    }
+                }
+                current = next;
+            }
 
                         // Have we found an Element with the right tagName?
-                        // ("*" matches anything.)
-                    if (current != rootNode
-                        && current != null
-                        && current.getNodeType() ==  Node.ELEMENT_NODE) {
-                        if (!enableNS) {
-                            if (tagName.equals("*") ||
-                                ((ElementImpl) current).getTagName().equals(tagName))
-                            {
+            // ("*" matches anything.)
+            if (current != rootNode
+                    && current != null
+                    && current.getNodeType() == Node.ELEMENT_NODE) {
+                if (!enableNS) {
+                    if (tagName.equals("*")
+                            || ((ElementImpl) current).getTagName().equals(tagName)) {
+                        return current;
+                    }
+                } else {
+                    // DOM2: Namespace logic.
+                    if (tagName.equals("*")) {
+                        if (nsName != null && nsName.equals("*")) {
+                            return current;
+                        } else {
+                            ElementImpl el = (ElementImpl) current;
+                            if ((nsName == null
+                                    && el.getNamespaceURI() == null)
+                                    || (nsName != null
+                                    && nsName.equals(el.getNamespaceURI()))) {
                                 return current;
                             }
-                        } else {
-                            // DOM2: Namespace logic.
-                            if (tagName.equals("*")) {
-                                if (nsName != null && nsName.equals("*")) {
-                                    return current;
-                                } else {
-                                    ElementImpl el = (ElementImpl) current;
-                                    if ((nsName == null
-                                         && el.getNamespaceURI() == null)
+                        }
+                    } else {
+                        ElementImpl el = (ElementImpl) current;
+                        if (el.getLocalName() != null
+                                && el.getLocalName().equals(tagName)) {
+                            if (nsName != null && nsName.equals("*")) {
+                                return current;
+                            } else {
+                                if ((nsName == null
+                                        && el.getNamespaceURI() == null)
                                         || (nsName != null
-                                            && nsName.equals(el.getNamespaceURI())))
-                                    {
-                                        return current;
-                                    }
-                                }
-                            } else {
-                                ElementImpl el = (ElementImpl) current;
-                                if (el.getLocalName() != null
-                                    && el.getLocalName().equals(tagName)) {
-                                    if (nsName != null && nsName.equals("*")) {
-                                        return current;
-                                    } else {
-                                        if ((nsName == null
-                                             && el.getNamespaceURI() == null)
-                                            || (nsName != null &&
-                                                nsName.equals(el.getNamespaceURI())))
-                                        {
-                                            return current;
-                                        }
-                                    }
+                                        && nsName.equals(el.getNamespaceURI()))) {
+                                    return current;
                                 }
                             }
                         }
                     }
-
-                // Otherwise continue walking the tree
+                }
             }
 
-            // Fell out of tree-walk; no more instances found
-            return null;
+            // Otherwise continue walking the tree
+        }
+
+        // Fell out of tree-walk; no more instances found
+        return null;
 
     } // nextMatchingElementAfter(int):Node
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,6 +23,7 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -132,7 +134,7 @@
     // private data
     //
     private transient final StringBuilder fBufferStr = new StringBuilder();
-    private transient final ArrayList fStrChunks = new ArrayList();
+    private transient final List<String> fStrChunks = new ArrayList<>();
 
     //
     // Constructors
@@ -1144,7 +1146,7 @@
 
                 // add to the buffer in the correct order.
                 for (int i = chunkCount - 1; i >= 0; i--) {
-                    fBufferStr.append((String)fStrChunks.get(i));
+                    fBufferStr.append(fStrChunks.get(i));
                 }
 
                 value = fBufferStr.toString();
@@ -1170,7 +1172,7 @@
                 }
                 // add to the buffer in the correct order.
                 for (int i=fStrChunks.size()-1; i>=0; i--) {
-                     fBufferStr.append((String)fStrChunks.get(i));
+                     fBufferStr.append(fStrChunks.get(i));
                 }
 
                 value = fBufferStr.toString();
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -477,7 +478,7 @@
     /**
      * Retreive event listener registered on a given node
      */
-    protected List getEventListeners(NodeImpl n) {
+    protected List<LEntry> getEventListeners(NodeImpl n) {
         if (eventListeners == null) {
             return null;
         }
@@ -679,6 +680,7 @@
      *              method was invoked by an EventListener; otherwise false.
     */
     @Override
+    @SuppressWarnings({"rawtypes", "unchecked"})
     protected boolean dispatchEvent(NodeImpl node, Event event) {
         if (event == null) return false;
 
@@ -736,9 +738,9 @@
                 // Handle all capturing listeners on this node
                 NodeImpl nn = (NodeImpl) pv.get(j);
                 evt.currentTarget = nn;
-                List<LEntry> nodeListeners = getEventListeners(nn);
+                ArrayList<LEntry> nodeListeners = (ArrayList<LEntry>)getEventListeners(nn);
                 if (nodeListeners != null) {
-                    List<LEntry> nl = (List)((ArrayList)nodeListeners).clone();
+                    List<LEntry> nl = (ArrayList<LEntry>)nodeListeners.clone();
                     // call listeners in the order in which they got registered
                     int nlsize = nl.size();
                     for (int i = 0; i < nlsize; i++) {
@@ -765,9 +767,9 @@
             // node are _not_ invoked, even during the capture phase.
             evt.eventPhase = Event.AT_TARGET;
             evt.currentTarget = node;
-            List<LEntry> nodeListeners = getEventListeners(node);
+            ArrayList<LEntry> nodeListeners = (ArrayList<LEntry>)getEventListeners(node);
             if (!evt.stopPropagation && nodeListeners != null) {
-                List<LEntry> nl = (List)((ArrayList)nodeListeners).clone();
+                List<LEntry> nl = (ArrayList<LEntry>)nodeListeners.clone();
                 // call listeners in the order in which they got registered
                 int nlsize = nl.size();
                 for (int i = 0; i < nlsize; i++) {
@@ -798,9 +800,9 @@
                     // Handle all bubbling listeners on this node
                     NodeImpl nn = (NodeImpl) pv.get(j);
                     evt.currentTarget = nn;
-                    nodeListeners = getEventListeners(nn);
+                    nodeListeners = (ArrayList<LEntry>)getEventListeners(nn);
                     if (nodeListeners != null) {
-                        List<LEntry> nl = (List)((ArrayList)nodeListeners).clone();
+                        List<LEntry> nl = (ArrayList<LEntry>)nodeListeners.clone();
                         // call listeners in the order in which they got
                         // registered
                         int nlsize = nl.size();
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.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
@@ -28,7 +28,6 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Vector;
-
 import org.w3c.dom.DOMException;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
@@ -80,7 +79,7 @@
     protected final static short HASDEFAULTS  = 0x1<<2;
 
     /** Nodes. */
-    protected List nodes;
+    protected List<Node> nodes;
 
     protected NodeImpl ownerNode; // the node this map belongs to
 
@@ -122,8 +121,7 @@
      * is greater than or equal to getLength().
      */
     public Node item(int index) {
-        return (nodes != null && index < nodes.size()) ?
-                    (Node)(nodes.get(index)) : null;
+        return (nodes != null && index < nodes.size()) ? (nodes.get(index)) : null;
     }
 
     /**
@@ -136,7 +134,7 @@
     public Node getNamedItem(String name) {
 
         int i = findNamePoint(name,0);
-        return (i < 0) ? null : (Node)(nodes.get(i));
+        return (i < 0) ? null : (nodes.get(i));
 
     } // getNamedItem(String):Node
 
@@ -154,7 +152,7 @@
     public Node getNamedItemNS(String namespaceURI, String localName) {
 
         int i = findNamePoint(namespaceURI, localName);
-        return (i < 0) ? null : (Node)(nodes.get(i));
+        return (i < 0) ? null : (nodes.get(i));
 
     } // getNamedItemNS(String,String):Node
 
@@ -198,7 +196,7 @@
         } else {
             i = -1 - i; // Insert point (may be end of list)
             if (null == nodes) {
-                nodes = new ArrayList(5);
+                nodes = new ArrayList<>(5);
             }
             nodes.add(i, arg);
         }
@@ -248,7 +246,7 @@
             } else {
                 i = -1 - i; // Insert point (may be end of list)
                 if (null == nodes) {
-                    nodes = new ArrayList(5);
+                    nodes = new ArrayList<>(5);
                 }
                 nodes.add(i, arg);
             }
@@ -337,12 +335,12 @@
     }
 
     protected void cloneContent(NamedNodeMapImpl srcmap) {
-        List srcnodes = srcmap.nodes;
+        List<Node> srcnodes = srcmap.nodes;
         if (srcnodes != null) {
             int size = srcnodes.size();
             if (size != 0) {
                 if (nodes == null) {
-                    nodes = new ArrayList(size);
+                    nodes = new ArrayList<>(size);
                 }
                 else {
                     nodes.clear();
@@ -457,7 +455,7 @@
 
             while (first <= last) {
                 i = (first + last) / 2;
-                int test = name.compareTo(((Node)(nodes.get(i))).getNodeName());
+                int test = name.compareTo(((nodes.get(i))).getNodeName());
                 if (test == 0) {
                     return i; // Name found
                 }
@@ -522,7 +520,7 @@
         if (nodes != null) {
             final int size = nodes.size();
             for (int i = 0; i < size; ++i) {
-                Node n = (Node)nodes.get(i);
+                Node n = nodes.get(i);
                 if (n==a) return true;
                 if (n==b) return false;
             }
@@ -563,7 +561,7 @@
             else {
                 i = -1 - i; // Insert point (may be end of list)
                 if (null == nodes) {
-                    nodes = new ArrayList(5);
+                    nodes = new ArrayList<>(5);
                 }
                 nodes.add(i, arg);
             }
@@ -577,16 +575,9 @@
      * @param list   ArrayList to copy information into.
      * @return A copy of this node named map
      */
-    protected ArrayList cloneMap(ArrayList list) {
-        if (list == null) {
-            list = new ArrayList(5);
-        }
-        list.clear();
+    protected List<Node> cloneMap(List<Node> list) {
         if (nodes != null) {
-            final int size = nodes.size();
-            for (int i = 0; i < size; ++i) {
-                list.add(nodes.get(i));
-            }
+            list = new ArrayList<>(nodes);
         }
         return list;
     }
@@ -608,15 +599,17 @@
         throws IOException, ClassNotFoundException {
         in.defaultReadObject();
         if (nodes != null) {
-            nodes = new ArrayList(nodes);
+            // nodes are written as a Vector for compatibility.
+            nodes = new ArrayList<>(nodes);
         }
     }
 
     private void writeObject(ObjectOutputStream out) throws IOException {
-        List oldNodes = this.nodes;
+        List<Node> oldNodes = this.nodes;
         try {
             if (oldNodes != null) {
-                this.nodes = new Vector(oldNodes);
+                // convert to Vector for backward-compatibility
+                this.nodes = new Vector<>(oldNodes);
             }
             out.defaultWriteObject();
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/RangeImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/RangeImpl.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,8 +21,8 @@
 
 package com.sun.org.apache.xerces.internal.dom;
 
-import java.util.Vector;
-
+import java.util.ArrayList;
+import java.util.List;
 import org.w3c.dom.CharacterData;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.DocumentFragment;
@@ -127,32 +127,32 @@
                 DOMException.INVALID_STATE_ERR,
                 DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
         }
-        Vector startV = new Vector();
+        List<Node> startV = new ArrayList<>();
         Node node;
         for (node=fStartContainer; node != null;
              node=node.getParentNode())
         {
-            startV.addElement(node);
+            startV.add(node);
         }
-        Vector endV = new Vector();
+        List<Node> endV = new ArrayList<>();
         for (node=fEndContainer; node != null;
              node=node.getParentNode())
         {
-            endV.addElement(node);
+            endV.add(node);
         }
         int s = startV.size()-1;
         int e = endV.size()-1;
-        Object result = null;
+        Node result = null;
         while (s>=0 && e>=0) {
-            if (startV.elementAt(s) == endV.elementAt(e)) {
-                result = startV.elementAt(s);
+            if (startV.get(s) == endV.get(e)) {
+                result = startV.get(s);
             } else {
                 break;
             }
             --s;
             --e;
         }
-        return (Node)result;
+        return result;
     }
 
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/Constants.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/Constants.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,7 +23,6 @@
 
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
-import jdk.xml.internal.SecuritySupport;
 
 /**
  * Commonly used constants.
@@ -826,7 +825,7 @@
     };
 
     /** Empty enumeration. */
-    private static final Enumeration fgEmptyEnumeration = new ArrayEnumeration(new Object[] {});
+    private static final Enumeration<Object> fgEmptyEnumeration = new ArrayEnumeration(new Object[] {});
 
     //
     // Constructors
@@ -842,13 +841,13 @@
     // sax
 
     /** Returns an enumeration of the SAX features. */
-    public static Enumeration getSAXFeatures() {
+    public static Enumeration<Object> getSAXFeatures() {
         return fgSAXFeatures.length > 0
         ? new ArrayEnumeration(fgSAXFeatures) : fgEmptyEnumeration;
     } // getSAXFeatures():Enumeration
 
     /** Returns an enumeration of the SAX properties. */
-    public static Enumeration getSAXProperties() {
+    public static Enumeration<Object> getSAXProperties() {
         return fgSAXProperties.length > 0
         ? new ArrayEnumeration(fgSAXProperties) : fgEmptyEnumeration;
     } // getSAXProperties():Enumeration
@@ -856,13 +855,13 @@
     // xerces
 
     /** Returns an enumeration of the Xerces features. */
-    public static Enumeration getXercesFeatures() {
+    public static Enumeration<Object> getXercesFeatures() {
         return fgXercesFeatures.length > 0
         ? new ArrayEnumeration(fgXercesFeatures) : fgEmptyEnumeration;
     } // getXercesFeatures():Enumeration
 
     /** Returns an enumeration of the Xerces properties. */
-    public static Enumeration getXercesProperties() {
+    public static Enumeration<Object> getXercesProperties() {
         return fgXercesProperties.length > 0
         ? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration;
     } // getXercesProperties():Enumeration
@@ -877,7 +876,7 @@
      * @author Andy Clark, IBM
      */
     static class ArrayEnumeration
-    implements Enumeration {
+    implements Enumeration<Object> {
 
         //
         // Data
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -512,7 +512,7 @@
                 }
                 for (int i = size - 1; i >= 0 ; i--) {
                     Entity.ScannedEntity externalEntity =
-                            (Entity.ScannedEntity)fEntityStack.elementAt(i);
+                            (Entity.ScannedEntity)fEntityStack.get(i);
                     if (externalEntity.entityLocation != null && externalEntity.entityLocation.getExpandedSystemId() != null) {
                         baseSystemId = externalEntity.entityLocation.getExpandedSystemId();
                         break;
@@ -1267,11 +1267,11 @@
         for (int i = size; i >= 0; i--) {
             Entity activeEntity = i == size
                     ? fCurrentEntity
-                    : fEntityStack.elementAt(i);
+                    : fEntityStack.get(i);
             if (activeEntity.name == entityName) {
                 String path = entityName;
                 for (int j = i + 1; j < size; j++) {
-                    activeEntity = fEntityStack.elementAt(j);
+                    activeEntity = fEntityStack.get(j);
                     path = path + " -> " + activeEntity.name;
                 }
                 path = path + " -> " + fCurrentEntity.name;
@@ -1441,7 +1441,7 @@
      */
     public Entity.ScannedEntity getTopLevelEntity() {
         return (Entity.ScannedEntity)
-            (fEntityStack.empty() ? null : fEntityStack.elementAt(0));
+            (fEntityStack.empty() ? null : fEntityStack.get(0));
     }
 
 
@@ -2645,7 +2645,7 @@
                 int size = fEntityStack.size();
                 for (int i = size - 1; i >= 0 ; i--) {
                     Entity.ScannedEntity externalEntity =
-                            (Entity.ScannedEntity)fEntityStack.elementAt(i);
+                            (Entity.ScannedEntity)fEntityStack.get(i);
 
                     if (externalEntity.entityLocation != null &&
                             externalEntity.entityLocation.getExpandedSystemId() != null) {
@@ -2677,7 +2677,7 @@
                 int size = fEntityStack.size();
                 for (int i = size - 1; i >= 0 ; i--) {
                     Entity.ScannedEntity externalEntity =
-                            (Entity.ScannedEntity)fEntityStack.elementAt(i);
+                            (Entity.ScannedEntity)fEntityStack.get(i);
 
                     if (externalEntity.entityLocation != null &&
                             externalEntity.entityLocation.getLiteralSystemId() != null) {
@@ -2715,7 +2715,7 @@
                 // search for the first external entity on the stack
                 int size = fEntityStack.size();
                 for (int i=size-1; i>0 ; i--) {
-                    Entity.ScannedEntity firstExternalEntity = (Entity.ScannedEntity)fEntityStack.elementAt(i);
+                    Entity.ScannedEntity firstExternalEntity = (Entity.ScannedEntity)fEntityStack.get(i);
                     if (firstExternalEntity.isExternal()) {
                         return firstExternalEntity.lineNumber;
                     }
@@ -2757,7 +2757,7 @@
                 // search for the first external entity on the stack
                 int size = fEntityStack.size();
                 for (int i=size-1; i>0 ; i--) {
-                    Entity.ScannedEntity firstExternalEntity = (Entity.ScannedEntity)fEntityStack.elementAt(i);
+                    Entity.ScannedEntity firstExternalEntity = (Entity.ScannedEntity)fEntityStack.get(i);
                     if (firstExternalEntity.isExternal()) {
                         return firstExternalEntity.columnNumber;
                     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -46,6 +47,7 @@
 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Random;
 
@@ -798,7 +800,7 @@
             int chunk, index = 0;
             String currName = null;
             final int size = fElementDeclCount;
-            ArrayList elements = new ArrayList(size);
+            List<String> elements = new ArrayList<>(size);
             for (int i = 0; i < size; ++i) {
                 chunk = i >> CHUNK_SHIFT;
                 index = i & CHUNK_MASK;
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.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,13 +21,11 @@
 
 package com.sun.org.apache.xerces.internal.impl.dtd;
 
-import java.util.ArrayList;
-import java.util.Vector;
-
+import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
+import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
+import java.util.List;
 
 /**
  * All information specific to DTD grammars.
@@ -47,7 +45,7 @@
 
     // if we don't know the root name, this stores all elements that
     // could serve; fPossibleRoots and fRootName cannot both be non-null
-    protected ArrayList fPossibleRoots = null;
+    protected List<String> fPossibleRoots = null;
 
     // Constructors:
     public XMLDTDDescription(XMLResourceIdentifier id, String rootName) {
@@ -91,15 +89,10 @@
     }
 
     /** Set possible roots **/
-    public void setPossibleRoots(ArrayList possibleRoots) {
+    public void setPossibleRoots(List<String> possibleRoots) {
         fPossibleRoots = possibleRoots;
     }
 
-    /** Set possible roots **/
-    public void setPossibleRoots(Vector possibleRoots) {
-        fPossibleRoots = (possibleRoots != null) ? new ArrayList(possibleRoots) : null;
-    }
-
     /**
      * Compares this grammar with the given grammar. Currently, we compare
      * as follows:
@@ -139,9 +132,7 @@
             }
             else {
                 boolean found = false;
-                final int size = fPossibleRoots.size();
-                for (int i = 0; i < size; ++i) {
-                    String root = (String) fPossibleRoots.get(i);
+                for (String root : fPossibleRoots) {
                     found = dtdDesc.fPossibleRoots.contains(root);
                     if (found) break;
                 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.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,13 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.impl.dtd;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.StringTokenizer;
-
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
 import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
@@ -51,6 +44,12 @@
 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDFilter;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.StringTokenizer;
 
 /**
  * The DTD processor. The processor implements a DTD
@@ -239,28 +238,28 @@
     private final XMLEntityDecl fEntityDecl = new XMLEntityDecl();
 
     /** Notation declaration hash. */
-    private final HashMap fNDataDeclNotations = new HashMap();
+    private final Map<String, String> fNDataDeclNotations = new HashMap<>();
 
     /** DTD element declaration name. */
     private String fDTDElementDeclName = null;
 
     /** Mixed element type "hash". */
-    private final ArrayList fMixedElementTypes = new ArrayList();
+    private final List<String> fMixedElementTypes = new ArrayList<>();
 
     /** Element declarations in DTD. */
-    private final ArrayList fDTDElementDecls = new ArrayList();
+    private final List<String> fDTDElementDecls = new ArrayList<>();
 
     // to check for duplicate ID or ANNOTATION attribute declare in
     // ATTLIST, and misc VCs
 
     /** ID attribute names. */
-    private HashMap fTableOfIDAttributeNames;
+    private Map<String, String> fTableOfIDAttributeNames;
 
     /** NOTATION attribute names. */
-    private HashMap fTableOfNOTATIONAttributeNames;
+    private Map<String, String> fTableOfNOTATIONAttributeNames;
 
     /** NOTATION enumeration values. */
-    private HashMap fNotationEnumVals;
+    private Map<String, String> fNotationEnumVals;
 
     //
     // Constructors
@@ -351,12 +350,12 @@
         if (fValidation) {
 
             if (fNotationEnumVals == null) {
-                fNotationEnumVals = new HashMap();
+                fNotationEnumVals = new HashMap<>();
             }
             fNotationEnumVals.clear();
 
-            fTableOfIDAttributeNames = new HashMap();
-            fTableOfNOTATIONAttributeNames = new HashMap();
+            fTableOfIDAttributeNames = new HashMap<>();
+            fTableOfNOTATIONAttributeNames = new HashMap<>();
         }
 
     }
@@ -888,7 +887,7 @@
                         //basis of error or warning thrown. - nb.
 
                         if(!duplicateAttributeDef){
-                                String previousIDAttributeName = (String)fTableOfIDAttributeNames.get( elementName );//rule a)
+                                String previousIDAttributeName = fTableOfIDAttributeNames.get( elementName );//rule a)
                                 fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
                                                "MSG_MORE_THAN_ONE_ID_ATTRIBUTE",
                                                new Object[]{ elementName, previousIDAttributeName, attributeName},
@@ -912,16 +911,16 @@
                     fTableOfNOTATIONAttributeNames.put( elementName, attributeName);
                 }
                 else {
-                        //we should not report an error, when there is duplicate attribute definition for given element type
-                        //according to XML 1.0 spec, When more than one definition is provided for the same attribute of a given
-                        //element type, the first declaration is binding and later declaration are *ignored*. So processor should
-                        //ignore the second declarations, however an application would be warned of the duplicate attribute definition
-                        // if http://apache.org/xml/features/validation/warn-on-duplicate-attdef feature is set to true, Application behavior may differ on the basis of error or
-                        //warning thrown. - nb.
+                    //we should not report an error, when there is duplicate attribute definition for given element type
+                    //according to XML 1.0 spec, When more than one definition is provided for the same attribute of a given
+                    //element type, the first declaration is binding and later declaration are *ignored*. So processor should
+                    //ignore the second declarations, however an application would be warned of the duplicate attribute definition
+                    // if http://apache.org/xml/features/validation/warn-on-duplicate-attdef feature is set to true,
+                    // Application behavior may differ on the basis of error or warning thrown. - nb.
 
                         if(!duplicateAttributeDef){
 
-                                String previousNOTATIONAttributeName = (String) fTableOfNOTATIONAttributeNames.get( elementName );
+                                String previousNOTATIONAttributeName = fTableOfNOTATIONAttributeNames.get( elementName );
                                 fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
                                                "MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE",
                                                new Object[]{ elementName, previousNOTATIONAttributeName, attributeName},
@@ -1274,44 +1273,36 @@
         if (fValidation) {
             DTDGrammar grammar = (fDTDGrammar != null? fDTDGrammar: fGrammarBucket.getActiveGrammar());
 
-            // VC : Notation Declared. for external entity declaration [Production 76].
-            Iterator entities = fNDataDeclNotations.entrySet().iterator();
-            while (entities.hasNext()) {
-                Map.Entry entry = (Map.Entry) entities.next();
-                String notation = (String) entry.getValue();
+            // VC: Notation Declared. for external entity declaration [Production 76].
+            for (Map.Entry<String, String> entry : fNDataDeclNotations.entrySet()) {
+                String notation = entry.getValue();
                 if (grammar.getNotationDeclIndex(notation) == -1) {
-                    String entity = (String) entry.getKey();
+                    String entity = entry.getKey();
                     fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
-                                               "MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL",
-                                               new Object[]{entity, notation},
-                                               XMLErrorReporter.SEVERITY_ERROR);
+                            "MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL",
+                            new Object[]{entity, notation},
+                            XMLErrorReporter.SEVERITY_ERROR);
                 }
             }
 
-            // VC: Notation Attributes:
-            //     all notation names in the (attribute) declaration must be declared.
-            Iterator notationVals = fNotationEnumVals.entrySet().iterator();
-            while (notationVals.hasNext()) {
-                Map.Entry entry = (Map.Entry) notationVals.next();
-                String notation = (String) entry.getKey();
+            for (Map.Entry<String, String> entry : fNotationEnumVals.entrySet()) {
+                String notation = entry.getKey();
                 if (grammar.getNotationDeclIndex(notation) == -1) {
-                    String attributeName = (String) entry.getValue();
+                    String attributeName = entry.getValue();
                     fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
-                                               "MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE",
-                                               new Object[]{attributeName, notation},
-                                               XMLErrorReporter.SEVERITY_ERROR);
+                            "MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE",
+                            new Object[]{attributeName, notation},
+                            XMLErrorReporter.SEVERITY_ERROR);
                 }
             }
 
             // VC: No Notation on Empty Element
             // An attribute of type NOTATION must not be declared on an element declared EMPTY.
-            Iterator elementsWithNotations = fTableOfNOTATIONAttributeNames.entrySet().iterator();
-            while (elementsWithNotations.hasNext()) {
-                Map.Entry entry = (Map.Entry) elementsWithNotations.next();
-                String elementName = (String) entry.getKey();
+            for (Map.Entry<String, String> entry : fTableOfNOTATIONAttributeNames.entrySet()) {
+                String elementName = entry.getKey();
                 int elementIndex = grammar.getElementDeclIndex(elementName);
                 if (grammar.getContentSpecType(elementIndex) == XMLElementDecl.TYPE_EMPTY) {
-                    String attributeName = (String) entry.getValue();
+                    String attributeName = entry.getValue();
                     fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
                                                "NoNotationOnEmptyElement",
                                                new Object[]{elementName, attributeName},
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.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
@@ -2022,7 +2022,7 @@
             //   IDREF and IDREFS attr (V_IDREF0)
             //
             if (fPerformValidation) {
-                Iterator invIdRefs = fValidationState.checkIDRefID();
+                Iterator<String> invIdRefs = fValidationState.checkIDRefID();
                 if (invIdRefs != null) {
                     while (invIdRefs.hasNext()) {
                         fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -20,10 +21,10 @@
 
 package com.sun.org.apache.xerces.internal.impl.dtd.models;
 
-import java.util.HashMap;
-
 import com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec;
 import com.sun.org.apache.xerces.internal.xni.QName;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
 
@@ -594,7 +595,7 @@
              * a large content model such as, "(t001+|t002+|.... |t500+)".
              */
 
-        HashMap stateTable = new HashMap();
+        Map<CMStateSet, Integer> stateTable = new HashMap<>();
 
             /* Optimization(Jan, 2001) */
 
@@ -667,7 +668,7 @@
                     //
 
             /* Optimization(Jan, 2001) */
-            Integer stateObj = (Integer)stateTable.get(newSet);
+            Integer stateObj = stateTable.get(newSet);
             int stateIndex = (stateObj == null ? curState : stateObj.intValue());
             /* Optimization(Jan, 2001) */
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.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,11 +21,11 @@
 
 package com.sun.org.apache.xerces.internal.impl.dv;
 
-import java.util.Vector;
-
+import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
+import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
+import java.util.List;
 
 /**
  * The class used to pass all facets to {@link XSSimpleType#applyFacets}.
@@ -74,16 +74,16 @@
     public String pattern;
 
     /**
-     * Vector containing values of Enumeration facet, as String's.
+     * ArrayList containing values of Enumeration facet, as String's.
      */
-    public Vector enumeration;
+    public List<String> enumeration;
 
     /**
      * An array parallel to "Vector enumeration". It contains namespace context
      * of each enumeration value. Elements of this vector are NamespaceContext
      * objects.
      */
-    public Vector enumNSDecls;
+    public List<NamespaceContext> enumNSDecls;
 
     /**
      * value of maxInclusive facet.
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -20,10 +21,9 @@
 
 package com.sun.org.apache.xerces.internal.impl.dv.util;
 
-import java.util.AbstractList;
-
 import com.sun.org.apache.xerces.internal.xs.XSException;
 import com.sun.org.apache.xerces.internal.xs.datatypes.ByteList;
+import java.util.AbstractList;
 
 /**
  * Implementation of <code>com.sun.org.apache.xerces.internal.xs.datatypes.ByteList</code>.
@@ -33,7 +33,7 @@
  * @author Ankit Pasricha, IBM
  *
  */
-public class ByteListImpl extends AbstractList implements ByteList {
+public class ByteListImpl extends AbstractList<Byte> implements ByteList {
 
     // actually data stored in a byte array
     protected final byte[] data;
@@ -93,7 +93,7 @@
      * List methods
      */
 
-    public Object get(int index) {
+    public Byte get(int index) {
         if (index >= 0 && index < data.length) {
             return data[index];
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.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,11 +21,10 @@
 
 package com.sun.org.apache.xerces.internal.impl.dv.xs;
 
-import java.util.AbstractList;
-
 import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
 import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
 import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
+import java.util.AbstractList;
 
 /**
  * Represent the schema list types
@@ -39,12 +38,15 @@
 public class ListDV extends TypeValidator{
 
     public short getAllowedFacets(){
-          return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
+          return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH |
+                  XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN |
+                  XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
     }
 
     // this method should never be called: XSSimpleTypeDecl is responsible for
     // calling the item type for the convertion
-    public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
+    public Object getActualValue(String content, ValidationContext context)
+            throws InvalidDatatypeValueException{
         return content;
     }
 
@@ -53,7 +55,7 @@
         return ((ListData)value).getLength();
     }
 
-    final static class ListData extends AbstractList implements ObjectList {
+    final static class ListData extends AbstractList<Object> implements ObjectList {
         final Object[] data;
         private String canonical;
         public ListData(Object[] data) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.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
@@ -52,9 +52,10 @@
 import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
 import java.math.BigInteger;
 import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Locale;
 import java.util.StringTokenizer;
-import java.util.Vector;
 import org.w3c.dom.TypeInfo;
 
 /**
@@ -268,8 +269,8 @@
     private int fMaxLength = -1;
     private int fTotalDigits = -1;
     private int fFractionDigits = -1;
-    private Vector fPattern;
-    private Vector fPatternStr;
+    private List<RegularExpression> fPattern;
+    private List<String> fPatternStr;
     private ValidatedInfo[] fEnumeration;
     private int fEnumerationSize;
     private ShortList fEnumerationTypeList;
@@ -845,10 +846,10 @@
                     reportError("InvalidRegex", new Object[]{facets.pattern, e.getLocalizedMessage()});
                 }
                 if (regex != null) {
-                    fPattern = new Vector();
-                    fPattern.addElement(regex);
-                    fPatternStr = new Vector();
-                    fPatternStr.addElement(facets.pattern);
+                    fPattern = new ArrayList<>();
+                    fPattern.add(regex);
+                    fPatternStr = new ArrayList<>();
+                    fPatternStr.add(facets.pattern);
                     fFacetsDefined |= FACET_PATTERN;
                     if ((fixedFacet & FACET_PATTERN) != 0)
                         fFixedFacet |= FACET_PATTERN;
@@ -873,22 +874,22 @@
             if ((allowedFacet & FACET_ENUMERATION) == 0) {
                 reportError("cos-applicable-facets", new Object[]{"enumeration", fTypeName});
             } else {
-                Vector enumVals = facets.enumeration;
+                List<String> enumVals = facets.enumeration;
                 int size = enumVals.size();
                 fEnumeration = new ValidatedInfo[size];
-                Vector enumNSDecls = facets.enumNSDecls;
+                List<NamespaceContext> enumNSDecls = facets.enumNSDecls;
                 ValidationContextImpl ctx = new ValidationContextImpl(context);
                 enumerationAnnotations = facets.enumAnnotations;
                 fEnumerationSize = 0;
                 for (int i = 0; i < size; i++) {
                     if (enumNSDecls != null)
-                        ctx.setNSContext((NamespaceContext)enumNSDecls.elementAt(i));
+                        ctx.setNSContext((NamespaceContext)enumNSDecls.get(i));
                     try {
-                        ValidatedInfo info = getActualEnumValue((String)enumVals.elementAt(i), ctx, null);
+                        ValidatedInfo info = getActualEnumValue((String)enumVals.get(i), ctx, null);
                         // check 4.3.5.c0 must: enumeration values from the value space of base
                         fEnumeration[fEnumerationSize++] = info;
                     } catch (InvalidDatatypeValueException ide) {
-                        reportError("enumeration-valid-restriction", new Object[]{enumVals.elementAt(i), this.getBaseType().getName()});
+                        reportError("enumeration-valid-restriction", new Object[]{enumVals.get(i), this.getBaseType().getName()});
                     }
                 }
                 fFacetsDefined |= FACET_ENUMERATION;
@@ -1451,8 +1452,8 @@
             }
             else {
                 for (int i = fBase.fPattern.size()-1; i >= 0; --i) {
-                    fPattern.addElement(fBase.fPattern.elementAt(i));
-                    fPatternStr.addElement(fBase.fPatternStr.elementAt(i));
+                    fPattern.add(fBase.fPattern.get(i));
+                    fPatternStr.add(fBase.fPatternStr.get(i));
                 }
                 if (fBase.patternAnnotations != null) {
                     if (patternAnnotations != null) {
@@ -1830,11 +1831,11 @@
         if ( (fFacetsDefined & FACET_PATTERN ) != 0 ) {
             RegularExpression regex;
             for (int idx = fPattern.size()-1; idx >= 0; idx--) {
-                regex = (RegularExpression)fPattern.elementAt(idx);
+                regex = fPattern.get(idx);
                 if (!regex.matches(nvalue)){
                     throw new InvalidDatatypeValueException("cvc-pattern-valid",
                             new Object[]{content,
-                            fPatternStr.elementAt(idx),
+                            fPatternStr.get(idx),
 
                             fTypeName});
                 }
@@ -2358,7 +2359,7 @@
                 strs = new String[size];
             }
             for (int i = 0; i < size; i++)
-                strs[i] = (String)fPatternStr.elementAt(i);
+                strs[i] = fPatternStr.get(i);
             fLexicalPattern = new StringListImpl(strs, strs.length);
         }
         return fLexicalPattern;
@@ -3439,7 +3440,7 @@
         }
     }
 
-    private static abstract class AbstractObjectList extends AbstractList implements ObjectList {
+    private static abstract class AbstractObjectList extends AbstractList<Object> implements ObjectList {
         public Object get(int index) {
             if (index >= 0 && index < getLength()) {
                 return item(index);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ConfigurableValidationState.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ConfigurableValidationState.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
@@ -77,7 +77,7 @@
      * @return null, if ID/IDREF checking is turned off
      *         otherwise, returns the value of the super implementation
      */
-    public Iterator checkIDRefID() {
+    public Iterator<String> checkIDRefID() {
         return (fIdIdrefChecking) ? super.checkIDRefID() : null;
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.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,7 +21,8 @@
 
 package com.sun.org.apache.xerces.internal.impl.validation;
 
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * ValidationManager is a coordinator property for validators in the
@@ -36,7 +37,7 @@
  */
 public class ValidationManager {
 
-    protected final Vector fVSs = new Vector();
+    protected final List<ValidationState> fVSs = new ArrayList<>();
     protected boolean fGrammarFound = false;
 
     // used by the DTD validator to tell other components that it has a
@@ -49,7 +50,7 @@
      * the validation manager.
      */
     public final void addValidationState(ValidationState vs) {
-        fVSs.addElement(vs);
+        fVSs.add(vs);
     }
 
     /**
@@ -57,7 +58,7 @@
      */
     public final void setEntityState(EntityState state) {
         for (int i = fVSs.size()-1; i >= 0; i--) {
-            ((ValidationState)fVSs.elementAt(i)).setEntityState(state);
+            (fVSs.get(i)).setEntityState(state);
         }
     }
 
@@ -79,7 +80,7 @@
 
 
     public final void reset (){
-        fVSs.removeAllElements();
+        fVSs.clear();
         fGrammarFound = false;
         fCachedDTD = false;
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.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
@@ -27,6 +27,7 @@
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Locale;
 
 /**
@@ -53,7 +54,7 @@
     private Locale fLocale                      = null;
 
     private HashSet<String> fIds;
-    private ArrayList<String> fIdRefList;
+    private List<String> fIdRefList;
 
     //
     // public methods
@@ -91,15 +92,15 @@
      * otherwise return an iterator for all the IDREF values without
      * a matching ID value.
      */
-    public Iterator checkIDRefID () {
-        HashSet missingIDs = null;
+    public Iterator<String> checkIDRefID () {
+        HashSet<String> missingIDs = null;
         if (fIdRefList != null) {
             String key;
             for (int i = 0; i < fIdRefList.size(); i++) {
                 key = fIdRefList.get(i);
                 if (fIds == null || !fIds.contains(key)) {
                     if (missingIDs == null) {
-                        missingIDs = new HashSet();
+                        missingIDs = new HashSet<>();
                     }
                     missingIDs.add(key);
                 }
@@ -177,7 +178,7 @@
 
     // idref
     public void addIdRef(String name) {
-        if (fIdRefList == null) fIdRefList = new ArrayList();
+        if (fIdRefList == null) fIdRefList = new ArrayList<>();
         fIdRefList.add(name);
     }
     // get symbols
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/PSVIErrorList.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/PSVIErrorList.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,10 +21,9 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs;
 
+import com.sun.org.apache.xerces.internal.xs.StringList;
 import java.util.AbstractList;
 
-import com.sun.org.apache.xerces.internal.xs.StringList;
-
 /**
  * StringList implementation for schema error codes and error messages.
  *
@@ -33,7 +32,7 @@
  * @author Michael Glavassevich, IBM
  *
  */
-final class PSVIErrorList extends AbstractList implements StringList {
+final class PSVIErrorList extends AbstractList<String> implements StringList {
 
     private final String[] fArray;
     private final int fLength;
@@ -78,7 +77,7 @@
      * List methods
      */
 
-    public Object get(int index) {
+    public String get(int index) {
         if (index >= 0 && index < fLength) {
             return fArray[(index << 1) + fOffset];
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.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
@@ -59,7 +59,9 @@
 import com.sun.org.apache.xerces.internal.xs.XSWildcard;
 import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
 import java.lang.ref.SoftReference;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 import org.xml.sax.SAXException;
 
 /**
@@ -119,8 +121,8 @@
     // symbol table for constructing parsers (annotation support)
     private SymbolTable fSymbolTable = null;
     // parsers for annotation support
-    private SoftReference fSAXParser = null;
-    private SoftReference fDOMParser = null;
+    private SoftReference<SAXParser> fSAXParser = null;
+    private SoftReference<DOMParser> fDOMParser = null;
 
     // is this grammar immutable?  (fully constructed and not changeable)
     private boolean fIsImmutable = false;
@@ -242,16 +244,16 @@
 
         // List of imported grammars
         if (grammar.fImported != null) {
-            fImported = new Vector();
+            fImported = new ArrayList<>();
             for (int i=0; i<grammar.fImported.size(); i++) {
-                fImported.add(grammar.fImported.elementAt(i));
+                fImported.add(grammar.fImported.get(i));
             }
         }
 
         // Locations
         if (grammar.fLocations != null) {
             for (int k=0; k<grammar.fLocations.size(); k++) {
-                addDocument(null, (String)grammar.fLocations.elementAt(k));
+                addDocument(null, grammar.fLocations.get(k));
             }
         }
 
@@ -406,7 +408,7 @@
 
         // override these methods solely so that these
         // objects cannot be modified once they're created.
-        public void setImportedGrammars(Vector importedGrammars) {
+        public void setImportedGrammars(List<SchemaGrammar> importedGrammars) {
             // ignore
         }
         public void addGlobalAttributeDecl(XSAttributeDecl decl) {
@@ -657,7 +659,7 @@
 
         // override these methods solely so that these
         // objects cannot be modified once they're created.
-        public void setImportedGrammars(Vector importedGrammars) {
+        public void setImportedGrammars(List<SchemaGrammar> importedGrammars) {
             // ignore
         }
         public void addGlobalAttributeDecl(XSAttributeDecl decl) {
@@ -801,13 +803,13 @@
         return true;
     } // isNamespaceAware():boolean
 
-    Vector fImported = null;
+    List<SchemaGrammar> fImported = null;
 
-    public void setImportedGrammars(Vector importedGrammars) {
+    public void setImportedGrammars(List<SchemaGrammar> importedGrammars) {
         fImported = importedGrammars;
     }
 
-    public Vector getImportedGrammars() {
+    public List<SchemaGrammar> getImportedGrammars() {
         return fImported;
     }
 
@@ -1357,24 +1359,26 @@
 
     // store the documents and their locations contributing to this namespace
     // REVISIT: use StringList and XSObjectList for there fields.
-    private Vector fDocuments = null;
-    private Vector fLocations = null;
+    // fDocuments is never used
+    private List<Object> fDocuments = null;
+    private List<String> fLocations = null;
 
     public synchronized void addDocument(Object document, String location) {
         if (fDocuments == null) {
-            fDocuments = new Vector();
-            fLocations = new Vector();
+            // Parsing schema is not thread safe, synchronized may be removed
+            fDocuments = new CopyOnWriteArrayList<>();
+            fLocations = new CopyOnWriteArrayList<>();
         }
-        fDocuments.addElement(document);
-        fLocations.addElement(location);
+        fDocuments.add(document);
+        fLocations.add(location);
     }
 
     public synchronized void removeDocument(int index) {
         if (fDocuments != null &&
             index >= 0 &&
             index < fDocuments.size()) {
-            fDocuments.removeElementAt(index);
-            fLocations.removeElementAt(index);
+            fDocuments.remove(index);
+            fLocations.remove(index);
         }
     }
 
@@ -1390,7 +1394,7 @@
     // annotation support
     synchronized DOMParser getDOMParser() {
         if (fDOMParser != null) {
-            DOMParser parser = (DOMParser) fDOMParser.get();
+            DOMParser parser = fDOMParser.get();
             if (parser != null) {
                 return parser;
             }
@@ -1409,13 +1413,13 @@
             parser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.DEFER_NODE_EXPANSION_FEATURE, false);
         }
         catch (SAXException exc) {}
-        fDOMParser = new SoftReference(parser);
+        fDOMParser = new SoftReference<DOMParser>(parser);
         return parser;
     }
 
     synchronized SAXParser getSAXParser() {
         if (fSAXParser != null) {
-            SAXParser parser = (SAXParser) fSAXParser.get();
+            SAXParser parser = fSAXParser.get();
             if (parser != null) {
                 return parser;
             }
@@ -1429,7 +1433,7 @@
         config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
         config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, false);
         SAXParser parser = new SAXParser(config);
-        fSAXParser = new SoftReference(parser);
+        fSAXParser = new SoftReference<SAXParser>(parser);
         return parser;
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -26,9 +27,10 @@
 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
 import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
-import java.util.Vector;
 
 /**
  * To store and validate information about substitutionGroup
@@ -196,22 +198,23 @@
     /**
      * add a list of substitution group information.
      */
+    @SuppressWarnings("unchecked")
     public void addSubstitutionGroup(XSElementDecl[] elements) {
         XSElementDecl subHead, element;
-        Vector subGroup;
+        List<XSElementDecl> subGroup;
         // for all elements with substitution group affiliation
         for (int i = elements.length-1; i >= 0; i--) {
             element = elements[i];
             subHead = element.fSubGroup;
             // check whether this an entry for this element
-            subGroup = (Vector)fSubGroupsB.get(subHead);
+            subGroup = (List<XSElementDecl>)fSubGroupsB.get(subHead);
             if (subGroup == null) {
                 // if not, create a new one
-                subGroup = new Vector();
+                subGroup = new ArrayList<>();
                 fSubGroupsB.put(subHead, subGroup);
             }
             // add to the vactor
-            subGroup.addElement(element);
+            subGroup.add(element);
         }
     }
 
@@ -272,21 +275,23 @@
             return (OneSubGroup[])subGroup;
 
         // we only have the *direct* substitutions
-        Vector group = (Vector)subGroup, newGroup = new Vector();
+        @SuppressWarnings("unchecked")
+        List<XSElementDecl> group = (ArrayList<XSElementDecl>)subGroup;
+        List<OneSubGroup> newGroup = new ArrayList<>();
         OneSubGroup[] group1;
         // then for each of the direct substitutions, get its substitution
         // group, and combine the groups together.
         short dMethod, bMethod, dSubMethod, bSubMethod;
         for (int i = group.size()-1, j; i >= 0; i--) {
             // Check whether this element is blocked. If so, ignore it.
-            XSElementDecl sub = (XSElementDecl)group.elementAt(i);
+            XSElementDecl sub = (XSElementDecl)group.get(i);
             if (!getDBMethods(sub.fType, element.fType, methods))
                 continue;
             // Remember derivation methods and blocks from the types
             dMethod = methods.dMethod;
             bMethod = methods.bMethod;
             // Add this one to potential group
-            newGroup.addElement(new OneSubGroup(sub, methods.dMethod, methods.bMethod));
+            newGroup.add(new OneSubGroup(sub, methods.dMethod, methods.bMethod));
             // Get potential group for this element
             group1 = getSubGroupB(sub, methods);
             for (j = group1.length-1; j >= 0; j--) {
@@ -296,13 +301,13 @@
                 // Ignore it if it's blocked
                 if ((dSubMethod & bSubMethod) != 0)
                     continue;
-                newGroup.addElement(new OneSubGroup(group1[j].sub, dSubMethod, bSubMethod));
+                newGroup.add(new OneSubGroup(group1[j].sub, dSubMethod, bSubMethod));
             }
         }
         // Convert to an array
         OneSubGroup[] ret = new OneSubGroup[newGroup.size()];
         for (int i = newGroup.size()-1; i >= 0; i--) {
-            ret[i] = (OneSubGroup)newGroup.elementAt(i);
+            ret[i] = (OneSubGroup)newGroup.get(i);
         }
         // Store the potential sub group
         fSubGroupsB.put(element, ret);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -83,6 +83,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Stack;
 import java.util.Vector;
@@ -431,7 +432,7 @@
 
         // store error codes; starting position of the errors for each element;
         // number of element (depth); and whether to record error
-        Vector fErrors = new Vector();
+        Vector<String> fErrors = new Vector<>();
         int[] fContext = new int[INITIAL_STACK_SIZE];
         int fContextCount;
 
@@ -474,7 +475,7 @@
             // copy errors from the list to an string array
             String[] errors = new String[size];
             for (int i = 0; i < size; i++) {
-                errors[i] = (String) fErrors.elementAt(contextPos + i);
+                errors[i] = fErrors.get(contextPos + i);
             }
             // remove errors of the current element
             fErrors.setSize(contextPos);
@@ -498,7 +499,7 @@
             // copy errors from the list to an string array
             String[] errors = new String[size];
             for (int i = 0; i < size; i++) {
-                errors[i] = (String) fErrors.elementAt(contextPos + i);
+                errors[i] = fErrors.get(contextPos + i);
             }
             // don't resize the vector: leave the errors for this attribute
             // to the containing element
@@ -509,8 +510,8 @@
             throws XNIException {
             String message = fErrorReporter.reportError(domain, key, arguments, severity);
             if (fAugPSVI) {
-                fErrors.addElement(key);
-                fErrors.addElement(message);
+                fErrors.add(key);
+                fErrors.add(message);
             }
         } // reportError(String,String,Object[],short)
 
@@ -523,8 +524,8 @@
             throws XNIException {
             String message = fErrorReporter.reportError(location, domain, key, arguments, severity);
             if (fAugPSVI) {
-                fErrors.addElement(key);
-                fErrors.addElement(message);
+                fErrors.add(key);
+                fErrors.add(message);
             }
         } // reportError(XMLLocator,String,String,Object[],short)
     }
@@ -1935,7 +1936,7 @@
             if (fCurrCMState[0] == XSCMValidator.FIRST_ERROR) {
                 XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType;
                 //REVISIT: is it the only case we will have particle = null?
-                ArrayList next;
+                List<Object> next;
                 if (ctype.fParticle != null
                     && (next = fCurrentCM.whatCanGoHere(fCurrCMState)).size() > 0) {
                     String expected = expectedStr(next);
@@ -2447,7 +2448,7 @@
         // have we reached the end tag of the validation root?
         if (fElementDepth == 0) {
             // 7 If the element information item is the validation root, it must be valid per Validation Root Valid (ID/IDREF) (3.3.4).
-            Iterator invIdRefs = fValidationState.checkIDRefID();
+            Iterator<String> invIdRefs = fValidationState.checkIDRefID();
             fValidationState.resetIDTables();
             if (invIdRefs != null) {
                 while (invIdRefs.hasNext()) {
@@ -3509,11 +3510,10 @@
                     // After the DFA has completed, check minOccurs and maxOccurs
                     // for all elements and wildcards in this content model where
                     // a{n,m} is subsumed to a* or a+
-                    ArrayList errors = fCurrentCM.checkMinMaxBounds();
+                    List<String> errors = fCurrentCM.checkMinMaxBounds();
                     if (errors != null) {
                         for (int i = 0; i < errors.size(); i += 2) {
-                            reportSchemaError(
-                                (String) errors.get(i),
+                            reportSchemaError(errors.get(i),
                                 new Object[] { element.rawname, errors.get(i + 1) });
                         }
                     }
@@ -3591,7 +3591,7 @@
                 XMLErrorReporter.SEVERITY_ERROR);
     }
 
-    private String expectedStr(ArrayList expected) {
+    private String expectedStr(List<Object> expected) {
         StringBuilder ret = new StringBuilder("{");
         int size = expected.size();
         for (int i = 0; i < size; i++) {
@@ -3720,9 +3720,9 @@
         protected int fValuesCount;
 
         /** global data */
-        public final Vector fValues = new Vector();
+        public final Vector<Object> fValues = new Vector<>();
         public ShortVector fValueTypes = null;
-        public Vector fItemValueTypes = null;
+        public Vector<ShortList> fItemValueTypes = null;
 
         private boolean fUseValueTypeVector = false;
         private int fValueTypesLength = 0;
@@ -3778,7 +3778,7 @@
         // appends the contents of one ValueStore to those of us.
         public void append(ValueStoreBase newVal) {
             for (int i = 0; i < newVal.fValues.size(); i++) {
-                fValues.addElement(newVal.fValues.elementAt(i));
+                fValues.add(newVal.fValues.get(i));
             }
         } // append(ValueStoreBase)
 
@@ -3893,7 +3893,7 @@
                 checkDuplicateValues();
                 // store values
                 for (i = 0; i < fFieldCount; i++) {
-                    fValues.addElement(fLocalValues[i]);
+                    fValues.add(fLocalValues[i]);
                     addValueType(fLocalValueTypes[i]);
                     addItemValueType(fLocalItemValueTypes[i]);
                 }
@@ -3912,7 +3912,7 @@
                 next = i + fFieldCount;
                 for (int j = 0; j < fFieldCount; j++) {
                     Object value1 = fLocalValues[j];
-                    Object value2 = fValues.elementAt(i);
+                    Object value2 = fValues.get(i);
                     short valueType1 = fLocalValueTypes[j];
                     short valueType2 = getValueTypeAt(i);
                     if (value1 == null || value2 == null || valueType1 != valueType2 || !(value1.equals(value2))) {
@@ -3940,12 +3940,12 @@
          */
         public int contains(ValueStoreBase vsb) {
 
-            final Vector values = vsb.fValues;
+            final Vector<Object> values = vsb.fValues;
             final int size1 = values.size();
             if (fFieldCount <= 1) {
                 for (int i = 0; i < size1; ++i) {
                     short val = vsb.getValueTypeAt(i);
-                    if (!valueTypeContains(val) || !fValues.contains(values.elementAt(i))) {
+                    if (!valueTypeContains(val) || !fValues.contains(values.get(i))) {
                         return i;
                     }
                     else if(val == XSConstants.LIST_DT || val == XSConstants.LISTOFUNION_DT) {
@@ -3964,8 +3964,8 @@
                     /** Check whether this set is contained in the value store. **/
                     INNER: for (int j = 0; j < size2; j += fFieldCount) {
                         for (int k = 0; k < fFieldCount; ++k) {
-                            final Object value1 = values.elementAt(i+k);
-                            final Object value2 = fValues.elementAt(j+k);
+                            final Object value1 = values.get(i+k);
+                            final Object value2 = fValues.get(j+k);
                             final short valueType1 = vsb.getValueTypeAt(i+k);
                             final short valueType2 = getValueTypeAt(j+k);
                             if (value1 != value2 && (valueType1 != valueType2 || value1 == null || !value1.equals(value2))) {
@@ -4019,7 +4019,7 @@
         } // toString(Object[]):String
 
         /** Returns a string of the specified values. */
-        protected String toString(Vector values, int start, int length) {
+        protected String toString(Vector<Object> values, int start, int length) {
 
             // no values
             if (length == 0) {
@@ -4028,7 +4028,7 @@
 
             // one value
             if (length == 1) {
-                return String.valueOf(values.elementAt(start));
+                return String.valueOf(values.get(start));
             }
 
             // construct value string
@@ -4037,7 +4037,7 @@
                 if (i > 0) {
                     str.append(',');
                 }
-                str.append(values.elementAt(start + i));
+                str.append(values.get(start + i));
             }
             return str.toString();
 
@@ -4109,7 +4109,7 @@
                     (fItemValueType != null && fItemValueType.equals(itemValueType)))) {
                 fUseItemValueTypeVector = true;
                 if (fItemValueTypes == null) {
-                    fItemValueTypes = new Vector(fItemValueTypesLength * 2);
+                    fItemValueTypes = new Vector<>(fItemValueTypesLength * 2);
                 }
                 for (int i = 1; i < fItemValueTypesLength; ++i) {
                     fItemValueTypes.add(fItemValueType);
@@ -4120,7 +4120,7 @@
 
         private ShortList getItemValueTypeAt(int index) {
             if (fUseItemValueTypeVector) {
-                return (ShortList) fItemValueTypes.elementAt(index);
+                return (ShortList) fItemValueTypes.get(index);
             }
             return fItemValueType;
         }
@@ -4292,7 +4292,7 @@
         // values stores
 
         /** stores all global Values stores. */
-        protected final ArrayList fValueStores = new ArrayList();
+        protected final List<ValueStoreBase> fValueStores = new ArrayList<>();
 
         /**
          * Values stores associated to specific identity constraints.
@@ -4352,11 +4352,12 @@
 
         // startElement:  pushes the current fGlobalIDConstraintMap
         // onto fGlobalMapStack and clears fGlobalIDConstraint map.
+        @SuppressWarnings("unchecked")
         public void startElement() {
             // only clone the map when there are elements
             if (fGlobalIDConstraintMap.size() > 0)
                 fGlobalMapStack.push((Map<IdentityConstraint, ValueStoreBase>)
-                        ((HashMap)fGlobalIDConstraintMap).clone());
+                        ((HashMap<IdentityConstraint, ValueStoreBase>)fGlobalIDConstraintMap).clone());
             else
                 fGlobalMapStack.push(null);
             fGlobalIDConstraintMap.clear();
@@ -4483,9 +4484,7 @@
         /** Check identity constraints. */
         public void endDocument() {
 
-            int count = fValueStores.size();
-            for (int i = 0; i < count; i++) {
-                ValueStoreBase valueStore = (ValueStoreBase) fValueStores.get(i);
+            for (ValueStoreBase valueStore : fValueStores) {
                 valueStore.endDocument();
             }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.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,10 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs;
 
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Vector;
-
 import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
 import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
 import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
@@ -38,6 +34,10 @@
 import com.sun.org.apache.xerces.internal.xs.XSConstants;
 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
 
 /**
  * Constaints shared by traversers and validator
@@ -55,7 +55,8 @@
     // (IHR@xbrl.org) (Ignacio@Hernandez-Ros.com)
 
     static final int OCCURRENCE_UNKNOWN = SchemaSymbols.OCCURRENCE_UNBOUNDED-1;
-    static final XSSimpleType STRING_TYPE = (XSSimpleType)SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(SchemaSymbols.ATTVAL_STRING);
+    static final XSSimpleType STRING_TYPE =
+            (XSSimpleType)SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(SchemaSymbols.ATTVAL_STRING);
 
     private static XSParticleDecl fEmptyParticle = null;
     public static XSParticleDecl getEmptySequence() {
@@ -74,11 +75,12 @@
         return fEmptyParticle;
     }
 
-    private static final Comparator ELEMENT_PARTICLE_COMPARATOR = new Comparator() {
+    private static final Comparator<XSParticleDecl> ELEMENT_PARTICLE_COMPARATOR =
+            new Comparator<XSParticleDecl>() {
 
-        public int compare(Object o1, Object o2) {
-            XSParticleDecl pDecl1 = (XSParticleDecl) o1;
-            XSParticleDecl pDecl2 = (XSParticleDecl) o2;
+        public int compare(XSParticleDecl o1, XSParticleDecl o2) {
+            XSParticleDecl pDecl1 = o1;
+            XSParticleDecl pDecl2 = o2;
             XSElementDecl decl1 = (XSElementDecl) pDecl1.fValue;
             XSElementDecl decl2 = (XSElementDecl) pDecl2.fValue;
 
@@ -612,8 +614,8 @@
             boolean checkWCOccurrence)
         throws XMLSchemaException {
 
-        Vector dChildren = null;
-        Vector bChildren = null;
+        List<XSParticleDecl> dChildren = null;
+        List<XSParticleDecl> bChildren = null;
         int dMinEffectiveTotalRange=OCCURRENCE_UNKNOWN;
         int dMaxEffectiveTotalRange=OCCURRENCE_UNKNOWN;
 
@@ -683,7 +685,7 @@
                     dMaxEffectiveTotalRange = dMaxOccurs;
 
                     // Fill in the vector of children
-                    dChildren = new Vector(subGroup.length+1);
+                    dChildren = new ArrayList<>(subGroup.length+1);
                     for (int i = 0; i < subGroup.length; i++) {
                         addElementToParticleVector(dChildren, subGroup[i]);
                     }
@@ -736,7 +738,7 @@
                     // Now, set the type to be CHOICE
                     bType = XSModelGroupImpl.MODELGROUP_CHOICE;
 
-                    bChildren = new Vector(bsubGroup.length+1);
+                    bChildren = new ArrayList<>(bsubGroup.length+1);
                     for (int i = 0; i < bsubGroup.length; i++) {
                         addElementToParticleVector(bChildren, bsubGroup[i]);
                     }
@@ -782,8 +784,8 @@
                     {
                         // Treat the element as if it were in a group of the same type
                         // as the base Particle
-                        dChildren = new Vector();
-                        dChildren.addElement(dParticle);
+                        dChildren = new ArrayList<>();
+                        dChildren.add(dParticle);
 
                         checkRecurseLax(dChildren, 1, 1, dSGHandler,
                                 bChildren, bMinOccurs, bMaxOccurs, bSGHandler);
@@ -794,8 +796,8 @@
                     {
                         // Treat the element as if it were in a group of the same type
                         // as the base Particle
-                        dChildren = new Vector();
-                        dChildren.addElement(dParticle);
+                        dChildren = new ArrayList<>();
+                        dChildren.add(dParticle);
 
                         checkRecurse(dChildren, 1, 1, dSGHandler,
                                 bChildren, bMinOccurs, bMaxOccurs, bSGHandler);
@@ -990,12 +992,12 @@
         return bExpansionHappened;
     }
 
-    private static void addElementToParticleVector (Vector v, XSElementDecl d)  {
+    private static void addElementToParticleVector (List<XSParticleDecl> v, XSElementDecl d)  {
 
         XSParticleDecl p = new XSParticleDecl();
         p.fValue = d;
         p.fType = XSParticleDecl.PARTICLE_ELEMENT;
-        v.addElement(p);
+        v.add(p);
 
     }
 
@@ -1012,13 +1014,13 @@
             return p;
     }
 
-    private static Vector removePointlessChildren(XSParticleDecl p)  {
+    private static List<XSParticleDecl> removePointlessChildren(XSParticleDecl p)  {
 
         if (p.fType == XSParticleDecl.PARTICLE_ELEMENT ||
                 p.fType == XSParticleDecl.PARTICLE_WILDCARD)
             return null;
 
-        Vector children = new Vector();
+        List<XSParticleDecl> children = new ArrayList<>();
 
         XSModelGroupImpl group = (XSModelGroupImpl)p.fValue;
         for (int i = 0; i < group.fParticleCount; i++)
@@ -1028,7 +1030,7 @@
     }
 
 
-    private static void gatherChildren(int parentType, XSParticleDecl p, Vector children) {
+    private static void gatherChildren(int parentType, XSParticleDecl p, List<XSParticleDecl> children) {
 
         int min = p.fMinOccurs;
         int max = p.fMaxOccurs;
@@ -1038,12 +1040,12 @@
 
         if (type == XSParticleDecl.PARTICLE_ELEMENT ||
                 type== XSParticleDecl.PARTICLE_WILDCARD) {
-            children.addElement(p);
+            children.add(p);
             return;
         }
 
         if (! (min==1 && max==1)) {
-            children.addElement(p);
+            children.add(p);
         }
         else if (parentType == type) {
             XSModelGroupImpl group = (XSModelGroupImpl)p.fValue;
@@ -1051,7 +1053,7 @@
                 gatherChildren(type, group.fParticles[i], children);
         }
         else if (!p.isEmpty()) {
-            children.addElement(p);
+            children.add(p);
         }
 
     }
@@ -1215,7 +1217,7 @@
     }
 
 
-    private static void checkNSRecurseCheckCardinality(Vector children, int min1, int max1,
+    private static void checkNSRecurseCheckCardinality(List<XSParticleDecl> children, int min1, int max1,
             SubstitutionGroupHandler dSGHandler,
             XSParticleDecl wildcard, int min2, int max2,
             boolean checkWCOccurrence)
@@ -1235,7 +1237,7 @@
         int count = children.size();
         try {
             for (int i = 0; i < count; i++) {
-                XSParticleDecl particle1 = (XSParticleDecl)children.elementAt(i);
+                XSParticleDecl particle1 = (XSParticleDecl)children.get(i);
                 particleValidRestriction(particle1, dSGHandler, wildcard, null, false);
 
             }
@@ -1248,9 +1250,9 @@
 
     }
 
-    private static void checkRecurse(Vector dChildren, int min1, int max1,
+    private static void checkRecurse(List<XSParticleDecl> dChildren, int min1, int max1,
             SubstitutionGroupHandler dSGHandler,
-            Vector bChildren, int min2, int max2,
+            List<XSParticleDecl> bChildren, int min2, int max2,
             SubstitutionGroupHandler bSGHandler)
         throws XMLSchemaException {
 
@@ -1269,9 +1271,9 @@
         int current = 0;
         label: for (int i = 0; i<count1; i++) {
 
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.elementAt(i);
+            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
             for (int j = current; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
+                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
                 current +=1;
                 try {
                     particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
@@ -1287,7 +1289,7 @@
 
         // Now, see if there are some elements in the base we didn't match up
         for (int j=current; j < count2; j++) {
-            XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
+            XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
             if (!particle2.emptiable()) {
                 throw new XMLSchemaException("rcase-Recurse.2", null);
             }
@@ -1295,9 +1297,9 @@
 
     }
 
-    private static void checkRecurseUnordered(Vector dChildren, int min1, int max1,
+    private static void checkRecurseUnordered(List<XSParticleDecl> dChildren, int min1, int max1,
             SubstitutionGroupHandler dSGHandler,
-            Vector bChildren, int min2, int max2,
+            List<XSParticleDecl> bChildren, int min2, int max2,
             SubstitutionGroupHandler bSGHandler)
         throws XMLSchemaException {
 
@@ -1317,10 +1319,10 @@
         boolean foundIt[] = new boolean[count2];
 
         label: for (int i = 0; i<count1; i++) {
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.elementAt(i);
+            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
 
             for (int j = 0; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
+                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
                 try {
                     particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
                     if (foundIt[j])
@@ -1339,7 +1341,7 @@
 
         // Now, see if there are some elements in the base we didn't match up
         for (int j=0; j < count2; j++) {
-            XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
+            XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
             if (!foundIt[j] && !particle2.emptiable()) {
                 throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
             }
@@ -1347,9 +1349,9 @@
 
     }
 
-    private static void checkRecurseLax(Vector dChildren, int min1, int max1,
+    private static void checkRecurseLax(List<XSParticleDecl> dChildren, int min1, int max1,
             SubstitutionGroupHandler dSGHandler,
-            Vector bChildren, int min2, int max2,
+            List<XSParticleDecl> bChildren, int min2, int max2,
             SubstitutionGroupHandler  bSGHandler)
         throws XMLSchemaException {
 
@@ -1368,9 +1370,9 @@
         int current = 0;
         label: for (int i = 0; i<count1; i++) {
 
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.elementAt(i);
+            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
             for (int j = current; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
+                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
                 current +=1;
                 try {
                     // IHR: go back one element on b list because the next element may match
@@ -1389,9 +1391,9 @@
 
     }
 
-    private static void checkMapAndSum(Vector dChildren, int min1, int max1,
+    private static void checkMapAndSum(List<XSParticleDecl> dChildren, int min1, int max1,
             SubstitutionGroupHandler dSGHandler,
-            Vector bChildren, int min2, int max2,
+            List<XSParticleDecl> bChildren, int min2, int max2,
             SubstitutionGroupHandler bSGHandler)
         throws XMLSchemaException {
 
@@ -1423,9 +1425,9 @@
 
         label: for (int i = 0; i<count1; i++) {
 
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.elementAt(i);
+            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
             for (int j = 0; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
+                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
                 try {
                     particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
                     continue label;
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,10 +21,10 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs;
 
-import java.util.Enumeration;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
-import java.util.Vector;
 
 /**
  * A class used to hold the internal schema grammar set for the current instance
@@ -39,7 +40,7 @@
     /**
      * Map that maps between Namespace and a Grammar
      */
-    Map<String, SchemaGrammar> fGrammarRegistry = new HashMap();
+    Map<String, SchemaGrammar> fGrammarRegistry = new HashMap<>();
     SchemaGrammar fNoNSGrammar = null;
 
     /**
@@ -94,19 +95,20 @@
         // get all imported grammars, and make a copy of the Vector, so that
         // we can recursively process the grammars, and add distinct ones
         // to the same vector
-        Vector currGrammars = (Vector)grammar.getImportedGrammars();
+        ArrayList<SchemaGrammar> currGrammars = (ArrayList<SchemaGrammar>)grammar.getImportedGrammars();
         if (currGrammars == null) {
             putGrammar(grammar);
             return true;
         }
 
-        Vector grammars = ((Vector)currGrammars.clone());
+        @SuppressWarnings("unchecked")
+        List<SchemaGrammar> grammars = ((ArrayList<SchemaGrammar>)currGrammars.clone());
         SchemaGrammar sg1, sg2;
-        Vector gs;
+        List<SchemaGrammar> gs;
         // for all (recursively) imported grammars
         for (int i = 0; i < grammars.size(); i++) {
             // get the grammar
-            sg1 = (SchemaGrammar)grammars.elementAt(i);
+            sg1 = grammars.get(i);
             // check whether the bucket has one with the same tns
             sg2 = getGrammar(sg1.fTargetNamespace);
             if (sg2 == null) {
@@ -116,9 +118,9 @@
                 // we add them to the vector
                 if(gs == null) continue;
                 for (int j = gs.size() - 1; j >= 0; j--) {
-                    sg2 = (SchemaGrammar)gs.elementAt(j);
+                    sg2 = gs.get(j);
                     if (!grammars.contains(sg2))
-                        grammars.addElement(sg2);
+                        grammars.add(sg2);
                 }
             }
             // we found one with the same target namespace
@@ -131,7 +133,7 @@
         // now we have all imported grammars stored in the vector. add them
         putGrammar(grammar);
         for (int i = grammars.size() - 1; i >= 0; i--)
-            putGrammar((SchemaGrammar)grammars.elementAt(i));
+            putGrammar(grammars.get(i));
 
         return true;
     }
@@ -167,18 +169,19 @@
         // get all imported grammars, and make a copy of the Vector, so that
         // we can recursively process the grammars, and add distinct ones
         // to the same vector
-        Vector currGrammars = (Vector)grammar.getImportedGrammars();
+        ArrayList<SchemaGrammar> currGrammars = (ArrayList<SchemaGrammar>)grammar.getImportedGrammars();
         if (currGrammars == null) {
             return true;
         }
 
-        Vector grammars = ((Vector)currGrammars.clone());
+        @SuppressWarnings("unchecked")
+        List<SchemaGrammar> grammars = ((ArrayList<SchemaGrammar>)currGrammars.clone());
         SchemaGrammar sg1, sg2;
-        Vector gs;
+        List<SchemaGrammar> gs;
         // for all (recursively) imported grammars
         for (int i = 0; i < grammars.size(); i++) {
             // get the grammar
-            sg1 = (SchemaGrammar)grammars.elementAt(i);
+            sg1 = grammars.get(i);
             // check whether the bucket has one with the same tns
             sg2 = getGrammar(sg1.fTargetNamespace);
             if (sg2 == null) {
@@ -188,9 +191,9 @@
                 // we add them to the vector
                 if(gs == null) continue;
                 for (int j = gs.size() - 1; j >= 0; j--) {
-                    sg2 = (SchemaGrammar)gs.elementAt(j);
+                    sg2 = (SchemaGrammar)gs.get(j);
                     if (!grammars.contains(sg2))
-                        grammars.addElement(sg2);
+                        grammars.add(sg2);
                 }
             }
             // we found one with the same target namespace, ignore it
@@ -201,7 +204,7 @@
 
         // now we have all imported grammars stored in the vector. add them
         for (int i = grammars.size() - 1; i >= 0; i--) {
-            putGrammar((SchemaGrammar)grammars.elementAt(i));
+            putGrammar(grammars.get(i));
         }
 
         return true;
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.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
@@ -46,9 +46,9 @@
 import java.lang.reflect.Array;
 import java.util.AbstractList;
 import java.util.Iterator;
+import java.util.List;
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
-import java.util.Vector;
 
 /**
  * Implements XSModel:  a read-only interface that represents an XML Schema,
@@ -59,7 +59,8 @@
  * @author Sandy Gao, IBM
  *
  */
-public final class XSModelImpl extends AbstractList implements XSModel, XSNamespaceItemList {
+@SuppressWarnings("unchecked") // method <T>toArray(T[])
+public final class XSModelImpl extends AbstractList<XSNamespaceItem> implements XSModel, XSNamespaceItemList {
 
     // the max index / the max value of XSObject type
     private static final short MAX_COMP_IDX = XSTypeDefinition.SIMPLE_TYPE;
@@ -139,7 +140,7 @@
         }
 
         SchemaGrammar sg1, sg2;
-        Vector gs;
+        List<SchemaGrammar> gs;
         int i, j, k;
         // and recursively get all imported grammars, add them to our arrays
         for (i = 0; i < len; i++) {
@@ -148,7 +149,7 @@
             gs = sg1.getImportedGrammars();
             // for each imported grammar
             for (j = gs == null ? -1 : gs.size() - 1; j >= 0; j--) {
-                sg2 = (SchemaGrammar)gs.elementAt(j);
+                sg2 = gs.get(j);
                 // check whether this grammar is already in the list
                 for (k = 0; k < len; k++) {
                     if (sg2 == grammarList[k]) {
@@ -751,7 +752,7 @@
     // java.util.List methods
     //
 
-    public Object get(int index) {
+    public XSNamespaceItem get(int index) {
         if (index >= 0 && index < fGrammarCount) {
             return fGrammarList[index];
         }
@@ -762,22 +763,22 @@
         return getLength();
     }
 
-    public Iterator iterator() {
+    public Iterator<XSNamespaceItem> iterator() {
         return listIterator0(0);
     }
 
-    public ListIterator listIterator() {
+    public ListIterator<XSNamespaceItem> listIterator() {
         return listIterator0(0);
     }
 
-    public ListIterator listIterator(int index) {
+    public ListIterator<XSNamespaceItem> listIterator(int index) {
         if (index >= 0 && index < fGrammarCount) {
             return listIterator0(index);
         }
         throw new IndexOutOfBoundsException("Index: " + index);
     }
 
-    private ListIterator listIterator0(int index) {
+    private ListIterator<XSNamespaceItem> listIterator0(int index) {
         return new XSNamespaceItemListIterator(index);
     }
 
@@ -789,8 +790,8 @@
 
     public Object[] toArray(Object[] a) {
         if (a.length < fGrammarCount) {
-            Class arrayClass = a.getClass();
-            Class componentType = arrayClass.getComponentType();
+            Class<?> arrayClass = a.getClass();
+            Class<?> componentType = arrayClass.getComponentType();
             a = (Object[]) Array.newInstance(componentType, fGrammarCount);
         }
         toArray0(a);
@@ -806,7 +807,7 @@
         }
     }
 
-    private final class XSNamespaceItemListIterator implements ListIterator {
+    private final class XSNamespaceItemListIterator implements ListIterator<XSNamespaceItem> {
         private int index;
         public XSNamespaceItemListIterator(int index) {
             this.index = index;
@@ -814,7 +815,7 @@
         public boolean hasNext() {
             return (index < fGrammarCount);
         }
-        public Object next() {
+        public XSNamespaceItem next() {
             if (index < fGrammarCount) {
                 return fGrammarList[index++];
             }
@@ -823,7 +824,7 @@
         public boolean hasPrevious() {
             return (index > 0);
         }
-        public Object previous() {
+        public XSNamespaceItem previous() {
             if (index > 0) {
                 return fGrammarList[--index];
             }
@@ -838,10 +839,10 @@
         public void remove() {
             throw new UnsupportedOperationException();
         }
-        public void set(Object o) {
+        public void set(XSNamespaceItem o) {
             throw new UnsupportedOperationException();
         }
-        public void add(Object o) {
+        public void add(XSNamespaceItem o) {
             throw new UnsupportedOperationException();
         }
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,12 +21,13 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.models;
 
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
 import com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler;
 import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
 import com.sun.org.apache.xerces.internal.impl.xs.XSConstraints;
+import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
+import com.sun.org.apache.xerces.internal.xni.QName;
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * XSAllCM implements XSCMValidator and handles &lt;all&gt;.
@@ -203,8 +205,8 @@
      * @return       a list whose entries are instances of
      *               either XSWildcardDecl or XSElementDecl.
      */
-    public ArrayList whatCanGoHere(int[] state) {
-        ArrayList ret = new ArrayList();
+    public List<Object> whatCanGoHere(int[] state) {
+        List<Object> ret = new ArrayList<>();
         for (int i = 0; i < fNumElements; i++) {
             // we only try to look for a matching decl if we have not seen
             // this element yet.
@@ -215,7 +217,7 @@
         return ret;
     }
 
-    public ArrayList checkMinMaxBounds() {
+    public List<String> checkMinMaxBounds() {
         return null;
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,10 +21,10 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.models;
 
-import com.sun.org.apache.xerces.internal.xni.QName;
 import com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler;
 import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
-import java.util.ArrayList;
+import com.sun.org.apache.xerces.internal.xni.QName;
+import java.util.List;
 
 /**
  * Note: State of the content model is stored in the validator
@@ -88,7 +89,7 @@
      * @return       a list whose entries are instances of
      *               either XSWildcardDecl or XSElementDecl.
      */
-    public ArrayList whatCanGoHere(int[] state);
+    public List<Object> whatCanGoHere(int[] state);
 
     /**
      * Used by constant space algorithm for a{n,m} for n > 1 and
@@ -104,7 +105,7 @@
      * is associated with the error code that proceeds it in
      * the list.
      */
-    public ArrayList checkMinMaxBounds();
+    public List<String> checkMinMaxBounds();
 
      /**
      * <p>Returns an array containing information about the current repeating term
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,19 +21,21 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.models;
 
-import com.sun.org.apache.xerces.internal.xni.QName;
 import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode;
 import com.sun.org.apache.xerces.internal.impl.dtd.models.CMStateSet;
 import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
 import com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler;
-import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSWildcardDecl;
 import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
 import com.sun.org.apache.xerces.internal.impl.xs.XSConstraints;
+import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
+import com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl;
+import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
+import com.sun.org.apache.xerces.internal.impl.xs.XSWildcardDecl;
+import com.sun.org.apache.xerces.internal.xni.QName;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * DFAContentModel is the implementation of XSCMValidator that does
@@ -720,7 +723,7 @@
          * a large content model such as, "(t001+|t002+|.... |t500+)".
          */
 
-        HashMap stateTable = new HashMap();
+        Map<CMStateSet, Integer> stateTable = new HashMap<>();
 
         /* Optimization(Jan, 2001) */
 
@@ -789,8 +792,8 @@
                     //
 
                     /* Optimization(Jan, 2001) */
-                    Integer stateObj = (Integer)stateTable.get(newSet);
-                    int stateIndex = (stateObj == null ? curState : stateObj.intValue());
+                    Integer stateObj = stateTable.get(newSet);
+                    int stateIndex = (stateObj == null ? curState : stateObj);
                     /* Optimization(Jan, 2001) */
 
                     // If we did not find it, then add it
@@ -1170,7 +1173,7 @@
      * @return       a list whose entries are instances of
      *               either XSWildcardDecl or XSElementDecl.
      */
-    public ArrayList whatCanGoHere(int[] state) {
+    public List<Object> whatCanGoHere(int[] state) {
         int curState = state[0];
         if (curState < 0)
             curState = state[1];
@@ -1178,7 +1181,9 @@
                 fCountingStates[curState] : null;
         int count = state[2];
 
-        ArrayList ret = new ArrayList();
+        // Can be XSElementDecl or XSWildcardDecl, but eventually the content is
+        // only used to evaluate toString
+        List<Object> ret = new ArrayList<>();
         for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
             int nextState = fTransTable[curState][elemIndex];
             if (nextState != -1) {
@@ -1217,8 +1222,8 @@
      * is associated with the error code that preceeds it in
      * the list.
      */
-    public ArrayList checkMinMaxBounds() {
-        ArrayList result = null;
+    public List<String> checkMinMaxBounds() {
+        List<String> result = null;
         for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
             int count = fElemMapCounter[elemIndex];
             if (count == -1) {
@@ -1227,12 +1232,12 @@
             final int minOccurs = fElemMapCounterLowerBound[elemIndex];
             final int maxOccurs = fElemMapCounterUpperBound[elemIndex];
             if (count < minOccurs) {
-                if (result == null) result = new ArrayList();
+                if (result == null) result = new ArrayList<>();
                 result.add("cvc-complex-type.2.4.b");
                 result.add("{" + fElemMap[elemIndex] + "}");
             }
             if (maxOccurs != -1 && count > maxOccurs) {
-                if (result == null) result = new ArrayList();
+                if (result == null) result = new ArrayList<>();
                 result.add("cvc-complex-type.2.4.d.1");
                 result.add("{" + fElemMap[elemIndex] + "}");
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,10 +22,11 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.models;
 
-import com.sun.org.apache.xerces.internal.xni.QName;
 import com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler;
 import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
+import com.sun.org.apache.xerces.internal.xni.QName;
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * XSEmptyCM is a derivative of the abstract content model base class that
@@ -46,7 +48,7 @@
     // start the content model: did not see any children
     private static final short STATE_START = 0;
 
-    private static final ArrayList EMPTY = new ArrayList(0);
+    private static final List<Object> EMPTY = new ArrayList<>(0);
 
     //
     // Data
@@ -128,11 +130,11 @@
      * @return       a list whose entries are instances of
      *               either XSWildcardDecl or XSElementDecl.
      */
-    public ArrayList whatCanGoHere(int[] state) {
+    public List<Object> whatCanGoHere(int[] state) {
         return EMPTY;
     }
 
-    public ArrayList checkMinMaxBounds() {
+    public List<String> checkMinMaxBounds() {
         return null;
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.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,14 +21,14 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.opti;
 
-import java.util.ArrayList;
-import java.util.Enumeration;
-
 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 import com.sun.org.apache.xerces.internal.xni.QName;
 import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
 import com.sun.org.apache.xerces.internal.xni.XMLString;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
 import org.w3c.dom.Attr;
 import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.Element;
@@ -366,7 +366,7 @@
         // for other namespaces so that we can also include them.
         // optimized for simplicity and the case that not many
         // namespaces are declared on this annotation...
-        ArrayList namespaces = new ArrayList();
+        List<String> namespaces = new ArrayList<>();
         for (int i = 0; i < attributes.getLength(); ++i) {
             String aValue = attributes.getValue(i);
             String aPrefix = attributes.getPrefix(i);
@@ -380,9 +380,9 @@
         }
         // now we have to look through currently in-scope namespaces to see what
         // wasn't declared here
-        Enumeration currPrefixes = namespaceContext.getAllPrefixes();
+        Enumeration<String> currPrefixes = namespaceContext.getAllPrefixes();
         while(currPrefixes.hasMoreElements()) {
-            String prefix = (String)currPrefixes.nextElement();
+            String prefix = currPrefixes.nextElement();
             String uri = namespaceContext.getURI(prefix);
             if (uri == null) {
                 uri = XMLSymbols.EMPTY_STRING;
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.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,20 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.traversers;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.EndElement;
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.ProcessingInstruction;
-import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.XMLEvent;
-
 import com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser;
 import com.sun.org.apache.xerces.internal.util.JAXPNamespaceContextWrapper;
 import com.sun.org.apache.xerces.internal.util.StAXLocationWrapper;
@@ -46,6 +32,19 @@
 import com.sun.org.apache.xerces.internal.xni.QName;
 import com.sun.org.apache.xerces.internal.xni.XMLString;
 import com.sun.org.apache.xerces.internal.xni.XNIException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.EndElement;
+import javax.xml.stream.events.Namespace;
+import javax.xml.stream.events.ProcessingInstruction;
+import javax.xml.stream.events.StartElement;
+import javax.xml.stream.events.XMLEvent;
 import org.w3c.dom.Document;
 
 /**
@@ -83,7 +82,7 @@
     private final QName fAttributeQName = new QName();
     private final XMLAttributesImpl fAttributes = new XMLAttributesImpl();
     private final XMLString fTempString = new XMLString();
-    private final ArrayList fDeclaredPrefixes = new ArrayList();
+    private final List<String> fDeclaredPrefixes = new ArrayList<>();
     private final XMLStringBuffer fStringBuffer = new XMLStringBuffer();
     private int fDepth;
 
@@ -314,9 +313,9 @@
 
     private void fillXMLAttributes(StartElement event) {
         fAttributes.removeAllAttributes();
-        final Iterator attrs = event.getAttributes();
+        final Iterator<Attribute> attrs = event.getAttributes();
         while (attrs.hasNext()) {
-            Attribute attr = (Attribute) attrs.next();
+            Attribute attr = attrs.next();
             fillQName(fAttributeQName, attr.getName());
             String type = attr.getDTDType();
             int idx = fAttributes.getLength();
@@ -346,9 +345,9 @@
         String nsPrefix = null;
         String nsURI = null;
 
-        final Iterator iter = fDeclaredPrefixes.iterator();
+        final Iterator<String> iter = fDeclaredPrefixes.iterator();
         while (iter.hasNext()) {
-            nsPrefix = (String) iter.next();
+            nsPrefix = iter.next();
             nsURI = fNamespaceContext.getURI(nsPrefix);
             if (nsPrefix.length() > 0) {
                 prefix = XMLSymbols.PREFIX_XMLNS;
@@ -381,10 +380,10 @@
     }
 
     /** Fills in the list of declared prefixes. */
-    private void fillDeclaredPrefixes(Iterator namespaces) {
+    private void fillDeclaredPrefixes(Iterator<Namespace> namespaces) {
         fDeclaredPrefixes.clear();
         while (namespaces.hasNext()) {
-            Namespace ns = (Namespace) namespaces.next();
+            Namespace ns = namespaces.next();
             String prefix = ns.getPrefix();
             fDeclaredPrefixes.add(prefix != null ? prefix : "");
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,11 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.traversers;
 
-import java.util.Iterator;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
 import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
 import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
 import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
@@ -42,7 +38,11 @@
 import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
 import com.sun.org.apache.xerces.internal.xni.QName;
 import com.sun.org.apache.xerces.internal.xs.XSConstants;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 
@@ -145,9 +145,9 @@
 
     // used to store the map from element name to attribute list
     // for 14 global elements
-    private static final Map fEleAttrsMapG = new HashMap(29);
+    private static final Map<String, Container> fEleAttrsMapG = new HashMap<>(29);
     // for 39 local elememnts
-    private static final Map fEleAttrsMapL = new HashMap(79);
+    private static final Map<String, Container> fEleAttrsMapL = new HashMap<>(79);
 
     // used to initialize fEleAttrsMap
     // step 1: all possible data types
@@ -926,10 +926,10 @@
     protected SymbolTable fSymbolTable = null;
 
     // used to store the mapping from processed element to attributes
-    protected Map fNonSchemaAttrs = new HashMap();
+    protected Map<String, List<String>> fNonSchemaAttrs = new HashMap<>();
 
     // temprory vector, used to hold the namespace list
-    protected Vector fNamespaceList = new Vector();
+    protected List<String> fNamespaceList = new ArrayList<>();
 
     // whether this attribute appeared in the current element
     protected boolean[] fSeen = new boolean[ATTIDX_COUNT];
@@ -974,6 +974,7 @@
      * @param enumAsQName  whether to tread enumeration value as QName
      * @return             an array containing attribute values
      */
+    @SuppressWarnings("unchecked")
     public Object[] checkAttributes(Element element, boolean isGlobal,
                                     XSDocumentInfo schemaDoc, boolean enumAsQName) {
         if (element == null)
@@ -992,7 +993,7 @@
             reportSchemaError("s4s-elt-schema-ns", new Object[] {elName}, element);
         }
 
-        Map eleAttrsMap = fEleAttrsMapG;
+        Map<String, Container> eleAttrsMap = fEleAttrsMapG;
         String lookupName = elName;
 
         // REVISIT: only local element and attribute are different from others.
@@ -1015,7 +1016,7 @@
         }
 
         // get desired attribute list of this element
-        Container attrList = (Container)eleAttrsMap.get(lookupName);
+        Container attrList = eleAttrsMap.get(lookupName);
         if (attrList == null) {
             // should never gets here.
             // when this method is called, the call already knows that
@@ -1066,29 +1067,33 @@
                     reportSchemaError ("s4s-att-not-allowed", new Object[] {elName, attrName}, element);
                 }
                 else {
+                    List<String> temp;
                     if(attrValues[ATTIDX_NONSCHEMA] == null) {
                         // these are usually small
-                        attrValues[ATTIDX_NONSCHEMA] = new Vector(4,2);
+                        temp = new ArrayList<>(4);
+                    } else {
+                        temp = (List<String>)attrValues[ATTIDX_NONSCHEMA];
                     }
-                    ((Vector)attrValues[ATTIDX_NONSCHEMA]).addElement(attrName);
-                    ((Vector)attrValues[ATTIDX_NONSCHEMA]).addElement(attrVal);
+                    temp.add(attrName);
+                    temp.add(attrVal);
+                    attrValues[ATTIDX_NONSCHEMA] = temp;
                     // for attributes from other namespace
                     // store them in a list, and TRY to validate them after
                     // schema traversal (because it's "lax")
                     //otherValues.put(attrName, attrVal);
                     // REVISIT:  actually use this some day...
                     // String attrRName = attrURI + "," + attrName;
-                    // Vector values = (Vector)fNonSchemaAttrs.get(attrRName);
+                    // List<String> values = (ArrayList<String>)fNonSchemaAttrs.get(attrRName);
                     // if (values == null) {
-                        // values = new Vector();
-                        // values.addElement(attrName);
-                        // values.addElement(elName);
-                        // values.addElement(attrVal);
+                        // values = new ArrayList<>();
+                        // values.add(attrName);
+                        // values.add(elName);
+                        // values.add(attrVal);
                         // fNonSchemaAttrs.put(attrRName, values);
                     // }
                     // else {
-                        // values.addElement(elName);
-                        // values.addElement(attrVal);
+                        // values.add(elName);
+                        // values.add(attrVal);
                     // }
                 }
                 continue;
@@ -1227,7 +1232,7 @@
 
         String value = XMLChar.trim(ivalue);
         Object retValue = null;
-        Vector memberType;
+        List<QName> memberType;
         int choice;
 
         switch (dvIndex) {
@@ -1286,7 +1291,9 @@
                         choice |= XSConstants.DERIVATION_SUBSTITUTION;
                     }
                     else {
-                        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(#all | List of (extension | restriction | substitution))"});
+                        throw new InvalidDatatypeValueException(
+                                "cvc-datatype-valid.1.2.3", new Object[]{value,
+                                    "(#all | List of (extension | restriction | substitution))"});
                     }
                 }
             }
@@ -1436,7 +1443,7 @@
             break;
         case DT_MEMBERTYPES:
             // memberTypes = List of QName
-            memberType = new Vector();
+            memberType = new ArrayList<>();
             try {
                 StringTokenizer t = new StringTokenizer(value, " \n\t\r");
                 while (t.hasMoreTokens()) {
@@ -1445,7 +1452,7 @@
                     // kludge to handle chameleon includes/redefines...
                     if(qname.prefix == XMLSymbols.EMPTY_STRING && qname.uri == null && schemaDoc.fIsChameleonSchema)
                         qname.uri = schemaDoc.fTargetNamespace;
-                    memberType.addElement(qname);
+                    memberType.add(qname);
                 }
                 retValue = memberType;
             }
@@ -1479,7 +1486,7 @@
                 // list
                 retValue = INT_ANY_LIST;
 
-                fNamespaceList.removeAllElements();
+                fNamespaceList.clear();
 
                 // tokenize
                 StringTokenizer tokens = new StringTokenizer(value, " \n\t\r");
@@ -1501,17 +1508,19 @@
 
                         //check for duplicate namespaces in the list
                         if (!fNamespaceList.contains(tempNamespace)) {
-                            fNamespaceList.addElement(tempNamespace);
+                            fNamespaceList.add(tempNamespace);
                         }
                     }
                 } catch (InvalidDatatypeValueException ide) {
-                    throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) )"});
+                    throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3",
+                            new Object[]{value,
+                                "((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) )"});
                 }
 
                 // convert the vector to an array
                 int num = fNamespaceList.size();
                 String[] list = new String[num];
-                fNamespaceList.copyInto(list);
+                list = fNamespaceList.toArray(list);
                 attrValues[ATTIDX_NAMESPACE_LIST] = list;
             }
             break;
@@ -1570,12 +1579,10 @@
     // REVISIT: pass the proper element node to reportSchemaError
     public void checkNonSchemaAttributes(XSGrammarBucket grammarBucket) {
         // for all attributes
-        Iterator entries = fNonSchemaAttrs.entrySet().iterator();
         XSAttributeDecl attrDecl;
-        while (entries.hasNext()) {
-            Map.Entry entry = (Map.Entry) entries.next();
+        for (Map.Entry<String, List<String>> entry : fNonSchemaAttrs.entrySet()) {
             // get name, uri, localpart
-            String attrRName = (String) entry.getKey();
+            String attrRName = entry.getKey();
             String attrURI = attrRName.substring(0,attrRName.indexOf(','));
             String attrLocal = attrRName.substring(attrRName.indexOf(',')+1);
             // find associated grammar
@@ -1594,18 +1601,18 @@
             }
 
             // get all values appeared with this attribute name
-            Vector values = (Vector) entry.getValue();
+            List<String> values = entry.getValue();
             String elName;
-            String attrName = (String)values.elementAt(0);
+            String attrName = values.get(0);
             // for each of the values
             int count = values.size();
             for (int i = 1; i < count; i += 2) {
-                elName = (String)values.elementAt(i);
+                elName = (String)values.get(i);
                 try {
                     // and validate it using the XSSimpleType
                     // REVISIT: what would be the proper validation context?
                     //          guess we need to save that in the vectors too.
-                    dv.validate((String)values.elementAt(i+1), null, null);
+                    dv.validate(values.get(i+1), null, null);
                 } catch(InvalidDatatypeValueException ide) {
                     reportSchemaError ("s4s-att-invalid-value",
                                        new Object[] {elName, attrName, ide.getMessage()},
@@ -1621,7 +1628,7 @@
         if (len == 0 || ws == XSSimpleType.WS_PRESERVE)
             return content;
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (ws == XSSimpleType.WS_REPLACE) {
             char ch;
             // when it's replace, just replace #x9, #xa, #xd by #x20
@@ -1703,6 +1710,7 @@
     }
 
     // return an array back to the pool
+    @SuppressWarnings("unchecked")
     public void returnAttrArray(Object[] attrArray, XSDocumentInfo schemaDoc) {
         // pop the namespace context
         if (schemaDoc != null)
@@ -1714,7 +1722,7 @@
         if (fPoolPos == 0 ||
             attrArray == null ||
             attrArray.length != ATTIDX_COUNT ||
-            ((Boolean)attrArray[ATTIDX_ISRETURNED]).booleanValue()) {
+                ((Boolean)attrArray[ATTIDX_ISRETURNED])) {
             return;
         }
 
@@ -1722,7 +1730,7 @@
         attrArray[ATTIDX_ISRETURNED] = Boolean.TRUE;
         // better clear nonschema vector
         if(attrArray[ATTIDX_NONSCHEMA] != null)
-            ((Vector)attrArray[ATTIDX_NONSCHEMA]).clear();
+            ((List<String>)attrArray[ATTIDX_NONSCHEMA]).clear();
         // and put it into the pool
         fArrayPool[--fPoolPos] = attrArray;
     }
@@ -1806,9 +1814,9 @@
 }
 
 class LargeContainer extends Container {
-    Map items;
+    Map<String, OneAttr> items;
     LargeContainer(int size) {
-        items = new HashMap(size*2+1);
+        items = new HashMap<>(size*2+1);
         values = new OneAttr[size];
     }
     void put(String key, OneAttr value) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.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,9 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.traversers;
 
-import java.util.Locale;
-import java.util.Vector;
-
 import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
 import com.sun.org.apache.xerces.internal.impl.dv.XSFacets;
 import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
@@ -42,10 +39,14 @@
 import com.sun.org.apache.xerces.internal.util.DOMUtil;
 import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
+import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 import com.sun.org.apache.xerces.internal.xni.QName;
 import com.sun.org.apache.xerces.internal.xs.XSAttributeUse;
 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
 import org.w3c.dom.Element;
 
 /**
@@ -142,15 +143,16 @@
         // find the grammar; fSchemaHandler must be known!
         SchemaGrammar grammar = fSchemaHandler.getGrammar(schemaDoc.fTargetNamespace);
         // fish out local attributes passed from parent
-        Vector annotationLocalAttrs = (Vector)parentAttrs[XSAttributeChecker.ATTIDX_NONSCHEMA];
+        @SuppressWarnings("unchecked")
+        List<String> annotationLocalAttrs = (ArrayList<String>)parentAttrs[XSAttributeChecker.ATTIDX_NONSCHEMA];
         // optimize for case where there are no local attributes
         if(annotationLocalAttrs != null && !annotationLocalAttrs.isEmpty()) {
-            StringBuffer localStrBuffer = new StringBuffer(64);
+            StringBuilder localStrBuffer = new StringBuilder(64);
             localStrBuffer.append(" ");
-            // Vector should contain rawname value pairs
+            //ArrayList<>should contain rawname value pairs
             int i = 0;
             while (i < annotationLocalAttrs.size()) {
-                String rawname = (String)annotationLocalAttrs.elementAt(i++);
+                String rawname = annotationLocalAttrs.get(i++);
                 int colonIndex = rawname.indexOf(':');
                 String prefix, localpart;
                 if (colonIndex == -1) {
@@ -168,14 +170,14 @@
                 }
                 localStrBuffer.append(rawname)
                 .append("=\"");
-                String value = (String)annotationLocalAttrs.elementAt(i++);
+                String value = annotationLocalAttrs.get(i++);
                 // search for pesky "s and <s within attr value:
                 value = processAttValue(value);
                 localStrBuffer.append(value)
                 .append("\" ");
             }
             // and now splice it into place; immediately after the annotation token, for simplicity's sake
-            StringBuffer contentBuffer = new StringBuffer(contents.length() + localStrBuffer.length());
+            StringBuilder contentBuffer = new StringBuilder(contents.length() + localStrBuffer.length());
             int annotationTokenEnd = contents.indexOf(SchemaSymbols.ELT_ANNOTATION);
             // annotation must occur somewhere or we're in big trouble...
             if(annotationTokenEnd == -1) return null;
@@ -205,15 +207,16 @@
         // find the grammar; fSchemaHandler must be known!
         SchemaGrammar grammar = fSchemaHandler.getGrammar(schemaDoc.fTargetNamespace);
         // fish out local attributes passed from parent
-        Vector annotationLocalAttrs = (Vector)parentAttrs[XSAttributeChecker.ATTIDX_NONSCHEMA];
+        @SuppressWarnings("unchecked")
+        List<String> annotationLocalAttrs = (ArrayList<String>)parentAttrs[XSAttributeChecker.ATTIDX_NONSCHEMA];
         // optimize for case where there are no local attributes
         if (annotationLocalAttrs != null && !annotationLocalAttrs.isEmpty()) {
-            StringBuffer localStrBuffer = new StringBuffer(64);
+            StringBuilder localStrBuffer = new StringBuilder(64);
             localStrBuffer.append(" ");
-            // Vector should contain rawname value pairs
+            //ArrayList<>should contain rawname value pairs
             int i = 0;
             while (i < annotationLocalAttrs.size()) {
-                String rawname = (String)annotationLocalAttrs.elementAt(i++);
+                String rawname = annotationLocalAttrs.get(i++);
                 int colonIndex = rawname.indexOf(':');
                 String prefix, localpart;
                 if (colonIndex == -1) {
@@ -227,14 +230,14 @@
                 String uri = schemaDoc.fNamespaceSupport.getURI(fSymbolTable.addSymbol(prefix));
                 localStrBuffer.append(rawname)
                 .append("=\"");
-                String value = (String)annotationLocalAttrs.elementAt(i++);
+                String value = annotationLocalAttrs.get(i++);
                 // search for pesky "s and <s within attr value:
                 value = processAttValue(value);
                 localStrBuffer.append(value)
                 .append("\" ");
             }
             // and now splice it into place; immediately after the annotation token, for simplicity's sake
-            StringBuffer contentBuffer = new StringBuffer(contents.length() + localStrBuffer.length());
+            StringBuilder contentBuffer = new StringBuilder(contents.length() + localStrBuffer.length());
             int annotationTokenEnd = contents.indexOf(SchemaSymbols.ELT_ANNOTATION);
             // annotation must occur somewhere or we're in big trouble...
             if(annotationTokenEnd == -1) return null;
@@ -258,7 +261,7 @@
     // the QName simple type used to resolve qnames
     private static final XSSimpleType fQNameDV = (XSSimpleType)SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(SchemaSymbols.ATTVAL_QNAME);
     // Temp data structures to be re-used in traversing facets
-    private StringBuffer fPattern = new StringBuffer();
+    private StringBuilder fPattern = new StringBuilder();
     private final XSFacets xsFacets = new XSFacets();
 
     static final class FacetInfo {
@@ -284,10 +287,10 @@
         short facetsFixed = 0; // facets that have fixed="true"
         String facet;
         boolean hasQName = containsQName(baseValidator);
-        Vector enumData = null;
+        List<String> enumData = null;
         XSObjectListImpl enumAnnotations = null;
         XSObjectListImpl patternAnnotations = null;
-        Vector enumNSDecls = hasQName ? new Vector() : null;
+        List<NamespaceContext> enumNSDecls = hasQName ? new ArrayList<>() : null;
         int currentFacet = 0;
         xsFacets.reset();
         while (content != null) {
@@ -335,13 +338,13 @@
                     schemaDoc.fValidationContext.setNamespaceSupport(schemaDoc.fNamespaceSupport);
                 }
                 if (enumData == null){
-                    enumData = new Vector();
+                    enumData = new ArrayList<>();
                     enumAnnotations = new XSObjectListImpl();
                 }
-                enumData.addElement(enumVal);
+                enumData.add(enumVal);
                 enumAnnotations.addXSObject(null);
                 if (hasQName)
-                    enumNSDecls.addElement(nsDecls);
+                    enumNSDecls.add(nsDecls);
                 Element child = DOMUtil.getFirstChildElement( content );
 
                 if (child != null &&
@@ -819,7 +822,7 @@
     private static String escapeAttValue(String original, int from) {
         int i;
         final int length = original.length();
-        StringBuffer newVal = new StringBuffer(length);
+        StringBuilder newVal = new StringBuilder(length);
         newVal.append(original.substring(0, from));
         for (i = from; i < length; ++i) {
             char currChar = original.charAt(i);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -97,10 +97,10 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Stack;
-import java.util.Vector;
 import javax.xml.XMLConstants;
 import javax.xml.catalog.CatalogFeatures;
 import javax.xml.stream.XMLEventReader;
@@ -283,7 +283,7 @@
 
     // Stores XSDocumentInfo (keyed by component name), to check for duplicate
     // components declared within the same xsd document
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({"rawtypes", "unchecked"})
     private Map<String, XSDocumentInfo> fUnparsedRegistriesExt[] = new HashMap[] {
         null,
         null, // ATTRIBUTE_TYPE
@@ -298,18 +298,18 @@
     // this map is keyed on by XSDocumentInfo objects.  Its values
     // are Vectors containing the XSDocumentInfo objects <include>d,
     // <import>ed or <redefine>d by the key XSDocumentInfo.
-    private Map<XSDocumentInfo, Vector<XSDocumentInfo>> fDependencyMap = new HashMap<>();
+    private Map<XSDocumentInfo, List<XSDocumentInfo>> fDependencyMap = new HashMap<>();
 
     // this map is keyed on by a target namespace.  Its values
     // are Vectors containing namespaces imported by schema documents
     // with the key target namespace.
     // if an imported schema has absent namespace, the value "null" is stored.
-    private Map<String, Vector> fImportMap = new HashMap<> ();
+    private Map<String, List<String>> fImportMap = new HashMap<> ();
 
     // all namespaces that imports other namespaces
     // if the importing schema has absent namespace, empty string is stored.
     // (because the key of a map can't be null.)
-    private Vector<String> fAllTNSs = new Vector<>();
+    private List<String> fAllTNSs = new ArrayList<>();
 
     // stores instance document mappings between namespaces and schema hints
     private Map<String, XMLSchemaLoader.LocationArray> fLocationPairs = null;
@@ -356,18 +356,18 @@
 
     // map between <redefine> elements and the XSDocumentInfo
     // objects that correspond to the documents being redefined.
-    private Map fRedefine2XSDMap = null;
+    private Map<Element, XSDocumentInfo> fRedefine2XSDMap = null;
 
     // map between <redefine> elements and the namespace support
-    private Map fRedefine2NSSupport = null;
+    private Map<Element, SchemaNamespaceSupport> fRedefine2NSSupport = null;
 
     // these objects store a mapping between the names of redefining
     // groups/attributeGroups and the groups/AttributeGroups which
     // they redefine by restriction (implicitly).  It is up to the
     // Group and AttributeGroup traversers to check these restrictions for
     // validity.
-    private Map fRedefinedRestrictedAttributeGroupRegistry = new HashMap();
-    private Map fRedefinedRestrictedGroupRegistry = new HashMap();
+    private final Map<String, String> fRedefinedRestrictedAttributeGroupRegistry = new HashMap<>();
+    private final Map<String, String> fRedefinedRestrictedGroupRegistry = new HashMap<>();
 
     // a variable storing whether the last schema document
     // processed (by getSchema) was a duplicate.
@@ -639,7 +639,7 @@
         buildGlobalNameRegistries();
 
         // third phase:  call traversers
-        ArrayList annotationInfo = fValidateAnnotations ? new ArrayList() : null;
+        List<Object> annotationInfo = fValidateAnnotations ? new ArrayList<>() : null;
         traverseSchemas(annotationInfo);
 
         // fourth phase: handle local element decls
@@ -656,9 +656,10 @@
         // for all grammars with <import>s
         for (int i = fAllTNSs.size() - 1; i >= 0; i--) {
             // get its target namespace
-            String tns = fAllTNSs.elementAt(i);
+            String tns = fAllTNSs.get(i);
             // get all namespaces it imports
-            Vector ins = (Vector)fImportMap.get(tns);
+            List<String> ins = fImportMap.get(tns);
+            List<SchemaGrammar> grammars = new ArrayList<>();
             // get the grammar
             SchemaGrammar sg = fGrammarBucket.getGrammar(emptyString2Null(tns));
             if (sg == null)
@@ -668,14 +669,14 @@
             int count = 0;
             for (int j = 0; j < ins.size(); j++) {
                 // get imported grammar
-                isg = fGrammarBucket.getGrammar((String)ins.elementAt(j));
+                isg = fGrammarBucket.getGrammar(ins.get(j));
                 // reuse the same vector
-                if (isg != null)
-                    ins.setElementAt(isg, count++);
+                if (isg != null) {
+                    grammars.add(isg);
+                }
             }
-            ins.setSize(count);
             // set the imported grammars
-            sg.setImportedGrammars(ins);
+            sg.setImportedGrammars(grammars);
         }
 
         /** validate annotations **/
@@ -687,7 +688,7 @@
         return fGrammarBucket.getGrammar(fRoot.fTargetNamespace);
     } // end parseSchema
 
-    private void validateAnnotations(ArrayList annotationInfo) {
+    private void validateAnnotations(List<Object> annotationInfo) {
         if (fAnnotationValidator == null) {
             createAnnotationValidator();
         }
@@ -909,7 +910,7 @@
         sg.addDocument(null, fDoc2SystemId.get(currSchemaInfo.fSchemaElement));
 
         fDoc2XSDocumentMap.put(schemaRoot, currSchemaInfo);
-        Vector<XSDocumentInfo> dependencies = new Vector<>();
+        List<XSDocumentInfo> dependencies = new ArrayList<>();
         Element rootNode = schemaRoot;
 
         Element newSchemaRoot = null;
@@ -978,17 +979,17 @@
                 // convert null to ""
                 String tns = null2EmptyString(currSchemaInfo.fTargetNamespace);
                 // get all namespaces imported by this one
-                Vector ins = (Vector)fImportMap.get(tns);
-                // if no namespace was imported, create new Vector
+               List<String> ins = fImportMap.get(tns);
+                // if no namespace was imported, create new ArrayList<>
                 if (ins == null) {
                     // record that this one imports other(s)
-                    fAllTNSs.addElement(tns);
-                    ins = new Vector();
+                    fAllTNSs.add(tns);
+                    ins = new ArrayList<>();
                     fImportMap.put(tns, ins);
-                    ins.addElement(schemaNamespace);
+                    ins.add(schemaNamespace);
                 }
                 else if (!ins.contains(schemaNamespace)){
-                    ins.addElement(schemaNamespace);
+                    ins.add(schemaNamespace);
                 }
 
                 fSchemaGrammarDescription.reset();
@@ -1037,7 +1038,7 @@
                 schemaHint = (String)includeAttrs[XSAttributeChecker.ATTIDX_SCHEMALOCATION];
                 // store the namespace decls of the redefine element
                 if (localName.equals(SchemaSymbols.ELT_REDEFINE)) {
-                    if (fRedefine2NSSupport == null) fRedefine2NSSupport = new HashMap();
+                    if (fRedefine2NSSupport == null) fRedefine2NSSupport = new HashMap<>();
                     fRedefine2NSSupport.put(child, new SchemaNamespaceSupport(currSchemaInfo.fNamespaceSupport));
                 }
 
@@ -1052,10 +1053,13 @@
                             sg.addAnnotation(
                                     fElementTraverser.traverseAnnotationDecl(includeChild, includeAttrs, true, currSchemaInfo));
                         } else {
-                            reportSchemaError("s4s-elt-must-match.1", new Object [] {localName, "annotation?", includeComponentType}, child);
+                            reportSchemaError("s4s-elt-must-match.1",
+                                    new Object [] {localName, "annotation?", includeComponentType}, child);
                         }
                         if(DOMUtil.getNextSiblingElement(includeChild) != null) {
-                            reportSchemaError("s4s-elt-must-match.1", new Object [] {localName, "annotation?", DOMUtil.getLocalName(DOMUtil.getNextSiblingElement(includeChild))}, child);
+                            reportSchemaError("s4s-elt-must-match.1",
+                                    new Object [] {localName, "annotation?",
+                                        DOMUtil.getLocalName(DOMUtil.getNextSiblingElement(includeChild))}, child);
                         }
                     }
                     else {
@@ -1148,12 +1152,12 @@
                     newSchemaInfo != null) {
                 // must record which schema we're redefining so that we can
                 // rename the right things later!
-                if (fRedefine2XSDMap == null) fRedefine2XSDMap = new HashMap();
+                if (fRedefine2XSDMap == null) fRedefine2XSDMap = new HashMap<>();
                 fRedefine2XSDMap.put(child, newSchemaInfo);
             }
             if (newSchemaRoot != null) {
                 if (newSchemaInfo != null)
-                    dependencies.addElement(newSchemaInfo);
+                    dependencies.add(newSchemaInfo);
                 newSchemaRoot = null;
             }
         }
@@ -1189,10 +1193,10 @@
      * newer version.
      */
     private void updateImportListFor(SchemaGrammar grammar) {
-        Vector importedGrammars = grammar.getImportedGrammars();
+       List<SchemaGrammar> importedGrammars = grammar.getImportedGrammars();
         if (importedGrammars != null) {
             for (int i=0; i<importedGrammars.size(); i++) {
-                SchemaGrammar isg1 = (SchemaGrammar) importedGrammars.elementAt(i);
+                SchemaGrammar isg1 = importedGrammars.get(i);
                 SchemaGrammar isg2 = fGrammarBucket.getGrammar(isg1.getTargetNamespace());
                 if (isg2 != null && isg1 != isg2) {
                     importedGrammars.set(i, isg2);
@@ -1215,11 +1219,12 @@
         for (int i = 0; i < schemaGrammars.length; ++i) {
             SchemaGrammar sg = schemaGrammars[i];
             if (sg != newGrammar) {
-                Vector importedGrammars = sg.getImportedGrammars();
+                List<SchemaGrammar> importedGrammars = sg.getImportedGrammars();
                 if (importedGrammars != null) {
                     for (int j=0; j<importedGrammars.size(); j++) {
-                        SchemaGrammar isg = (SchemaGrammar) importedGrammars.elementAt(j);
-                        if (null2EmptyString(isg.getTargetNamespace()).equals(null2EmptyString(newGrammar.getTargetNamespace()))) {
+                        SchemaGrammar isg = importedGrammars.get(j);
+                        if (null2EmptyString(isg.getTargetNamespace()).equals(
+                                null2EmptyString(newGrammar.getTargetNamespace()))) {
                             if (isg != newGrammar) {
                                 importedGrammars.set(j, newGrammar);
                             }
@@ -1249,12 +1254,11 @@
         // stack of schemas that we haven't yet finished processing; this
         // is a depth-first traversal.
 
-        Stack schemasToProcess = new Stack();
+        Stack<XSDocumentInfo> schemasToProcess = new Stack<>();
         schemasToProcess.push(fRoot);
 
         while (!schemasToProcess.empty()) {
-            XSDocumentInfo currSchemaDoc =
-                (XSDocumentInfo)schemasToProcess.pop();
+            XSDocumentInfo currSchemaDoc = schemasToProcess.pop();
             Element currDoc = currSchemaDoc.fSchemaElement;
             if(DOMUtil.isHidden(currDoc, fHiddenNodes)){
                 // must have processed this already!
@@ -1365,9 +1369,9 @@
             // now we're done with this one!
             DOMUtil.setHidden(currDoc, fHiddenNodes);
             // now add the schemas this guy depends on
-            Vector<XSDocumentInfo> currSchemaDepends = fDependencyMap.get(currSchemaDoc);
-            for (int i = 0; i < currSchemaDepends.size(); i++) {
-                schemasToProcess.push(currSchemaDepends.elementAt(i));
+            List<XSDocumentInfo> currSchemaDepends = fDependencyMap.get(currSchemaDoc);
+            for (XSDocumentInfo currSchemaDepend : currSchemaDepends) {
+                schemasToProcess.push(currSchemaDepend);
             }
         } // while
 
@@ -1384,17 +1388,16 @@
     // as traversed (or hidden) in order to avoid infinite loops.  It completes
     // when it has visited all XSDocumentInfo objects in the
     // DependencyMap and marked them as traversed.
-    protected void traverseSchemas(ArrayList annotationInfo) {
+    protected void traverseSchemas(List<Object> annotationInfo) {
         // the process here is very similar to that in
         // buildGlobalRegistries, except we can't set our schemas as
         // hidden for a second time; so make them all visible again
         // first!
         setSchemasVisible(fRoot);
-        Stack schemasToProcess = new Stack();
+        Stack<XSDocumentInfo> schemasToProcess = new Stack<>();
         schemasToProcess.push(fRoot);
         while (!schemasToProcess.empty()) {
-            XSDocumentInfo currSchemaDoc =
-                (XSDocumentInfo)schemasToProcess.pop();
+            XSDocumentInfo currSchemaDoc = schemasToProcess.pop();
             Element currDoc = currSchemaDoc.fSchemaElement;
 
             SchemaGrammar currSG = fGrammarBucket.getGrammar(currSchemaDoc.fTargetNamespace);
@@ -1415,7 +1418,8 @@
                 // includes and imports will not show up here!
                 if (DOMUtil.getLocalName(globalComp).equals(SchemaSymbols.ELT_REDEFINE)) {
                     // use the namespace decls for the redefine, instead of for the parent <schema>
-                    currSchemaDoc.backupNSSupport((fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(globalComp):null);
+                    currSchemaDoc.backupNSSupport((fRedefine2NSSupport!=null) ?
+                            fRedefine2NSSupport.get(globalComp) : null);
                     for (Element redefinedComp = DOMUtil.getFirstVisibleChildElement(globalComp, fHiddenNodes);
                     redefinedComp != null;
                     redefinedComp = DOMUtil.getNextVisibleSiblingElement(redefinedComp, fHiddenNodes)) {
@@ -1495,25 +1499,25 @@
             DOMUtil.setHidden(currDoc, fHiddenNodes);
 
             // now add the schemas this guy depends on
-            Vector<XSDocumentInfo> currSchemaDepends = fDependencyMap.get(currSchemaDoc);
-            for (int i = 0; i < currSchemaDepends.size(); i++) {
-                schemasToProcess.push(currSchemaDepends.elementAt(i));
+            List<XSDocumentInfo> currSchemaDepends = fDependencyMap.get(currSchemaDoc);
+            for (XSDocumentInfo currSchemaDepend : currSchemaDepends) {
+                schemasToProcess.push(currSchemaDepend);
             }
         } // while
     } // end traverseSchemas
 
     // store whether we have reported an error about that no grammar
     // is found for the given namespace uri
-    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.
     private 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;
     }
 
@@ -1892,7 +1896,8 @@
         return retObj;
     }
 
-    protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
+    protected Object traverseGlobalDecl(int declType, Element decl,
+            XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
         Object retObj = null;
 
         DOMUtil.setHidden(decl, fHiddenNodes);
@@ -1900,7 +1905,7 @@
         // if the parent is <redefine> use the namespace delcs for it.
         Element parent = DOMUtil.getParent(decl);
         if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
-            nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
+            nsSupport = (fRedefine2NSSupport!=null) ? fRedefine2NSSupport.get(parent) : null;
         // back up the current SchemaNamespaceSupport, because we need to provide
         // a fresh one to the traverseGlobal methods.
         schemaDoc.backupNSSupport(nsSupport);
@@ -1962,10 +1967,10 @@
         String nameToFind = null;
         switch (type) {
         case ATTRIBUTEGROUP_TYPE:
-            nameToFind = (String)fRedefinedRestrictedAttributeGroupRegistry.get(realName);
+            nameToFind = fRedefinedRestrictedAttributeGroupRegistry.get(realName);
             break;
         case GROUP_TYPE:
-            nameToFind = (String)fRedefinedRestrictedGroupRegistry.get(realName);
+            nameToFind = fRedefinedRestrictedGroupRegistry.get(realName);
             break;
         default:
             return null;
@@ -2013,11 +2018,11 @@
 
     // an accessor method.  Just makes sure callers
     // who want the Identity constraint registry vaguely know what they're about.
-    protected Map getIDRegistry() {
+    protected Map<String, Element> getIDRegistry() {
         return fUnparsedIdentityConstraintRegistry;
     }
     // an accessor method.
-    protected Map getIDRegistry_sub() {
+    protected Map<String, XSDocumentInfo> getIDRegistry_sub() {
         return fUnparsedIdentityConstraintRegistrySub;
     }
 
@@ -2535,7 +2540,7 @@
         short referType = desc.getContextType();
 
         if (grammars != null && grammars.length > 0) {
-            Vector expandedGrammars = expandGrammars(grammars);
+           List<SchemaGrammar> expandedGrammars = expandGrammars(grammars);
             // check for existing grammars in our bucket
             // and if there exist any, and namespace growth is
             // not enabled - we do nothing
@@ -2549,8 +2554,8 @@
         else {
             XSObject[] components = schemaSource.getComponents();
             if (components != null && components.length > 0) {
-                Map<String, Vector> importDependencies = new HashMap();
-                Vector expandedComponents = expandComponents(components, importDependencies);
+                Map<String, List<String>> importDependencies = new HashMap<>();
+                List<XSObject> expandedComponents = expandComponents(components, importDependencies);
                 if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                     addGlobalComponents(expandedComponents, importDependencies);
                     if (referType == XSDDescription.CONTEXT_PREPARSE) {
@@ -2562,8 +2567,8 @@
         return null;
     } // getSchemaDocument(String, XSInputSource, boolean, short, Element): Element
 
-    private Vector expandGrammars(SchemaGrammar[] grammars) {
-        Vector currGrammars = new Vector();
+    private List<SchemaGrammar> expandGrammars(SchemaGrammar[] grammars) {
+        List<SchemaGrammar> currGrammars = new ArrayList<>();
 
         for (int i=0; i<grammars.length; i++) {
             if (!currGrammars.contains(grammars[i])) {
@@ -2573,10 +2578,10 @@
 
         // for all (recursively) imported grammars
         SchemaGrammar sg1, sg2;
-        Vector gs;
+        List<SchemaGrammar> gs;
         for (int i = 0; i < currGrammars.size(); i++) {
             // get the grammar
-            sg1 = (SchemaGrammar)currGrammars.elementAt(i);
+            sg1 = (SchemaGrammar)currGrammars.get(i);
             // we need to add grammars imported by sg1 too
             gs = sg1.getImportedGrammars();
             // for all grammars imported by sg2, but not in the vector
@@ -2586,9 +2591,9 @@
             }
 
             for (int j = gs.size() - 1; j >= 0; j--) {
-                sg2 = (SchemaGrammar)gs.elementAt(j);
+                sg2 = (SchemaGrammar)gs.get(j);
                 if (!currGrammars.contains(sg2)) {
-                    currGrammars.addElement(sg2);
+                    currGrammars.add(sg2);
                 }
             }
         }
@@ -2596,12 +2601,12 @@
         return currGrammars;
     }
 
-    private boolean existingGrammars(Vector grammars) {
+    private boolean existingGrammars(List<SchemaGrammar> grammars) {
         int length = grammars.size();
         final XSDDescription desc = new XSDDescription();
 
         for (int i=0; i < length; i++) {
-            final SchemaGrammar sg1 = (SchemaGrammar)grammars.elementAt(i);
+            final SchemaGrammar sg1 = (SchemaGrammar)grammars.get(i);
             desc.setNamespace(sg1.getTargetNamespace());
 
             final SchemaGrammar sg2 = findGrammar(desc, false);
@@ -2613,11 +2618,11 @@
         return false;
     }
 
-    private boolean canAddComponents(Vector components) {
+    private boolean canAddComponents(List<XSObject> components) {
         final int size = components.size();
         final XSDDescription desc = new XSDDescription();
         for (int i=0; i<size; i++) {
-            XSObject component = (XSObject) components.elementAt(i);
+            XSObject component = (XSObject) components.get(i);
             if (!canAddComponent(component, desc)) {
                 return false;
             }
@@ -2678,12 +2683,12 @@
         return false;
     }
 
-    private void addGrammars(Vector grammars) {
+    private void addGrammars(List<SchemaGrammar> grammars) {
         int length = grammars.size();
         XSDDescription desc = new XSDDescription();
 
         for (int i=0; i < length; i++) {
-            final SchemaGrammar sg1 = (SchemaGrammar)grammars.elementAt(i);
+            final SchemaGrammar sg1 = grammars.get(i);
             desc.setNamespace(sg1.getTargetNamespace());
 
             final SchemaGrammar sg2 = findGrammar(desc, fNamespaceGrowth);
@@ -2737,13 +2742,14 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     private void addNewImportedGrammars(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
-        final Vector igs1 = srcGrammar.getImportedGrammars();
+        final ArrayList<SchemaGrammar> igs1 = (ArrayList<SchemaGrammar>)srcGrammar.getImportedGrammars();
         if (igs1 != null) {
-            Vector igs2 = dstGrammar.getImportedGrammars();
+           ArrayList<SchemaGrammar> igs2 = (ArrayList<SchemaGrammar>)dstGrammar.getImportedGrammars();
 
             if (igs2 == null) {
-                igs2 = ((Vector) igs1.clone());
+                igs2 = (ArrayList<SchemaGrammar>)igs1.clone();
                 dstGrammar.setImportedGrammars(igs2);
             }
             else {
@@ -2752,12 +2758,12 @@
         }
     }
 
-    private void updateImportList(Vector importedSrc, Vector importedDst)
+    private void updateImportList(List<SchemaGrammar> importedSrc, List<SchemaGrammar> importedDst)
     {
         final int size = importedSrc.size();
 
         for (int i=0; i<size; i++) {
-            final SchemaGrammar sg = (SchemaGrammar) importedSrc.elementAt(i);
+            final SchemaGrammar sg = (SchemaGrammar) importedSrc.get(i);
             if (!containedImportedGrammar(importedDst, sg)) {
                 importedDst.add(sg);
             }
@@ -3002,8 +3008,8 @@
         }
     }
 
-    private Vector expandComponents(XSObject[] components, Map<String, Vector> dependencies) {
-        Vector newComponents = new Vector();
+    private List<XSObject> expandComponents(XSObject[] components, Map<String, List<String>> dependencies) {
+        List<XSObject> newComponents = new ArrayList<>();
 
         for (int i=0; i<components.length; i++) {
             if (!newComponents.contains(components[i])) {
@@ -3012,14 +3018,14 @@
         }
 
         for (int i=0; i<newComponents.size(); i++) {
-            final XSObject component = (XSObject) newComponents.elementAt(i);
+            final XSObject component = newComponents.get(i);
             expandRelatedComponents(component, newComponents, dependencies);
         }
 
         return newComponents;
     }
 
-    private void expandRelatedComponents(XSObject component, Vector componentList, Map<String, Vector> dependencies) {
+    private void expandRelatedComponents(XSObject component,List<XSObject>componentList, Map<String, List<String>> dependencies) {
         short componentType = component.getType();
         switch (componentType) {
         case XSConstants.TYPE_DEFINITION :
@@ -3044,7 +3050,7 @@
         }
     }
 
-    private void expandRelatedAttributeComponents(XSAttributeDeclaration decl, Vector componentList, String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedAttributeComponents(XSAttributeDeclaration decl, List<XSObject> componentList, String namespace, Map<String, List<String>> dependencies) {
         addRelatedType(decl.getTypeDefinition(), componentList, namespace, dependencies);
 
         /*final XSComplexTypeDefinition enclosingType = decl.getEnclosingCTDefinition();
@@ -3053,7 +3059,7 @@
         }*/
     }
 
-    private void expandRelatedElementComponents(XSElementDeclaration decl, Vector componentList, String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedElementComponents(XSElementDeclaration decl, List<XSObject> componentList, String namespace, Map<String, List<String>> dependencies) {
         addRelatedType(decl.getTypeDefinition(), componentList, namespace, dependencies);
 
         /*final XSTypeDefinition enclosingType = decl.getEnclosingCTDefinition();
@@ -3067,7 +3073,7 @@
         }
     }
 
-    private void expandRelatedTypeComponents(XSTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedTypeComponents(XSTypeDefinition type, List<XSObject> componentList, String namespace, Map<String, List<String>> dependencies) {
         if (type instanceof XSComplexTypeDecl) {
             expandRelatedComplexTypeComponents((XSComplexTypeDecl) type, componentList, namespace, dependencies);
         }
@@ -3076,17 +3082,17 @@
         }
     }
 
-    private void expandRelatedModelGroupDefinitionComponents(XSModelGroupDefinition modelGroupDef, Vector componentList,
-            String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedModelGroupDefinitionComponents(XSModelGroupDefinition modelGroupDef, List<XSObject>componentList,
+            String namespace, Map<String, List<String>> dependencies) {
         expandRelatedModelGroupComponents(modelGroupDef.getModelGroup(), componentList, namespace, dependencies);
     }
 
-    private void expandRelatedAttributeGroupComponents(XSAttributeGroupDefinition attrGroup, Vector componentList
-            , String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedAttributeGroupComponents(XSAttributeGroupDefinition attrGroup, List<XSObject> componentList
+            , String namespace, Map<String, List<String>> dependencies) {
         expandRelatedAttributeUsesComponents(attrGroup.getAttributeUses(), componentList, namespace, dependencies);
     }
 
-    private void expandRelatedComplexTypeComponents(XSComplexTypeDecl type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedComplexTypeComponents(XSComplexTypeDecl type, List<XSObject> componentList, String namespace, Map<String, List<String>> dependencies) {
         addRelatedType(type.getBaseType(), componentList, namespace, dependencies);
         expandRelatedAttributeUsesComponents(type.getAttributeUses(), componentList, namespace, dependencies);
         final XSParticle particle = type.getParticle();
@@ -3095,7 +3101,7 @@
         }
     }
 
-    private void expandRelatedSimpleTypeComponents(XSSimpleTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedSimpleTypeComponents(XSSimpleTypeDefinition type, List<XSObject> componentList, String namespace, Map<String, List<String>> dependencies) {
         final XSTypeDefinition baseType = type.getBaseType();
         if (baseType != null) {
             addRelatedType(baseType, componentList, namespace, dependencies);
@@ -3119,21 +3125,21 @@
         }
     }
 
-    private void expandRelatedAttributeUsesComponents(XSObjectList attrUses, Vector componentList,
-            String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedAttributeUsesComponents(XSObjectList attrUses, List<XSObject> componentList,
+            String namespace, Map<String, List<String>> dependencies) {
         final int attrUseSize = (attrUses == null) ? 0 : attrUses.size();
         for (int i=0; i<attrUseSize; i++) {
             expandRelatedAttributeUseComponents((XSAttributeUse)attrUses.item(i), componentList, namespace, dependencies);
         }
     }
 
-    private void expandRelatedAttributeUseComponents(XSAttributeUse component, Vector componentList,
-            String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedAttributeUseComponents(XSAttributeUse component, List<XSObject> componentList,
+            String namespace, Map<String, List<String>> dependencies) {
         addRelatedAttribute(component.getAttrDeclaration(), componentList, namespace, dependencies);
     }
 
-    private void expandRelatedParticleComponents(XSParticle component, Vector componentList,
-            String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedParticleComponents(XSParticle component, List<XSObject> componentList,
+            String namespace, Map<String, List<String>> dependencies) {
         XSTerm term = component.getTerm();
         switch (term.getType()) {
         case XSConstants.ELEMENT_DECLARATION :
@@ -3147,8 +3153,8 @@
         }
     }
 
-    private void expandRelatedModelGroupComponents(XSModelGroup modelGroup, Vector componentList,
-            String namespace, Map<String, Vector> dependencies) {
+    private void expandRelatedModelGroupComponents(XSModelGroup modelGroup, List<XSObject> componentList,
+            String namespace, Map<String, List<String>> dependencies) {
         XSObjectList particles = modelGroup.getParticles();
         final int length = (particles == null) ? 0 : particles.getLength();
         for (int i=0; i<length; i++) {
@@ -3156,11 +3162,11 @@
         }
     }
 
-    private void addRelatedType(XSTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
+    private void addRelatedType(XSTypeDefinition type, List<XSObject> componentList, String namespace, Map<String, List<String>> dependencies) {
         if (!type.getAnonymous()) {
             if (!type.getNamespace().equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)) { //REVISIT - do we use == instead
                 if (!componentList.contains(type)) {
-                    final Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
+                    final List<String> importedNamespaces = findDependentNamespaces(namespace, dependencies);
                     addNamespaceDependency(namespace, type.getNamespace(), importedNamespaces);
                     componentList.add(type);
                 }
@@ -3171,10 +3177,10 @@
         }
     }
 
-    private void addRelatedElement(XSElementDeclaration decl, Vector componentList, String namespace, Map<String, Vector> dependencies) {
+    private void addRelatedElement(XSElementDeclaration decl, List<XSObject> componentList, String namespace, Map<String, List<String>> dependencies) {
         if (decl.getScope() == XSConstants.SCOPE_GLOBAL) {
             if (!componentList.contains(decl)) {
-                Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
+               List<String> importedNamespaces = findDependentNamespaces(namespace, dependencies);
                 addNamespaceDependency(namespace, decl.getNamespace(), importedNamespaces);
                 componentList.add(decl);
             }
@@ -3184,10 +3190,10 @@
         }
     }
 
-    private void addRelatedAttribute(XSAttributeDeclaration decl, Vector componentList, String namespace, Map<String, Vector> dependencies) {
+    private void addRelatedAttribute(XSAttributeDeclaration decl, List<XSObject> componentList, String namespace, Map<String, List<String>> dependencies) {
         if (decl.getScope() == XSConstants.SCOPE_GLOBAL) {
             if (!componentList.contains(decl)) {
-                Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
+                List<String> importedNamespaces = findDependentNamespaces(namespace, dependencies);
                 addNamespaceDependency(namespace, decl.getNamespace(), importedNamespaces);
                 componentList.add(decl);
             }
@@ -3197,12 +3203,12 @@
         }
     }
 
-    private void addGlobalComponents(Vector components, Map<String, Vector> importDependencies) {
+    private void addGlobalComponents(List<XSObject> components, Map<String, List<String>> importDependencies) {
         final XSDDescription desc = new XSDDescription();
         final int size = components.size();
 
         for (int i=0; i<size; i++) {
-            addGlobalComponent((XSObject) components.elementAt(i), desc);
+            addGlobalComponent(components.get(i), desc);
         }
         updateImportDependencies(importDependencies);
     }
@@ -3286,12 +3292,12 @@
         }
     }
 
-    private void updateImportDependencies(Map<String, Vector> table) {
+    private void updateImportDependencies(Map<String, List<String>> table) {
         if (table == null) return;
         String namespace;
-        Vector importList;
-
-        for(Map.Entry<String, Vector> entry : table.entrySet()){
+        List<String> importList;
+
+        for(Map.Entry<String, List<String>> entry : table.entrySet()){
             namespace = entry.getKey();
             importList = entry.getValue();
             if (importList.size() > 0) {
@@ -3300,13 +3306,13 @@
         }
     }
 
-    private void expandImportList(String namespace, Vector namespaceList) {
+    private void expandImportList(String namespace, List<String> namespaceList) {
         SchemaGrammar sg = fGrammarBucket.getGrammar(namespace);
         // shouldn't be null
         if (sg != null) {
-            Vector isgs = sg.getImportedGrammars();
+            List<SchemaGrammar> isgs = sg.getImportedGrammars();
             if (isgs == null) {
-                isgs = new Vector();
+                isgs = new ArrayList<>();
                 addImportList(sg, isgs, namespaceList);
                 sg.setImportedGrammars(isgs);
             }
@@ -3316,12 +3322,12 @@
         }
     }
 
-    private void addImportList(SchemaGrammar sg, Vector importedGrammars, Vector namespaceList) {
+    private void addImportList(SchemaGrammar sg, List<SchemaGrammar> importedGrammars, List<String> namespaceList) {
         final int size = namespaceList.size();
         SchemaGrammar isg;
 
         for (int i=0; i<size; i++) {
-            isg = fGrammarBucket.getGrammar((String)namespaceList.elementAt(i));
+            isg = fGrammarBucket.getGrammar(namespaceList.get(i));
             if (isg != null) {
                 importedGrammars.add(isg);
             }
@@ -3331,12 +3337,13 @@
         }
     }
 
-    private void updateImportList(SchemaGrammar sg, Vector importedGrammars, Vector namespaceList) {
+    private void updateImportList(SchemaGrammar sg, List<SchemaGrammar> importedGrammars,
+            List<String> namespaceList) {
         final int size = namespaceList.size();
         SchemaGrammar isg;
 
         for (int i=0; i<size; i++) {
-            isg = fGrammarBucket.getGrammar((String)namespaceList.elementAt(i));
+            isg = fGrammarBucket.getGrammar(namespaceList.get(i));
             if (isg != null) {
                 if (!containedImportedGrammar(importedGrammars, isg)) {
                     importedGrammars.add(isg);
@@ -3348,12 +3355,12 @@
         }
     }
 
-    private boolean containedImportedGrammar(Vector importedGrammar, SchemaGrammar grammar) {
+    private boolean containedImportedGrammar(List<SchemaGrammar> importedGrammar, SchemaGrammar grammar) {
         final int size = importedGrammar.size();
         SchemaGrammar sg;
 
         for (int i=0; i<size; i++) {
-            sg = (SchemaGrammar) importedGrammar.elementAt(i);
+            sg = (SchemaGrammar) importedGrammar.get(i);
             if (null2EmptyString(sg.getTargetNamespace()).equals(null2EmptyString(grammar.getTargetNamespace()))) {
                 return true;
             }
@@ -3377,19 +3384,20 @@
         return sg;
     }
 
-    private Vector findDependentNamespaces(String namespace, Map table) {
+    private List<String> findDependentNamespaces(String namespace,
+            Map<String, List<String>> table) {
         final String ns = null2EmptyString(namespace);
-        Vector namespaceList = (Vector) getFromMap(table, ns);
+        List<String> namespaceList = getFromMap(table, ns);
 
         if (namespaceList == null) {
-            namespaceList = new Vector();
+            namespaceList = new ArrayList<>();
             table.put(ns, namespaceList);
         }
 
         return namespaceList;
     }
 
-    private void addNamespaceDependency(String namespace1, String namespace2, Vector list) {
+    private void addNamespaceDependency(String namespace1, String namespace2, List<String> list) {
         final String ns1 = null2EmptyString(namespace1);
         final String ns2 = null2EmptyString(namespace2);
         if (!ns1.equals(ns2)) {
@@ -3464,7 +3472,7 @@
         fDoc2XSDocumentMap.clear();
         if (fRedefine2XSDMap != null) fRedefine2XSDMap.clear();
         if (fRedefine2NSSupport != null) fRedefine2NSSupport.clear();
-        fAllTNSs.removeAllElements();
+        fAllTNSs.clear();
         fImportMap.clear();
         fRoot = null;
 
@@ -3765,7 +3773,7 @@
             // (the parent of the colliding element is a redefine)
             boolean collidedWithRedefine = true;
             if ((DOMUtil.getLocalName((elemParent = DOMUtil.getParent(collidingElem))).equals(SchemaSymbols.ELT_REDEFINE))) {
-                redefinedSchema = (fRedefine2XSDMap != null)?(XSDocumentInfo) (fRedefine2XSDMap.get(elemParent)): null;
+                redefinedSchema = (fRedefine2XSDMap != null)? fRedefine2XSDMap.get(elemParent) : null;
                 // case where we're a redefining element.
             }
             else if ((DOMUtil.getLocalName(DOMUtil.getParent(currComp)).equals(SchemaSymbols.ELT_REDEFINE))) {
@@ -3828,7 +3836,7 @@
         // store the lastest current document info
         if (fTolerateDuplicates) {
             if (fUnparsedRegistriesExt[declType] == null)
-                fUnparsedRegistriesExt[declType] = new HashMap();
+                fUnparsedRegistriesExt[declType] = new HashMap<>();
             fUnparsedRegistriesExt[declType].put(qName, currSchema);
         }
 
@@ -4120,9 +4128,9 @@
         if (DOMUtil.isHidden(startSchema.fSchemaElement, fHiddenNodes)) {
             // make it visible
             DOMUtil.setVisible(startSchema.fSchemaElement, fHiddenNodes);
-            Vector<XSDocumentInfo> dependingSchemas = fDependencyMap.get(startSchema);
+            List<XSDocumentInfo> dependingSchemas = fDependencyMap.get(startSchema);
             for (int i = 0; i < dependingSchemas.size(); i++) {
-                setSchemasVisible(dependingSchemas.elementAt(i));
+                setSchemasVisible(dependingSchemas.get(i));
             }
         }
         // if it's visible already than so must be its children
@@ -4175,7 +4183,7 @@
         return registry.get(declKey);
     }
 
-    private Object getFromMap(Map registry, String key) {
+    private List<String> getFromMap(Map<String, List<String>> registry, String key) {
         if (registry == null) return null;
         return registry.get(key);
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.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,9 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.traversers;
 
-import java.util.ArrayList;
-import java.util.Vector;
-
 import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeFacetException;
 import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
 import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
@@ -35,8 +32,11 @@
 import com.sun.org.apache.xerces.internal.util.DOMUtil;
 import com.sun.org.apache.xerces.internal.xni.QName;
 import com.sun.org.apache.xerces.internal.xs.XSConstants;
+import com.sun.org.apache.xerces.internal.xs.XSObject;
 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
+import java.util.ArrayList;
+import java.util.List;
 import org.w3c.dom.Element;
 
 /**
@@ -241,7 +241,8 @@
         QName baseTypeName = (QName)contentAttrs[restriction ?
                 XSAttributeChecker.ATTIDX_BASE :
                     XSAttributeChecker.ATTIDX_ITEMTYPE];
-        Vector memberTypes = (Vector)contentAttrs[XSAttributeChecker.ATTIDX_MEMBERTYPES];
+        @SuppressWarnings("unchecked")
+        List<QName> memberTypes = (ArrayList<QName>)contentAttrs[XSAttributeChecker.ATTIDX_MEMBERTYPES];
         //content = {annotation?,simpleType?...}
         Element content = DOMUtil.getFirstChildElement(child);
         //check content (annotation?, ...)
@@ -286,16 +287,16 @@
             }
         }
         // get types from "memberTypes" attribute
-        ArrayList dTValidators = null;
+        List<XSObject> dTValidators = null;
         XSSimpleType dv = null;
         XSObjectList dvs;
         if (union && memberTypes != null && memberTypes.size() > 0) {
             int size = memberTypes.size();
-            dTValidators = new ArrayList(size);
+            dTValidators = new ArrayList<>(size);
             // for each qname in the list
             for (int i = 0; i < size; i++) {
                 // get the type decl
-                dv = findDTValidator(child, name, (QName)memberTypes.elementAt(i),
+                dv = findDTValidator(child, name, (QName)memberTypes.get(i),
                         XSConstants.DERIVATION_UNION, schemaDoc);
                 if (dv != null) {
                     // if it's a union, expand it
@@ -326,7 +327,7 @@
             }
             else if (union) {
                 if (dTValidators == null) {
-                    dTValidators = new ArrayList(2);
+                    dTValidators = new ArrayList<>(2);
                 }
                 do {
                     // traverse this child to get the member type
--- 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;
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.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,10 +21,9 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.util;
 
+import com.sun.org.apache.xerces.internal.xs.LSInputList;
 import java.lang.reflect.Array;
 import java.util.AbstractList;
-
-import com.sun.org.apache.xerces.internal.xs.LSInputList;
 import org.w3c.dom.ls.LSInput;
 
 /**
@@ -35,7 +34,8 @@
  * @author Michael Glavassevich, IBM
  *
  */
-public final class LSInputListImpl extends AbstractList implements LSInputList {
+@SuppressWarnings("unchecked") // method <T>toArray(T[])
+public final class LSInputListImpl extends AbstractList<LSInput> implements LSInputList {
 
     /**
      * An immutable empty list.
@@ -86,7 +86,7 @@
      * List methods
      */
 
-    public Object get(int index) {
+    public LSInput get(int index) {
         if (index >= 0 && index < fLength) {
             return fArray[index];
         }
@@ -105,8 +105,8 @@
 
     public Object[] toArray(Object[] a) {
         if (a.length < fLength) {
-            Class arrayClass = a.getClass();
-            Class componentType = arrayClass.getComponentType();
+            Class<?> arrayClass = a.getClass();
+            Class<?> componentType = arrayClass.getComponentType();
             a = (Object[]) Array.newInstance(componentType, fLength);
         }
         toArray0(a);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.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,18 +21,18 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.util;
 
+import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
 import java.lang.reflect.Array;
 import java.util.AbstractList;
 
-import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
-
 /**
  * Contains a list of Objects.
  *
  * @xerces.internal
  *
  */
-public final class ObjectListImpl extends AbstractList implements ObjectList {
+@SuppressWarnings("unchecked") // method <T>toArray(T[])
+public final class ObjectListImpl extends AbstractList<Object> implements ObjectList {
 
     /**
      * An immutable empty list.
@@ -99,8 +99,8 @@
 
     public Object[] toArray(Object[] a) {
         if (a.length < fLength) {
-            Class arrayClass = a.getClass();
-            Class componentType = arrayClass.getComponentType();
+            Class<?> arrayClass = a.getClass();
+            Class<?> componentType = arrayClass.getComponentType();
             a = (Object[]) Array.newInstance(componentType, fLength);
         }
         toArray0(a);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -20,10 +21,9 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.util;
 
-import java.util.AbstractList;
-
 import com.sun.org.apache.xerces.internal.xs.ShortList;
 import com.sun.org.apache.xerces.internal.xs.XSException;
+import java.util.AbstractList;
 
 /**
  * Containts a list of Object's.
@@ -33,7 +33,7 @@
  * @author Sandy Gao, IBM
  *
  */
-public final class ShortListImpl extends AbstractList implements ShortList {
+public final class ShortListImpl extends AbstractList<Short> implements ShortList {
 
     /**
      * An immutable empty list.
@@ -109,7 +109,7 @@
      * List methods
      */
 
-    public Object get(int index) {
+    public Short get(int index) {
         if (index >= 0 && index < fLength) {
             return fArray[index];
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.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,11 +21,10 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.util;
 
+import com.sun.org.apache.xerces.internal.xs.StringList;
 import java.lang.reflect.Array;
 import java.util.AbstractList;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.xs.StringList;
+import java.util.List;
 
 /**
  * Containts a list of Object's.
@@ -35,7 +34,8 @@
  * @author Sandy Gao, IBM
  *
  */
-public final class StringListImpl extends AbstractList implements StringList {
+@SuppressWarnings("unchecked") // method <T>toArray(T[])
+public final class StringListImpl extends AbstractList<String> implements StringList {
 
     /**
      * An immutable empty list.
@@ -49,9 +49,9 @@
 
     // REVISIT: this is temp solution. In general we need to use this class
     //          instead of the Vector.
-    private final Vector fVector;
+    private final List<String> fVector;
 
-    public StringListImpl(Vector v) {
+    public StringListImpl(List<String> v) {
         fVector = v;
         fLength = (v == null) ? 0 : v.size();
         fArray = null;
@@ -109,7 +109,7 @@
             return null;
         }
         if (fVector != null) {
-            return (String)fVector.elementAt(index);
+            return fVector.get(index);
         }
         return fArray[index];
     }
@@ -118,10 +118,10 @@
      * List methods
      */
 
-    public Object get(int index) {
+    public String get(int index) {
         if (index >= 0 && index < fLength) {
             if (fVector != null) {
-                return fVector.elementAt(index);
+                return fVector.get(index);
             }
             return fArray[index];
         }
@@ -146,8 +146,8 @@
             return fVector.toArray(a);
         }
         if (a.length < fLength) {
-            Class arrayClass = a.getClass();
-            Class componentType = arrayClass.getComponentType();
+            Class<?> arrayClass = a.getClass();
+            Class<?> componentType = arrayClass.getComponentType();
             a = (Object[]) Array.newInstance(componentType, fLength);
         }
         toArray0(a);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.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,14 +21,15 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.util;
 
-import java.util.ArrayList;
-
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
 import com.sun.org.apache.xerces.internal.impl.xs.XSModelImpl;
 import com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl;
+import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
 import com.sun.org.apache.xerces.internal.xs.XSModel;
+import java.util.ArrayList;
+import java.util.List;
 
 
 /**
@@ -51,7 +52,7 @@
     }
 
     public XSModel toXSModel(short schemaVersion) {
-        ArrayList list = new ArrayList();
+        List<Grammar> list = new ArrayList<>();
         for (int i = 0; i < fGrammars.length; i++) {
             for (Entry entry = fGrammars[i] ; entry != null ; entry = entry.next) {
                 if (entry.desc.getGrammarType().equals(XMLGrammarDescription.XML_SCHEMA)) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.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,20 +21,18 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.util;
 
+import com.sun.org.apache.xerces.internal.util.SymbolHash;
+import com.sun.org.apache.xerces.internal.xs.XSNamedMap;
+import com.sun.org.apache.xerces.internal.xs.XSObject;
 import java.util.AbstractMap;
 import java.util.AbstractSet;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.Set;
-
 import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.xs.XSNamedMap;
-import com.sun.org.apache.xerces.internal.xs.XSObject;
-
 /**
  * Containts the map between qnames and XSObject's.
  *
@@ -43,7 +41,7 @@
  * @author Sandy Gao, IBM
  *
  */
-public class XSNamedMapImpl extends AbstractMap implements XSNamedMap {
+public class XSNamedMapImpl extends AbstractMap<QName, XSObject> implements XSNamedMap {
 
     /**
      * An immutable empty map.
@@ -63,7 +61,7 @@
     // used when this map is accessed as a list.
     int fLength = -1;
     // Set of Map.Entry<QName,XSObject> for the java.util.Map methods
-    private Set fEntrySet = null;
+    private Set<Map.Entry<QName,XSObject>> fEntrySet = null;
 
     /**
      * Construct an XSNamedMap implementation for one namespace
@@ -206,7 +204,7 @@
         return (get(key) != null);
     }
 
-    public Object get(Object key) {
+    public XSObject get(Object key) {
         if (key instanceof QName) {
             final QName name = (QName) key;
             String namespaceURI = name.getNamespaceURI();
@@ -223,7 +221,7 @@
         return getLength();
     }
 
-    public synchronized Set entrySet() {
+    public synchronized Set<Map.Entry<QName,XSObject>> entrySet() {
         // Defer creation of the entry set until it is actually needed.
         if (fEntrySet == null) {
             final int length = getLength();
@@ -233,14 +231,14 @@
                 entries[i] = new XSNamedMapEntry(new QName(xso.getNamespace(), xso.getName()), xso);
             }
             // Create a view of this immutable map.
-            fEntrySet = new AbstractSet() {
-                public Iterator iterator() {
-                    return new Iterator() {
+            fEntrySet = new AbstractSet<Map.Entry<QName,XSObject>>() {
+                public Iterator<Map.Entry<QName,XSObject>> iterator() {
+                    return new Iterator<Map.Entry<QName,XSObject>>() {
                         private int index = 0;
                         public boolean hasNext() {
                             return (index < length);
                         }
-                        public Object next() {
+                        public Map.Entry<QName,XSObject> next() {
                             if (index < length) {
                                 return entries[index++];
                             }
@@ -260,27 +258,27 @@
     }
 
     /** An entry in the XSNamedMap. **/
-    private static final class XSNamedMapEntry implements Map.Entry {
+    private static final class XSNamedMapEntry implements Map.Entry<QName, XSObject> {
         private final QName key;
         private final XSObject value;
         public XSNamedMapEntry(QName key, XSObject value) {
             this.key = key;
             this.value = value;
         }
-        public Object getKey() {
+        public QName getKey() {
             return key;
         }
-        public Object getValue() {
+        public XSObject getValue() {
             return value;
         }
-        public Object setValue(Object value) {
+        public XSObject setValue(XSObject value) {
             throw new UnsupportedOperationException();
         }
-        public boolean equals(Object o) {
+        public boolean equals(XSNamedMapEntry o) {
             if (o instanceof Map.Entry) {
-                Map.Entry e = (Map.Entry) o;
-                Object otherKey = e.getKey();
-                Object otherValue = e.getValue();
+                Map.Entry<QName, XSObject> e = (Map.Entry<QName, XSObject>) o;
+                QName otherKey = e.getKey();
+                XSObject otherValue = e.getValue();
                 return (key == null ? otherKey == null : key.equals(otherKey)) &&
                     (value == null ? otherValue == null : value.equals(otherValue));
             }
@@ -291,7 +289,7 @@
                 ^ (value == null ? 0 : value.hashCode());
         }
         public String toString() {
-            StringBuffer buffer = new StringBuffer();
+            StringBuilder buffer = new StringBuilder();
             buffer.append(String.valueOf(key));
             buffer.append('=');
             buffer.append(String.valueOf(value));
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.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,15 +21,14 @@
 
 package com.sun.org.apache.xerces.internal.impl.xs.util;
 
+import com.sun.org.apache.xerces.internal.xs.XSObject;
+import com.sun.org.apache.xerces.internal.xs.XSObjectList;
 import java.lang.reflect.Array;
 import java.util.AbstractList;
 import java.util.Iterator;
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
 
-import com.sun.org.apache.xerces.internal.xs.XSObject;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-
 /**
  * Containts a list of XSObject's.
  *
@@ -38,23 +37,25 @@
  * @author Sandy Gao, IBM
  *
  */
-public class XSObjectListImpl extends AbstractList implements XSObjectList {
+@SuppressWarnings("unchecked") // method <T>toArray(T[])
+public class XSObjectListImpl extends AbstractList<XSObject> implements XSObjectList {
 
     /**
      * An immutable empty list.
      */
     public static final XSObjectListImpl EMPTY_LIST = new XSObjectListImpl(new XSObject[0], 0);
-    private static final ListIterator EMPTY_ITERATOR = new ListIterator() {
+    private static final ListIterator<XSObject> EMPTY_ITERATOR = new EmptyIterator();
+    static class EmptyIterator implements ListIterator<XSObject> {
         public boolean hasNext() {
             return false;
         }
-        public Object next() {
+        public XSObject next() {
             throw new NoSuchElementException();
         }
         public boolean hasPrevious() {
             return false;
         }
-        public Object previous() {
+        public XSObject previous() {
             throw new NoSuchElementException();
         }
         public int nextIndex() {
@@ -66,14 +67,13 @@
         public void remove() {
             throw new UnsupportedOperationException();
         }
-        public void set(Object object) {
+        public void set(XSObject object) {
             throw new UnsupportedOperationException();
         }
-        public void add(Object object) {
+        public void add(XSObject object) {
             throw new UnsupportedOperationException();
         }
-    };
-
+    }
     private static final int DEFAULT_SIZE = 4;
 
     // The array to hold all data
@@ -151,7 +151,7 @@
         return (value == null) ? containsNull() : containsObject(value);
     }
 
-    public Object get(int index) {
+    public XSObject get(int index) {
         if (index >= 0 && index < fLength) {
             return fArray[index];
         }
@@ -162,22 +162,22 @@
         return getLength();
     }
 
-    public Iterator iterator() {
+    public Iterator<XSObject> iterator() {
         return listIterator0(0);
     }
 
-    public ListIterator listIterator() {
+    public ListIterator<XSObject> listIterator() {
         return listIterator0(0);
     }
 
-    public ListIterator listIterator(int index) {
+    public ListIterator<XSObject> listIterator(int index) {
         if (index >= 0 && index < fLength) {
             return listIterator0(index);
         }
         throw new IndexOutOfBoundsException("Index: " + index);
     }
 
-    private ListIterator listIterator0(int index) {
+    private ListIterator<XSObject> listIterator0(int index) {
         return fLength == 0 ? EMPTY_ITERATOR : new XSObjectListIterator(index);
     }
 
@@ -207,8 +207,8 @@
 
     public Object[] toArray(Object[] a) {
         if (a.length < fLength) {
-            Class arrayClass = a.getClass();
-            Class componentType = arrayClass.getComponentType();
+            Class<?> arrayClass = a.getClass();
+            Class<?> componentType = arrayClass.getComponentType();
             a = (Object[]) Array.newInstance(componentType, fLength);
         }
         toArray0(a);
@@ -224,7 +224,7 @@
         }
     }
 
-    private final class XSObjectListIterator implements ListIterator {
+    private final class XSObjectListIterator implements ListIterator<XSObject> {
         private int index;
         public XSObjectListIterator(int index) {
             this.index = index;
@@ -232,7 +232,7 @@
         public boolean hasNext() {
             return (index < fLength);
         }
-        public Object next() {
+        public XSObject next() {
             if (index < fLength) {
                 return fArray[index++];
             }
@@ -241,7 +241,7 @@
         public boolean hasPrevious() {
             return (index > 0);
         }
-        public Object previous() {
+        public XSObject previous() {
             if (index > 0) {
                 return fArray[--index];
             }
@@ -256,10 +256,10 @@
         public void remove() {
             throw new UnsupportedOperationException();
         }
-        public void set(Object o) {
+        public void set(XSObject o) {
             throw new UnsupportedOperationException();
         }
-        public void add(Object o) {
+        public void add(XSObject o) {
             throw new UnsupportedOperationException();
         }
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -39,7 +40,6 @@
 import com.sun.org.apache.xerces.internal.xs.PSVIProvider;
 import java.io.IOException;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Locale;
 import java.util.Map;
 import javax.xml.XMLConstants;
@@ -387,8 +387,8 @@
      */
     public static class JAXPSAXParser extends com.sun.org.apache.xerces.internal.parsers.SAXParser {
 
-        private final HashMap fInitFeatures = new HashMap();
-        private final HashMap fInitProperties = new HashMap();
+        private final Map<String, Boolean> fInitFeatures = new HashMap<>();
+        private final Map<String, Object> fInitProperties = new HashMap<>();
         private final SAXParserImpl fSAXParser;
         private XMLSecurityManager fSecurityManager;
         private XMLSecurityPropertyManager fSecurityPropertyMgr;
@@ -605,22 +605,17 @@
 
         synchronized void restoreInitState()
             throws SAXNotRecognizedException, SAXNotSupportedException {
-            Iterator iter;
             if (!fInitFeatures.isEmpty()) {
-                iter = fInitFeatures.entrySet().iterator();
-                while (iter.hasNext()) {
-                    Map.Entry entry = (Map.Entry) iter.next();
-                    String name = (String) entry.getKey();
-                    boolean value = ((Boolean) entry.getValue()).booleanValue();
+                for (Map.Entry<String, Boolean> entry : fInitFeatures.entrySet()) {
+                    String name = entry.getKey();
+                    boolean value = (entry.getValue());
                     super.setFeature(name, value);
                 }
                 fInitFeatures.clear();
             }
             if (!fInitProperties.isEmpty()) {
-                iter = fInitProperties.entrySet().iterator();
-                while (iter.hasNext()) {
-                    Map.Entry entry = (Map.Entry) iter.next();
-                    String name = (String) entry.getKey();
+                for (Map.Entry<String, Object> entry : fInitProperties.entrySet()) {
+                    String name = entry.getKey();
                     Object value = entry.getValue();
                     super.setProperty(name, value);
                 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.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,8 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.jaxp;
 
-import java.util.HashMap;
-
 import com.sun.org.apache.xerces.internal.impl.validation.EntityState;
 import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
 import com.sun.org.apache.xerces.internal.xni.Augmentations;
@@ -33,6 +31,8 @@
 import com.sun.org.apache.xerces.internal.xni.XNIException;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDFilter;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * <p>This filter records which unparsed entities have been
@@ -51,7 +51,7 @@
     private final ValidationManager fValidationManager;
 
     /** Map for tracking unparsed entities. */
-    private HashMap fUnparsedEntities = null;
+    private Map<String, String> fUnparsedEntities = null;
 
     UnparsedEntityHandler(ValidationManager manager) {
         fValidationManager = manager;
@@ -172,7 +172,7 @@
             XMLResourceIdentifier identifier, String notation,
             Augmentations augmentations) throws XNIException {
         if (fUnparsedEntities == null) {
-            fUnparsedEntities = new HashMap();
+            fUnparsedEntities = new HashMap<>();
         }
         fUnparsedEntities.put(name, name);
         if (fDTDHandler != null) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.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
@@ -22,7 +22,7 @@
 package com.sun.org.apache.xerces.internal.jaxp.validation;
 
 import java.util.HashMap;
-
+import java.util.Map;
 import javax.xml.validation.Schema;
 import javax.xml.validation.Validator;
 import javax.xml.validation.ValidatorHandler;
@@ -39,17 +39,17 @@
      * Map containing the initial values of features for
      * validators created using this grammar pool container.
      */
-    private final HashMap fFeatures;
+    private final Map<String, Boolean> fFeatures;
 
     /**
      * Map containing the initial values of properties for
      * validators created using this grammar pool container.
      */
-    private final HashMap fProperties;
+    private final Map<String, Object> fProperties;
 
     public AbstractXMLSchema() {
-        fFeatures = new HashMap();
-        fProperties = new HashMap();
+        fFeatures = new HashMap<>();
+        fProperties = new HashMap<>();
     }
 
     /*
@@ -80,7 +80,7 @@
      * should use the default value.
      */
     public final Boolean getFeature(String featureId) {
-        return (Boolean) fFeatures.get(featureId);
+        return fFeatures.get(featureId);
     }
 
     /*
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultBuilder.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultBuilder.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,10 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.jaxp.validation;
 
-import java.util.ArrayList;
-
-import javax.xml.transform.dom.DOMResult;
-
 import com.sun.org.apache.xerces.internal.dom.AttrImpl;
 import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
 import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
@@ -50,7 +46,9 @@
 import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
 import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.transform.dom.DOMResult;
 import org.w3c.dom.CDATASection;
 import org.w3c.dom.Comment;
 import org.w3c.dom.Document;
@@ -109,7 +107,7 @@
     private Node fCurrentNode;
     private Node fFragmentRoot;
 
-    private final ArrayList fTargetChildren = new ArrayList();
+    private final List<Node> fTargetChildren = new ArrayList<>();
 
     private boolean fIgnoreChars;
 
@@ -334,15 +332,14 @@
     public void endCDATA(Augmentations augs) throws XNIException {}
 
     public void endDocument(Augmentations augs) throws XNIException {
-        final int length = fTargetChildren.size();
         if (fNextSibling == null) {
-            for (int i = 0; i < length; ++i) {
-                fTarget.appendChild((Node) fTargetChildren.get(i));
+            for (Node node : fTargetChildren) {
+                fTarget.appendChild(node);
             }
         }
         else {
-            for (int i = 0; i < length; ++i) {
-                fTarget.insertBefore((Node) fTargetChildren.get(i), fNextSibling);
+            for (Node node : fTargetChildren) {
+                fTarget.insertBefore(node, fNextSibling);
             }
         }
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.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,17 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.jaxp.validation;
 
-import java.io.IOException;
-import java.util.Enumeration;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
 import com.sun.org.apache.xerces.internal.impl.validation.EntityState;
@@ -48,6 +37,15 @@
 import com.sun.org.apache.xerces.internal.xni.XMLString;
 import com.sun.org.apache.xerces.internal.xni.XNIException;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
+import java.io.IOException;
+import java.util.Enumeration;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
 import org.w3c.dom.Attr;
 import org.w3c.dom.CDATASection;
 import org.w3c.dom.Comment;
@@ -542,7 +540,7 @@
             return fNamespaceContext.getDeclaredPrefixAt(index);
         }
 
-        public Enumeration getAllPrefixes() {
+        public Enumeration<String> getAllPrefixes() {
             return fNamespaceContext.getAllPrefixes();
         }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.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
@@ -65,7 +65,7 @@
     protected int fGrammarCount = 0;
 
     /** Reference queue for cleared grammar references */
-    protected final ReferenceQueue fReferenceQueue = new ReferenceQueue();
+    protected final ReferenceQueue<Grammar> fReferenceQueue = new ReferenceQueue<>();
 
     //
     // Constructors
@@ -370,7 +370,7 @@
      * Removes stale entries from the pool.
      */
     private void clean() {
-        Reference ref = fReferenceQueue.poll();
+        Reference<? extends Grammar> ref = fReferenceQueue.poll();
         while (ref != null) {
             Entry entry = ((SoftGrammarReference) ref).entry;
             if (entry != null) {
@@ -393,7 +393,8 @@
         public XMLGrammarDescription desc;
         public SoftGrammarReference grammar;
 
-        protected Entry(int hash, int bucket, XMLGrammarDescription desc, Grammar grammar, Entry next, ReferenceQueue queue) {
+        protected Entry(int hash, int bucket, XMLGrammarDescription desc, Grammar grammar,
+                Entry next, ReferenceQueue<Grammar> queue) {
             this.hash = hash;
             this.bucket = bucket;
             this.prev = null;
@@ -422,11 +423,11 @@
      * This class stores a soft reference to a grammar object. It keeps a reference
      * to its associated entry, so that it can be easily removed from the pool.
      */
-    static final class SoftGrammarReference extends SoftReference {
+    static final class SoftGrammarReference extends SoftReference<Grammar> {
 
         public Entry entry;
 
-        protected SoftGrammarReference(Entry entry, Grammar grammar, ReferenceQueue queue) {
+        protected SoftGrammarReference(Entry entry, Grammar grammar, ReferenceQueue<Grammar> queue) {
             super(grammar, queue);
             this.entry = entry;
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,22 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.jaxp.validation;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.HashMap;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.validation.TypeInfoProvider;
-import javax.xml.validation.ValidatorHandler;
-
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
 import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
@@ -52,8 +37,8 @@
 import com.sun.org.apache.xerces.internal.util.URI;
 import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
 import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
 import com.sun.org.apache.xerces.internal.xni.Augmentations;
 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 import com.sun.org.apache.xerces.internal.xni.QName;
@@ -71,7 +56,21 @@
 import com.sun.org.apache.xerces.internal.xs.ItemPSVI;
 import com.sun.org.apache.xerces.internal.xs.PSVIProvider;
 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import javax.xml.catalog.CatalogFeatures;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.XMLConstants;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.validation.TypeInfoProvider;
+import javax.xml.validation.ValidatorHandler;
 import jdk.xml.internal.JdkXmlUtils;
 import org.w3c.dom.TypeInfo;
 import org.w3c.dom.ls.LSInput;
@@ -169,7 +168,7 @@
     private boolean fNeedPushNSContext = true;
 
     /** Map for tracking unparsed entities. */
-    private HashMap fUnparsedEntities = null;
+    private Map<String, String> fUnparsedEntities = null;
 
     /** Flag used to track whether XML names and Namespace URIs have been internalized. */
     private boolean fStringsInternalized = false;
@@ -653,7 +652,7 @@
     public void unparsedEntityDecl(String name, String publicId,
             String systemId, String notationName) throws SAXException {
         if (fUnparsedEntities == null) {
-            fUnparsedEntities = new HashMap();
+            fUnparsedEntities = new HashMap<>();
         }
         fUnparsedEntities.put(name, name);
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/WeakReferenceXMLSchema.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/WeakReferenceXMLSchema.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
@@ -37,7 +37,7 @@
 final class WeakReferenceXMLSchema extends AbstractXMLSchema {
 
     /** Weak reference to grammar pool. */
-    private WeakReference fGrammarPool = new WeakReference(null);
+    private WeakReference<XMLGrammarPool> fGrammarPool = new WeakReference<>(null);
 
     public WeakReferenceXMLSchema() {}
 
@@ -46,12 +46,12 @@
      */
 
     public synchronized XMLGrammarPool getGrammarPool() {
-        XMLGrammarPool grammarPool = (XMLGrammarPool) fGrammarPool.get();
+        XMLGrammarPool grammarPool = fGrammarPool.get();
         // If there's no grammar pool then either we haven't created one
         // yet or the garbage collector has already cleaned out the previous one.
         if (grammarPool == null) {
             grammarPool = new SoftReferenceGrammarPool();
-            fGrammarPool = new WeakReference(grammarPool);
+            fGrammarPool = new WeakReference<>(grammarPool);
         }
         return grammarPool;
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -20,9 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.parsers;
 
-import java.util.Locale;
-import java.util.Stack;
-
 import com.sun.org.apache.xerces.internal.dom.AttrImpl;
 import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
 import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl;
@@ -44,6 +42,7 @@
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
 import com.sun.org.apache.xerces.internal.util.DOMErrorHandlerWrapper;
+import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
 import com.sun.org.apache.xerces.internal.xni.Augmentations;
 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 import com.sun.org.apache.xerces.internal.xni.QName;
@@ -56,7 +55,8 @@
 import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
 import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
+import java.util.Locale;
+import java.util.Stack;
 import org.w3c.dom.Attr;
 import org.w3c.dom.CDATASection;
 import org.w3c.dom.Comment;
@@ -263,13 +263,13 @@
     // data
 
     /** Base uri stack*/
-    protected final Stack fBaseURIStack = new Stack ();
+    protected final Stack<String> fBaseURIStack = new Stack<>();
 
     /** LSParserFilter: tracks the element depth within a rejected subtree. */
     protected int fRejectedElementDepth = 0;
 
     /** LSParserFilter: store depth of skipped elements */
-    protected Stack fSkippedElemStack = null;
+    protected Stack<Boolean> fSkippedElemStack = null;
 
     /** LSParserFilter: true if inside entity reference */
     protected boolean fInEntityRef = false;
@@ -345,7 +345,7 @@
             !documentClassName.equals(PSVI_DOCUMENT_CLASS_NAME)) {
             // verify that this class exists and is of the right type
             try {
-                Class _class = ObjectFactory.findProviderClass (documentClassName, true);
+                Class<?> _class = ObjectFactory.findProviderClass (documentClassName, true);
                 //if (!_class.isAssignableFrom(Document.class)) {
                 if (!Document.class.isAssignableFrom (_class)) {
                     throw new IllegalArgumentException (
@@ -788,16 +788,16 @@
             else {
                 // use specified document class
                 try {
-                    Class documentClass = ObjectFactory.findProviderClass (fDocumentClassName, true);
+                    Class<?> documentClass = ObjectFactory.findProviderClass (fDocumentClassName, true);
                     fDocument = (Document)documentClass.getConstructor().newInstance();
 
                     // if subclass of our own class that's cool too
-                    Class defaultDocClass =
+                    Class<?> defaultDocClass =
                     ObjectFactory.findProviderClass (CORE_DOCUMENT_CLASS_NAME, true);
                     if (defaultDocClass.isAssignableFrom (documentClass)) {
                         fDocumentImpl = (CoreDocumentImpl)fDocument;
 
-                        Class psviDocClass = ObjectFactory.findProviderClass (PSVI_DOCUMENT_CLASS_NAME, true);
+                        Class<?> psviDocClass = ObjectFactory.findProviderClass (PSVI_DOCUMENT_CLASS_NAME, true);
                         if (psviDocClass.isAssignableFrom (documentClass)) {
                             fStorePSVI = true;
                         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,11 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.parsers;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Locale;
-
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.util.FeatureState;
 import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
@@ -44,6 +39,11 @@
 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
 
 /**
  * A very basic parser configuration. This configuration class can
@@ -156,7 +156,7 @@
     protected Locale fLocale;
 
     /** Components. */
-    protected ArrayList fComponents;
+    protected List<XMLComponent> fComponents;
 
     // handlers
 
@@ -202,11 +202,11 @@
         super(parentSettings);
 
         // create a vector to hold all the components in use
-        fComponents = new ArrayList();
+        fComponents = new ArrayList<>();
 
         // create table for features and properties
-        fFeatures = new HashMap();
-        fProperties = new HashMap();
+        fFeatures = new HashMap<>();
+        fProperties = new HashMap<>();
 
         // add default recognized features
         final String[] recognizedFeatures = {
@@ -442,9 +442,7 @@
         throws XMLConfigurationException {
 
         // forward to every component
-        int count = fComponents.size();
-        for (int i = 0; i < count; i++) {
-            XMLComponent c = (XMLComponent) fComponents.get(i);
+        for (XMLComponent c : fComponents) {
             c.setFeature(featureId, state);
         }
         // save state if noone "objects"
@@ -462,9 +460,7 @@
         throws XMLConfigurationException {
 
         // forward to every component
-        int count = fComponents.size();
-        for (int i = 0; i < count; i++) {
-            XMLComponent c = (XMLComponent) fComponents.get(i);
+        for (XMLComponent c : fComponents) {
             c.setProperty(propertyId, value);
         }
 
@@ -498,14 +494,10 @@
      * reset all components before parsing and namespace context
      */
     protected void reset() throws XNIException {
-
         // reset every component
-        int count = fComponents.size();
-        for (int i = 0; i < count; i++) {
-            XMLComponent c = (XMLComponent) fComponents.get(i);
+        for (XMLComponent c : fComponents) {
             c.reset(this);
         }
-
     } // reset()
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -51,6 +52,7 @@
 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
 import java.io.StringReader;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Locale;
 import java.util.Stack;
 import java.util.StringTokenizer;
@@ -334,7 +336,7 @@
     public void setFilter (LSParserFilter filter) {
         fDOMFilter = filter;
         if (fSkippedElemStack == null) {
-            fSkippedElemStack = new Stack ();
+            fSkippedElemStack = new Stack<>();
         }
     }
 
@@ -519,7 +521,7 @@
                             // tokenize location string
                             StringTokenizer t = new StringTokenizer (fSchemaLocation, " \n\t\r");
                             if (t.hasMoreTokens()) {
-                                ArrayList locations = new ArrayList();
+                                List<String> locations = new ArrayList<>();
                                 locations.add (t.nextToken());
                                 while (t.hasMoreTokens()) {
                                     locations.add (t.nextToken());
@@ -862,7 +864,7 @@
      */
     public DOMStringList getParameterNames () {
         if (fRecognizedParameters == null){
-            ArrayList parameters = new ArrayList();
+            List<String> parameters = new ArrayList<>();
 
             // REVISIT: add Xerces recognized properties/features
             parameters.add(Constants.DOM_NAMESPACES);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -65,6 +65,7 @@
 import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Locale;
 import javax.xml.XMLConstants;
 import javax.xml.catalog.CatalogFeatures;
@@ -316,13 +317,13 @@
     protected Locale fLocale;
 
     /** XML 1.0 Components. */
-    protected ArrayList<XMLComponent> fComponents;
+    protected List<XMLComponent> fComponents;
 
     /** XML 1.1. Components. */
-    protected ArrayList<XMLComponent> fXML11Components = null;
+    protected List<XMLComponent> fXML11Components = null;
 
     /** Common components: XMLEntityManager, XMLErrorReporter, XMLSchemaValidator */
-    protected ArrayList<XMLComponent> fCommonComponents = null;
+    protected List<XMLComponent> fCommonComponents = null;
 
     /** The document handler. */
     protected XMLDocumentHandler fDocumentHandler;
@@ -934,28 +935,21 @@
                 throws XMLConfigurationException {
                 fConfigUpdated = true;
                 // forward to every XML 1.0 component
-                int count = fComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = fComponents.get(i);
-                        c.setFeature(featureId, state);
+                for (XMLComponent c : fComponents) {
+                    c.setFeature(featureId, state);
                 }
                 // forward it to common components
-                count = fCommonComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = fCommonComponents.get(i);
-                        c.setFeature(featureId, state);
+                for (XMLComponent c : fCommonComponents) {
+                    c.setFeature(featureId, state);
                 }
-
                 // forward to every XML 1.1 component
-                count = fXML11Components.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = fXML11Components.get(i);
-                        try{
-                                c.setFeature(featureId, state);
-                        }
-                        catch (Exception e){
-                                // no op
-                        }
+                for (XMLComponent c : fXML11Components) {
+                    try {
+                        c.setFeature(featureId, state);
+                    }
+                    catch (Exception e){
+                        // no op
+                    }
                 }
                 // save state if noone "objects"
                 super.setFeature(featureId, state);
@@ -995,27 +989,21 @@
                     setLocale((Locale) value);
                 }
                 // forward to every XML 1.0 component
-                int count = fComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = fComponents.get(i);
-                        c.setProperty(propertyId, value);
+                for (XMLComponent c : fComponents) {
+                    c.setProperty(propertyId, value);
                 }
                 // forward it to every common Component
-                count = fCommonComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = fCommonComponents.get(i);
-                        c.setProperty(propertyId, value);
+                for (XMLComponent c : fCommonComponents) {
+                    c.setProperty(propertyId, value);
                 }
                 // forward it to every XML 1.1 component
-                count = fXML11Components.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = fXML11Components.get(i);
-                        try{
-                                c.setProperty(propertyId, value);
-                        }
-                        catch (Exception e){
+                for (XMLComponent c : fXML11Components) {
+                    try {
+                        c.setProperty(propertyId, value);
+                    }
+                    catch (Exception e){
                                 // ignore it
-                        }
+                    }
                 }
 
                 // store value if noone "objects"
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.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,11 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.parsers;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Locale;
-
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
 import com.sun.org.apache.xerces.internal.impl.XML11DocumentScannerImpl;
@@ -67,6 +62,11 @@
 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
 
 /**
  * This class is the DTD-only parser configuration
@@ -221,13 +221,13 @@
     protected Locale fLocale;
 
     /** XML 1.0 Components. */
-    protected ArrayList fComponents;
+    protected List<XMLComponent> fComponents;
 
     /** XML 1.1. Components. */
-    protected ArrayList fXML11Components = null;
+    protected List<XMLComponent> fXML11Components = null;
 
     /** Common components: XMLEntityManager, XMLErrorReporter */
-    protected ArrayList fCommonComponents = null;
+    protected List<XMLComponent> fCommonComponents = null;
 
     /** The document handler. */
     protected XMLDocumentHandler fDocumentHandler;
@@ -383,15 +383,15 @@
 
                 // create a vector to hold all the components in use
                 // XML 1.0 specialized components
-                fComponents = new ArrayList();
+                fComponents = new ArrayList<>();
                 // XML 1.1 specialized components
-                fXML11Components = new ArrayList();
+                fXML11Components = new ArrayList<>();
                 // Common components for XML 1.1. and XML 1.0
-                fCommonComponents = new ArrayList();
+                fCommonComponents = new ArrayList<>();
 
                 // create table for features and properties
-                fFeatures = new HashMap();
-                fProperties = new HashMap();
+                fFeatures = new HashMap<>();
+                fProperties = new HashMap<>();
 
         // add default recognized features
         final String[] recognizedFeatures =
@@ -799,28 +799,21 @@
                 throws XMLConfigurationException {
                 fConfigUpdated = true;
                 // forward to every XML 1.0 component
-                int count = fComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fComponents.get(i);
-                        c.setFeature(featureId, state);
+                for (XMLComponent c : fComponents) {
+                    c.setFeature(featureId, state);
                 }
                 // forward it to common components
-                count = fCommonComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fCommonComponents.get(i);
-                        c.setFeature(featureId, state);
+                for (XMLComponent c : fCommonComponents) {
+                    c.setFeature(featureId, state);
                 }
-
                 // forward to every XML 1.1 component
-                count = fXML11Components.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fXML11Components.get(i);
-                        try{
-                                c.setFeature(featureId, state);
-                        }
-                        catch (Exception e){
-                                // no op
-                        }
+                for (XMLComponent c : fXML11Components) {
+                    try {
+                        c.setFeature(featureId, state);
+                    }
+                    catch (Exception e){
+                        // no op
+                    }
                 }
                 // save state if noone "objects"
                 super.setFeature(featureId, state);
@@ -837,27 +830,21 @@
                 throws XMLConfigurationException {
                 fConfigUpdated = true;
                 // forward to every XML 1.0 component
-                int count = fComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fComponents.get(i);
-                        c.setProperty(propertyId, value);
+                for (XMLComponent c : fComponents) {
+                    c.setProperty(propertyId, value);
                 }
                 // forward it to every common Component
-                count = fCommonComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fCommonComponents.get(i);
-                        c.setProperty(propertyId, value);
+                for (XMLComponent c : fCommonComponents) {
+                    c.setProperty(propertyId, value);
                 }
                 // forward it to every XML 1.1 component
-                count = fXML11Components.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fXML11Components.get(i);
-                        try{
-                                c.setProperty(propertyId, value);
-                        }
-                        catch (Exception e){
+                for (XMLComponent c : fXML11Components) {
+                    try {
+                        c.setProperty(propertyId, value);
+                    }
+                    catch (Exception e){
                                 // ignore it
-                        }
+                    }
                 }
 
                 // store value if noone "objects"
@@ -875,38 +862,29 @@
          * reset all XML 1.0 components before parsing and namespace context
          */
         protected void reset() throws XNIException {
-                int count = fComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fComponents.get(i);
-                        c.reset(this);
-                }
-
+            for (XMLComponent c : fComponents) {
+                c.reset(this);
+            }
         } // reset()
 
         /**
          * reset all common components before parsing
          */
         protected void resetCommon() throws XNIException {
-                // reset common components
-                int count = fCommonComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fCommonComponents.get(i);
-                        c.reset(this);
-                }
-
+            // reset common components
+            for (XMLComponent c : fCommonComponents) {
+                c.reset(this);
+            }
         } // resetCommon()
 
         /**
          * reset all components before parsing and namespace context
          */
         protected void resetXML11() throws XNIException {
-                // reset every component
-                int count = fXML11Components.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fXML11Components.get(i);
-                        c.reset(this);
-                }
-
+            // reset every component
+            for (XMLComponent c : fXML11Components) {
+                c.reset(this);
+            }
         } // resetXML11()
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.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,11 +21,6 @@
 
 package com.sun.org.apache.xerces.internal.parsers;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Locale;
-
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
 import com.sun.org.apache.xerces.internal.impl.XML11DocumentScannerImpl;
@@ -61,14 +56,21 @@
 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
 
 /**
  * This class is the non vlaidating parser configuration
  * used to parse XML 1.0 and XML 1.1 documents.
  *
- * Xerces parser that uses this configuration is <strong>not</strong> <a href="http://www.w3.org/TR/REC-xml#sec-conformance">conformant</a>
- * non-validating XML processor, since conformant non-validating processor is required
- * to process "all the declarations they read in the internal DTD subset ... must use the information in those declarations to normalize attribute values,
+ * Xerces parser that uses this configuration is <strong>not</strong>
+ * <a href="http://www.w3.org/TR/REC-xml#sec-conformance">conformant</a>
+ * non-validating XML processor, since conformant non-validating processor is
+ * required to process "all the declarations they read in the internal DTD subset
+ * ... must use the information in those declarations to normalize attribute values,
  * include the replacement text of internal entities, and supply default attribute values".
 
  * @author Elena Litani, IBM
@@ -178,13 +180,13 @@
     protected Locale fLocale;
 
     /** XML 1.0 Components. */
-    protected ArrayList fComponents;
+    protected List<XMLComponent> fComponents;
 
     /** XML 1.1. Components. */
-    protected ArrayList fXML11Components = null;
+    protected List<XMLComponent> fXML11Components = null;
 
     /** Common components: XMLEntityManager, XMLErrorReporter */
-    protected ArrayList fCommonComponents = null;
+    protected List<XMLComponent> fCommonComponents = null;
 
     /** The document handler. */
     protected XMLDocumentHandler fDocumentHandler;
@@ -322,15 +324,15 @@
 
                 // create a vector to hold all the components in use
                 // XML 1.0 specialized components
-                fComponents = new ArrayList();
+                fComponents = new ArrayList<>();
                 // XML 1.1 specialized components
-                fXML11Components = new ArrayList();
+                fXML11Components = new ArrayList<>();
                 // Common components for XML 1.1. and XML 1.0
-                fCommonComponents = new ArrayList();
+                fCommonComponents = new ArrayList<>();
 
                 // create table for features and properties
-                fFeatures = new HashMap();
-                fProperties = new HashMap();
+                fFeatures = new HashMap<>();
+                fProperties = new HashMap<>();
 
         // add default recognized features
         final String[] recognizedFeatures =
@@ -725,28 +727,21 @@
                 throws XMLConfigurationException {
                 fConfigUpdated = true;
                 // forward to every XML 1.0 component
-                int count = fComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fComponents.get(i);
-                        c.setFeature(featureId, state);
+                for (XMLComponent c : fComponents) {
+                    c.setFeature(featureId, state);
                 }
                 // forward it to common components
-                count = fCommonComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fCommonComponents.get(i);
-                        c.setFeature(featureId, state);
+                for (XMLComponent c : fCommonComponents) {
+                    c.setFeature(featureId, state);
                 }
-
                 // forward to every XML 1.1 component
-                count = fXML11Components.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fXML11Components.get(i);
-                        try{
-                                c.setFeature(featureId, state);
-                        }
-                        catch (Exception e){
-                                // no op
-                        }
+                for (XMLComponent c : fXML11Components) {
+                    try {
+                        c.setFeature(featureId, state);
+                    }
+                    catch (Exception e){
+                        // no op
+                    }
                 }
                 // save state if noone "objects"
                 super.setFeature(featureId, state);
@@ -763,29 +758,22 @@
                 throws XMLConfigurationException {
                 fConfigUpdated = true;
                 // forward to every XML 1.0 component
-                int count = fComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fComponents.get(i);
-                        c.setProperty(propertyId, value);
+                for (XMLComponent c : fComponents) {
+                    c.setProperty(propertyId, value);
                 }
                 // forward it to every common Component
-                count = fCommonComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fCommonComponents.get(i);
-                        c.setProperty(propertyId, value);
+                for (XMLComponent c : fCommonComponents) {
+                    c.setProperty(propertyId, value);
                 }
                 // forward it to every XML 1.1 component
-                count = fXML11Components.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fXML11Components.get(i);
-                        try{
-                                c.setProperty(propertyId, value);
-                        }
-                        catch (Exception e){
-                                // ignore it
-                        }
+                for (XMLComponent c : fXML11Components) {
+                    try {
+                        c.setProperty(propertyId, value);
+                    }
+                    catch (Exception e){
+                        // no op
+                    }
                 }
-
                 // store value if noone "objects"
                 super.setProperty(propertyId, value);
 
@@ -801,25 +789,19 @@
          * reset all XML 1.0 components before parsing and namespace context
          */
         protected void reset() throws XNIException {
-                int count = fComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fComponents.get(i);
-                        c.reset(this);
-                }
-
+            for (XMLComponent c : fComponents) {
+                c.reset(this);
+            }
         } // reset()
 
         /**
          * reset all common components before parsing
          */
         protected void resetCommon() throws XNIException {
-                // reset common components
-                int count = fCommonComponents.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fCommonComponents.get(i);
-                        c.reset(this);
-                }
-
+            // reset common components
+            for (XMLComponent c : fCommonComponents) {
+                c.reset(this);
+            }
         } // resetCommon()
 
 
@@ -827,13 +809,10 @@
          * reset all components before parsing and namespace context
          */
         protected void resetXML11() throws XNIException {
-                // reset every component
-                int count = fXML11Components.size();
-                for (int i = 0; i < count; i++) {
-                        XMLComponent c = (XMLComponent) fXML11Components.get(i);
-                        c.reset(this);
-                }
-
+            // reset every component
+            for (XMLComponent c : fXML11Components) {
+                c.reset(this);
+            }
         } // resetXML11()
 
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -35,7 +36,6 @@
 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
 import java.io.IOException;
 import java.util.Collections;
-import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -156,7 +156,7 @@
         if(loader == null) { // none specified!
             if(KNOWN_LOADERS.containsKey(grammarType)) {
                 // got one; just instantiate it...
-                String loaderName = (String)KNOWN_LOADERS.get(grammarType);
+                String loaderName = KNOWN_LOADERS.get(grammarType);
                 try {
                     XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, true));
                     fLoaders.put(grammarType, gl);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -24,7 +25,6 @@
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 /**
@@ -88,7 +88,7 @@
      * Returns an enumeration of the keys in the Augmentations structure
      *
      */
-    public Enumeration keys (){
+    public Enumeration<Object> keys (){
         return fAugmentationsContainer.keys();
     }
 
@@ -107,7 +107,7 @@
         abstract public Object putItem(Object key, Object item);
         abstract public Object getItem(Object key);
         abstract public Object removeItem(Object key);
-        abstract public Enumeration keys();
+        abstract public Enumeration<Object> keys();
         abstract public void clear();
         abstract public boolean isFull();
         abstract public AugmentationsItemsContainer expand();
@@ -118,7 +118,7 @@
         final Object[] fAugmentations = new Object[SIZE_LIMIT*2];
         int fNumEntries = 0;
 
-        public Enumeration keys() {
+        public Enumeration<Object> keys() {
             return new SmallContainerKeyEnumeration();
         }
 
@@ -213,7 +213,7 @@
             return buff.toString();
         }
 
-        class SmallContainerKeyEnumeration implements Enumeration {
+        class SmallContainerKeyEnumeration implements Enumeration<Object> {
             Object [] enumArray = new Object[fNumEntries];
             int next = 0;
 
@@ -256,7 +256,7 @@
             return fAugmentations.remove(key);
         }
 
-        public Enumeration keys() {
+        public Enumeration<Object> keys() {
             return Collections.enumeration(fAugmentations.keySet());
         }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.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
@@ -22,16 +22,14 @@
 package com.sun.org.apache.xerces.internal.util;
 
 
+import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.TreeSet;
 import java.util.Vector;
-
 import javax.xml.XMLConstants;
 
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-
 /**
  * <p>A read-only XNI wrapper around a JAXP NamespaceContext.</p>
  *
@@ -42,8 +40,8 @@
 
     private javax.xml.namespace.NamespaceContext fNamespaceContext;
     private SymbolTable fSymbolTable;
-    private List fPrefixes;
-    private final Vector fAllPrefixes = new Vector();
+    private List<String> fPrefixes;
+    private final Vector<String> fAllPrefixes = new Vector<>();
 
     private int[] fContext = new int[8];
     private int fCurrentContext;
@@ -68,11 +66,11 @@
         return fSymbolTable;
     }
 
-    public void setDeclaredPrefixes(List prefixes) {
+    public void setDeclaredPrefixes(List<String> prefixes) {
         fPrefixes = prefixes;
     }
 
-    public List getDeclaredPrefixes() {
+    public List<String> getDeclaredPrefixes() {
         return fPrefixes;
     }
 
@@ -104,10 +102,10 @@
         return null;
     }
 
-    public Enumeration getAllPrefixes() {
+    public Enumeration<String> getAllPrefixes() {
         // There may be duplicate prefixes in the list so we
         // first transfer them to a set to ensure uniqueness.
-        return Collections.enumeration(new TreeSet(fAllPrefixes));
+        return Collections.enumeration(new TreeSet<String>(fAllPrefixes));
     }
 
     public void pushContext() {
@@ -137,7 +135,7 @@
     }
 
     public String getDeclaredPrefixAt(int index) {
-        return (String) fPrefixes.get(index);
+        return fPrefixes.get(index);
     }
 
     public void reset() {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 package com.sun.org.apache.xerces.internal.util;
 
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.List;
 import javax.xml.namespace.NamespaceContext;
 
 /**
@@ -69,12 +69,12 @@
      * TODO: Namespace doesn't give information giving multiple prefixes for
      * the same namespaceURI.
      */
-    public java.util.Iterator getPrefixes(String namespaceURI) {
+    public Iterator<String> getPrefixes(String namespaceURI) {
         if (namespaceURI == null) {
             throw new IllegalArgumentException("URI can't be null.");
         }
         else {
-            Vector vector =
+           List<String> vector =
                 ((NamespaceSupport) fNamespaceContext).getPrefixes(namespaceURI.intern());
             return vector.iterator();
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/NamespaceSupport.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/NamespaceSupport.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,12 +21,12 @@
 
 package com.sun.org.apache.xerces.internal.util;
 
+import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
+import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.Iterator;
+import java.util.List;
 import java.util.NoSuchElementException;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 
 /**
  * Namespace support for XML document handlers. This class doesn't
@@ -90,9 +90,9 @@
     public NamespaceSupport(NamespaceContext context) {
         pushContext();
         // copy declaration in the context
-        Enumeration prefixes = context.getAllPrefixes();
+        Enumeration<String> prefixes = context.getAllPrefixes();
         while (prefixes.hasMoreElements()){
-            String prefix = (String)prefixes.nextElement();
+            String prefix = prefixes.nextElement();
             String uri = context.getURI(prefix);
             declarePrefix(prefix, uri);
         }
@@ -240,7 +240,7 @@
         return fNamespace[fContext[fCurrentContext] + index * 2];
     } // getDeclaredPrefixAt(int):String
 
-    public Iterator getPrefixes(){
+    public Iterator<String> getPrefixes(){
         int count = 0;
         if (fPrefixes.length < (fNamespace.length/2)) {
             // resize prefix array
@@ -267,7 +267,7 @@
     /**
      * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#getAllPrefixes()
      */
-    public Enumeration getAllPrefixes() {
+    public Enumeration<String> getAllPrefixes() {
         int count = 0;
         if (fPrefixes.length < (fNamespace.length/2)) {
             // resize prefix array
@@ -292,11 +292,11 @@
         return new Prefixes(fPrefixes, count);
     }
 
-    public  Vector getPrefixes(String uri){
+    public List<String> getPrefixes(String uri){
         int count = 0;
         String prefix = null;
         boolean unique = true;
-        Vector prefixList = new Vector();
+        List<String> prefixList = new ArrayList<>();
         for (int i = fNamespaceSize; i >0 ; i -= 2) {
             if(fNamespace[i-1] == uri){
                 if(!prefixList.contains(fNamespace[i-2]))
@@ -352,7 +352,7 @@
         return false;
     }
 
-    protected final class IteratorPrefixes implements Iterator  {
+    protected final class IteratorPrefixes implements Iterator<String>  {
         private String[] prefixes;
         private int counter = 0;
         private int size = 0;
@@ -375,7 +375,7 @@
         /**
          * @see java.util.Enumeration#nextElement()
          */
-        public Object next() {
+        public String next() {
             if (counter< size){
                 return fPrefixes[counter++];
             }
@@ -383,7 +383,7 @@
         }
 
         public String toString(){
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
             for (int i=0;i<size;i++){
                 buf.append(prefixes[i]);
                 buf.append(" ");
@@ -398,7 +398,7 @@
     }
 
 
-    protected final class Prefixes implements Enumeration {
+    protected final class Prefixes implements Enumeration<String> {
         private String[] prefixes;
         private int counter = 0;
         private int size = 0;
@@ -421,7 +421,7 @@
         /**
          * @see java.util.Enumeration#nextElement()
          */
-        public Object nextElement() {
+        public String nextElement() {
             if (counter< size){
                 return fPrefixes[counter++];
             }
@@ -429,7 +429,7 @@
         }
 
         public String toString(){
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
             for (int i=0;i<size;i++){
                 buf.append(prefixes[i]);
                 buf.append(" ");
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,9 @@
 
 package com.sun.org.apache.xerces.internal.util;
 
-//java imports
-import java.util.Iterator ;
+import java.util.Iterator;
 import java.util.NoSuchElementException;
 
-//xerces imports
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl ;
-
 /**
  *
  * @author  Neeraj Bajaj, Sun Microsystems
@@ -47,7 +43,8 @@
  * much as possible. - NB.
  */
 
-public class XMLAttributesIteratorImpl extends XMLAttributesImpl implements Iterator {
+public class XMLAttributesIteratorImpl extends XMLAttributesImpl implements
+        Iterator<XMLAttributesImpl.Attribute> {
 
     //pointer to current position.
     protected int fCurrent = 0 ;
@@ -62,7 +59,7 @@
         return fCurrent < getLength() ? true : false ;
     }//hasNext()
 
-    public Object next() {
+    public XMLAttributesImpl.Attribute next() {
         if(hasNext()){
             // should this be of type javax.xml.stream.Attribute ?
             return fLastReturnedItem = fAttributes[fCurrent++] ;
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * 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
@@ -157,7 +157,7 @@
     {
         // assert(className != null);
         try{
-            Class providerClass = findProviderClass(className, cl, doFallback);
+            Class<?> providerClass = findProviderClass(className, cl, doFallback);
             Object instance = providerClass.getConstructor().newInstance();
             debugPrintln(()->"created new instance of " + providerClass +
                              " using ClassLoader: " + cl);
@@ -176,7 +176,7 @@
      * Find a Class using the same classloader for the ObjectFactory by default
      * or bootclassloader when Security Manager is in place
      */
-    public static Class findProviderClass(String className, boolean doFallback)
+    public static Class<?> findProviderClass(String className, boolean doFallback)
         throws ClassNotFoundException, ConfigurationError
     {
         return findProviderClass (className,
@@ -185,7 +185,7 @@
     /**
      * Find a Class using the specified ClassLoader
      */
-    public static Class findProviderClass(String className, ClassLoader cl,
+    public static Class<?> findProviderClass(String className, ClassLoader cl,
                                       boolean doFallback)
         throws ClassNotFoundException, ConfigurationError
     {
@@ -203,7 +203,7 @@
                 security.checkPackageAccess(packageName);
             }
         }
-        Class providerClass;
+        Class<?> providerClass;
         if (cl == null) {
             //use the bootstrap ClassLoader.
             providerClass = Class.forName(className, false, ObjectFactory.class.getClassLoader());
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -93,13 +93,14 @@
     /**
      * Maintain values of the top 10 elements in the process of parsing
      */
-    private final Map[] caches;
+    private final Map<String, Integer>[] caches;
 
     private String entityStart, entityEnd;
     /**
      * Default constructor. Establishes default values for known security
      * vulnerabilities.
      */
+    @SuppressWarnings({"rawtypes", "unchecked"})
     public XMLLimitAnalyzer() {
         values = new int[Limit.values().length];
         totalValue = new int[Limit.values().length];
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/MultipleScopeNamespaceSupport.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/MultipleScopeNamespaceSupport.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,11 +21,10 @@
 
 package com.sun.org.apache.xerces.internal.xinclude;
 
-import java.util.Enumeration;
-
 import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
+import java.util.Enumeration;
 
 /**
  * This implementation of NamespaceContext has the ability to maintain multiple
@@ -66,7 +65,7 @@
     /* (non-Javadoc)
      * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#getAllPrefixes()
      */
-    public Enumeration getAllPrefixes() {
+    public Enumeration<String> getAllPrefixes() {
         int count = 0;
         if (fPrefixes.length < (fNamespace.length / 2)) {
             // resize prefix array
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,8 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
+ * @modifiedBy: Oracle Inc.
+ * @modifiedOn: Nov 2015, Sept 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,15 +23,6 @@
 
 package com.sun.org.apache.xerces.internal.xinclude;
 
-import java.io.CharConversionException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Stack;
-import java.util.StringTokenizer;
-import javax.xml.XMLConstants;
-
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
 import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
@@ -41,13 +35,15 @@
 import com.sun.org.apache.xerces.internal.util.IntStack;
 import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
+import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;
 import com.sun.org.apache.xerces.internal.util.URI;
 import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
+import com.sun.org.apache.xerces.internal.util.XMLChar;
 import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;
+import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
 import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.Augmentations;
 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 import com.sun.org.apache.xerces.internal.xni.QName;
@@ -70,9 +66,16 @@
 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
 import com.sun.org.apache.xerces.internal.xpointer.XPointerHandler;
 import com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor;
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
+import java.io.CharConversionException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Locale;
 import java.util.Objects;
+import java.util.Stack;
+import java.util.StringTokenizer;
+import javax.xml.XMLConstants;
 import javax.xml.catalog.CatalogException;
 import javax.xml.catalog.CatalogFeatures;
 import javax.xml.catalog.CatalogManager;
@@ -306,13 +309,13 @@
     // these are needed for XML Base processing
     protected XMLResourceIdentifier fCurrentBaseURI;
     protected IntStack fBaseURIScope;
-    protected Stack fBaseURI;
-    protected Stack fLiteralSystemID;
-    protected Stack fExpandedSystemID;
+    protected Stack<String> fBaseURI;
+    protected Stack<String> fLiteralSystemID;
+    protected Stack<String> fExpandedSystemID;
 
     // these are needed for Language Fixup
     protected IntStack fLanguageScope;
-    protected Stack fLanguageStack;
+    protected Stack<String> fLanguageStack;
     protected String fCurrentLanguage;
 
     // used for passing features on to child XIncludeHandler objects
@@ -343,8 +346,8 @@
     private int[] fState = new int[INITIAL_SIZE];
 
     // buffering the necessary DTD events
-    private final ArrayList<Notation> fNotations;
-    private final ArrayList<UnparsedEntity> fUnparsedEntities;
+    private final List<Notation> fNotations;
+    private final List<UnparsedEntity> fUnparsedEntities;
 
     // flags which control whether base URI or language fixup is performed.
     private boolean fFixupBaseURIs = true;
@@ -388,13 +391,13 @@
         fUnparsedEntities = new ArrayList<>();
 
         fBaseURIScope = new IntStack();
-        fBaseURI = new Stack();
-        fLiteralSystemID = new Stack();
-        fExpandedSystemID = new Stack();
+        fBaseURI = new Stack<>();
+        fLiteralSystemID = new Stack<>();
+        fExpandedSystemID = new Stack<>();
         fCurrentBaseURI = new XMLResourceIdentifierImpl();
 
         fLanguageScope = new IntStack();
-        fLanguageStack = new Stack();
+        fLanguageStack = new Stack<>();
         fCurrentLanguage = null;
     }
 
@@ -2091,9 +2094,9 @@
             }
 
             // Modify attributes of included items to do namespace-fixup. (spec 4.5.4)
-            Enumeration inscopeNS = fNamespaceContext.getAllPrefixes();
+            Enumeration<String> inscopeNS = fNamespaceContext.getAllPrefixes();
             while (inscopeNS.hasMoreElements()) {
-                String prefix = (String)inscopeNS.nextElement();
+                String prefix = inscopeNS.nextElement();
                 String parentURI =
                     fNamespaceContext.getURIFromIncludeParent(prefix);
                 String uri = fNamespaceContext.getURI(prefix);
@@ -2524,7 +2527,7 @@
         ent.name = entName;
         int index = fUnparsedEntities.indexOf(ent);
         if (index != -1) {
-            ent = (UnparsedEntity)fUnparsedEntities.get(index);
+            ent = fUnparsedEntities.get(index);
             // first check the notation of the unparsed entity
             checkNotation(ent.notation);
             checkAndSendUnparsedEntity(ent);
@@ -2543,7 +2546,7 @@
         not.name = notName;
         int index = fNotations.indexOf(not);
         if (index != -1) {
-            not = (Notation)fNotations.get(index);
+            not = fNotations.get(index);
             checkAndSendNotation(not);
         }
     }
@@ -2582,8 +2585,7 @@
                 }
             }
             else {
-                UnparsedEntity localEntity =
-                    (UnparsedEntity)fUnparsedEntities.get(index);
+                UnparsedEntity localEntity = fUnparsedEntities.get(index);
                 if (!ent.isDuplicate(localEntity)) {
                     reportFatalError(
                         "NonDuplicateUnparsedEntity",
@@ -2620,7 +2622,7 @@
                 }
             }
             else {
-                Notation localNotation = (Notation)fNotations.get(index);
+                Notation localNotation = fNotations.get(index);
                 if (!not.isDuplicate(localNotation)) {
                     reportFatalError(
                         "NonDuplicateNotation",
@@ -2681,7 +2683,7 @@
     protected void copyFeatures(
         XMLComponentManager from,
         ParserConfigurationSettings to) {
-        Enumeration features = Constants.getXercesFeatures();
+        Enumeration<Object> features = Constants.getXercesFeatures();
         copyFeatures1(features, Constants.XERCES_FEATURE_PREFIX, from, to);
         features = Constants.getSAXFeatures();
         copyFeatures1(features, Constants.SAX_FEATURE_PREFIX, from, to);
@@ -2690,14 +2692,14 @@
     protected void copyFeatures(
         XMLComponentManager from,
         XMLParserConfiguration to) {
-        Enumeration features = Constants.getXercesFeatures();
+        Enumeration<Object> features = Constants.getXercesFeatures();
         copyFeatures1(features, Constants.XERCES_FEATURE_PREFIX, from, to);
         features = Constants.getSAXFeatures();
         copyFeatures1(features, Constants.SAX_FEATURE_PREFIX, from, to);
     }
 
     private void copyFeatures1(
-        Enumeration features,
+        Enumeration<Object> features,
         String featurePrefix,
         XMLComponentManager from,
         ParserConfigurationSettings to) {
@@ -2717,7 +2719,7 @@
     }
 
     private void copyFeatures1(
-        Enumeration features,
+        Enumeration<Object> features,
         String featurePrefix,
         XMLComponentManager from,
         XMLParserConfiguration to) {
@@ -2872,7 +2874,7 @@
      */
     public String getBaseURI(int depth) {
         int scope = scopeOfBaseURI(depth);
-        return (String)fExpandedSystemID.elementAt(scope);
+        return fExpandedSystemID.get(scope);
     }
 
     /**
@@ -2882,7 +2884,7 @@
      */
     public String getLanguage(int depth) {
         int scope = scopeOfLanguage(depth);
-        return (String)fLanguageStack.elementAt(scope);
+        return fLanguageStack.get(scope);
     }
 
     /**
@@ -2902,9 +2904,9 @@
             // If that is the last system id, then we don't need a relative URI
             return "";
         }
-        URI uri = new URI("file", (String)fLiteralSystemID.elementAt(start));
+        URI uri = new URI("file", fLiteralSystemID.get(start));
         for (int i = start + 1; i < fBaseURIScope.size(); i++) {
-            uri = new URI(uri, (String)fLiteralSystemID.elementAt(i));
+            uri = new URI(uri, fLiteralSystemID.get(i));
         }
         return uri.getPath();
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.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,6 +21,17 @@
 
 package com.sun.org.apache.xerces.internal.xinclude;
 
+import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
+import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
+import com.sun.org.apache.xerces.internal.impl.io.ASCIIReader;
+import com.sun.org.apache.xerces.internal.impl.io.UTF8Reader;
+import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
+import com.sun.org.apache.xerces.internal.util.EncodingMap;
+import com.sun.org.apache.xerces.internal.util.HTTPInputSource;
+import com.sun.org.apache.xerces.internal.util.MessageFormatter;
+import com.sun.org.apache.xerces.internal.util.XMLChar;
+import com.sun.org.apache.xerces.internal.xni.XMLString;
+import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
 import java.io.BufferedInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -33,18 +44,6 @@
 import java.util.Locale;
 import java.util.Map;
 
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.io.ASCIIReader;
-import com.sun.org.apache.xerces.internal.impl.io.UTF8Reader;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.EncodingMap;
-import com.sun.org.apache.xerces.internal.util.HTTPInputSource;
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
 /**
  * This class is used for reading resources requested in &lt;include&gt; elements,
  * when the parse attribute of the &lt;include&gt; element is "text".  Using this
@@ -133,10 +132,10 @@
                     final HTTPInputSource httpInputSource = (HTTPInputSource) source;
 
                     // set request properties
-                    Iterator propIter = httpInputSource.getHTTPRequestProperties();
+                    Iterator<Map.Entry<String, String>> propIter = httpInputSource.getHTTPRequestProperties();
                     while (propIter.hasNext()) {
-                        Map.Entry entry = (Map.Entry) propIter.next();
-                        urlConnection.setRequestProperty((String) entry.getKey(), (String) entry.getValue());
+                        Map.Entry<String, String> entry = propIter.next();
+                        urlConnection.setRequestProperty(entry.getKey(), entry.getValue());
                     }
 
                     // set preference for redirection
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xni/Augmentations.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xni/Augmentations.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
@@ -79,7 +79,7 @@
      * Returns an enumeration of the keys in the Augmentations structure
      *
      */
-    public Enumeration keys ();
+    public Enumeration<Object> keys ();
 
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xni/NamespaceContext.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xni/NamespaceContext.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
@@ -22,7 +22,6 @@
 package com.sun.org.apache.xerces.internal.xni;
 
 import java.util.Enumeration;
-import java.util.Vector;
 
 /**
  * Represents an interface to query namespace information.
@@ -163,7 +162,7 @@
      * that have not been overridden.
          * @return Enumeration
          */
-    public Enumeration getAllPrefixes();
+    public Enumeration<String> getAllPrefixes();
 
     /**
      * Reset this Namespace support object for reuse.
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/LSInputList.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/LSInputList.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
@@ -22,7 +22,6 @@
 package com.sun.org.apache.xerces.internal.xs;
 
 import java.util.List;
-
 import org.w3c.dom.ls.LSInput;
 
 /**
@@ -30,7 +29,7 @@
  * ordered collection of <code>LSInput</code>s, without defining or
  * constraining how this collection is implemented.
  */
-public interface LSInputList extends List {
+public interface LSInputList extends List<LSInput> {
     /**
      *  The number of <code>LSInput</code>s in the list. The range of valid
      * child object indices is 0 to <code>length-1</code> inclusive.
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/ShortList.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/ShortList.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
@@ -27,7 +27,7 @@
  *  The <code>ShortList</code> is an immutable ordered collection of
  * <code>unsigned short</code>.
  */
-public interface ShortList extends List {
+public interface ShortList extends List<Short> {
     /**
      *  The number of <code>unsigned short</code>s in the list. The range of
      * valid child object indices is 0 to <code>length-1</code> inclusive.
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/StringList.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/StringList.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
@@ -27,7 +27,7 @@
  *  The <code>StringList</code> is an immutable ordered collection of
  * <code>GenericString</code>.
  */
-public interface StringList extends List {
+public interface StringList extends List<String> {
     /**
      *  The number of <code>GenericString</code>s in the list. The range of
      * valid child object indices is 0 to <code>length-1</code> inclusive.
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamedMap.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamedMap.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
@@ -22,6 +22,7 @@
 package com.sun.org.apache.xerces.internal.xs;
 
 import java.util.Map;
+import javax.xml.namespace.QName;
 
 /**
  * Objects implementing the <code>XSNamedMap</code> interface are used to
@@ -30,7 +31,7 @@
  * <code>XSObjectList</code>. The <code>XSObject</code>s in
  * <code>XSNamedMap</code>s are not maintained in any particular order.
  */
-public interface XSNamedMap extends Map {
+public interface XSNamedMap extends Map<QName, XSObject> {
     /**
      * The number of <code>XSObjects</code> in the <code>XSObjectList</code>.
      * The range of valid child object indices is 0 to <code>length-1</code>
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.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
@@ -28,7 +28,7 @@
  * an immutable ordered collection of <code>XSNamespaceItem</code>s, without
  * defining or constraining how this collection is implemented.
  */
-public interface XSNamespaceItemList extends List {
+public interface XSNamespaceItemList extends List<XSNamespaceItem> {
     /**
      *  The number of <code>XSNamespaceItem</code>s in the list. The range of
      * valid child object indices is 0 to <code>length-1</code> inclusive.
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSObjectList.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/XSObjectList.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
@@ -28,7 +28,7 @@
  * immutable ordered collection of <code>XSObject</code>s, without defining
  * or constraining how this collection is implemented.
  */
-public interface XSObjectList extends List {
+public interface XSObjectList extends List<XSObject> {
     /**
      *  The number of <code>XSObjects</code> in the list. The range of valid
      * child object indices is 0 to <code>length-1</code> inclusive.
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.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,10 +21,9 @@
 
 package com.sun.org.apache.xerces.internal.xs.datatypes;
 
+import com.sun.org.apache.xerces.internal.xs.XSException;
 import java.util.List;
 
-import com.sun.org.apache.xerces.internal.xs.XSException;
-
 /**
  * <p>The <code>ByteList</code> is an immutable ordered collection of
  * <code>byte</code>.</p>
@@ -32,7 +31,7 @@
  * @author Ankit Pasricha, IBM
  *
  */
-public interface ByteList extends List {
+public interface ByteList extends List<Byte> {
 
     /**
      * The number of <code>byte</code>s in the list. The range of
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.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
@@ -30,7 +30,7 @@
  * @author Ankit Pasricha, IBM
  *
  */
-public interface ObjectList extends List {
+public interface ObjectList extends List<Object> {
 
     /**
      * The number of <code>Object</code>s in the list. The range of
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/CustomStringPool.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/CustomStringPool.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -55,7 +56,7 @@
     }
 
     public void removeAllElements() {
-        m_intToString.removeAllElements();
+        m_intToString.clear();
         if (m_stringToInt != null) {
             m_stringToInt.clear();
         }
@@ -63,13 +64,13 @@
 
     /**
      * @return string whose value is uniquely identified by this integer index.
-     * @throws java.lang.ArrayIndexOutOfBoundsException if index doesn't map to
+     * @throws java.lang.IndexOutOfBoundsException if index doesn't map to
      * a string.
      */
     @Override
     public String indexToString(int i)
-            throws java.lang.ArrayIndexOutOfBoundsException {
-        return (String) m_intToString.elementAt(i);
+            throws IndexOutOfBoundsException {
+        return m_intToString.get(i);
     }
 
     /**
@@ -82,7 +83,7 @@
         }
         Integer iobj = m_stringToInt.get(s);
         if (iobj == null) {
-            m_intToString.addElement(s);
+            m_intToString.add(s);
             iobj = m_intToString.size();
             m_stringToInt.put(s, iobj);
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBase.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBase.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
@@ -22,20 +22,15 @@
 package com.sun.org.apache.xml.internal.dtm.ref;
 
 import com.sun.org.apache.xml.internal.dtm.*;
-import com.sun.org.apache.xml.internal.utils.SuballocatedIntVector;
+import com.sun.org.apache.xml.internal.res.XMLErrorResources;
+import com.sun.org.apache.xml.internal.res.XMLMessages;
 import com.sun.org.apache.xml.internal.utils.BoolStack;
-
-import java.util.Vector;
-
-import javax.xml.transform.Source;
-
+import com.sun.org.apache.xml.internal.utils.SuballocatedIntVector;
 import com.sun.org.apache.xml.internal.utils.XMLString;
 import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-
 import java.io.*; // for dumpDTM
+import java.util.Vector;
+import javax.xml.transform.Source;
 
 /**
  * The <code>DTMDefaultBase</code> class serves as a helper base for DTMs.
@@ -74,7 +69,7 @@
   protected SuballocatedIntVector m_parent;
 
   /** Vector of SuballocatedIntVectors of NS decl sets */
-  protected Vector m_namespaceDeclSets = null;
+  protected Vector<SuballocatedIntVector> m_namespaceDeclSets = null;
 
   /** SuballocatedIntVector  of elements at which corresponding
    * namespaceDeclSets were defined */
@@ -1241,12 +1236,9 @@
     return DTM.NULL;
   }
 
-  /** Lazily created namespace lists. */
-  private Vector m_namespaceLists = null;  // on demand
-
 
   /** Build table of namespace declaration
-   * locations during DTM construction. Table is a Vector of
+   * locations during DTM construction. Table is aArrayList<>of
    * SuballocatedIntVectors containing the namespace node HANDLES declared at
    * that ID, plus an SuballocatedIntVector of the element node INDEXES at which
    * these declarations appeared.
@@ -1267,9 +1259,9 @@
         // First
         m_namespaceDeclSetElements=new SuballocatedIntVector(32);
         m_namespaceDeclSetElements.addElement(elementNodeIndex);
-        m_namespaceDeclSets=new Vector();
+        m_namespaceDeclSets=new Vector<>();
         nsList=new SuballocatedIntVector(32);
-        m_namespaceDeclSets.addElement(nsList);
+        m_namespaceDeclSets.add(nsList);
       }
     else
       {
@@ -1279,7 +1271,7 @@
 
         if(last>=0 && elementNodeIndex==m_namespaceDeclSetElements.elementAt(last))
           {
-            nsList=(SuballocatedIntVector)m_namespaceDeclSets.elementAt(last);
+            nsList=m_namespaceDeclSets.get(last);
           }
       }
     if(nsList==null)
@@ -1308,7 +1300,7 @@
             nsList=new SuballocatedIntVector(32);
         }
 
-        m_namespaceDeclSets.addElement(nsList);
+        m_namespaceDeclSets.add(nsList);
       }
 
     // Handle overwriting inherited.
@@ -1344,7 +1336,7 @@
         int wouldBeAt=findInSortedSuballocatedIntVector(m_namespaceDeclSetElements,
                                             elementNodeIndex);
         if(wouldBeAt>=0) // Found it
-          return (SuballocatedIntVector) m_namespaceDeclSets.elementAt(wouldBeAt);
+          return m_namespaceDeclSets.get(wouldBeAt);
         if(wouldBeAt == -1) // -1-wouldbeat == 0
           return null; // Not after anything; definitely not found
 
@@ -1372,7 +1364,7 @@
           }
 
           if (candidate == uppermostNSCandidateID) {
-            return (SuballocatedIntVector)m_namespaceDeclSets.elementAt(wouldBeAt);
+            return m_namespaceDeclSets.get(wouldBeAt);
           }
         }
 
@@ -1380,7 +1372,7 @@
           {
             if (candidate==ancestor) {
                 // Found ancestor in list
-                return (SuballocatedIntVector)m_namespaceDeclSets.elementAt(wouldBeAt);
+                return m_namespaceDeclSets.get(wouldBeAt);
             } else if (candidate<ancestor) {
                 // Too deep in tree
                 do {
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.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
@@ -24,16 +24,16 @@
 
 package com.sun.org.apache.xml.internal.dtm.ref;
 
-import java.util.Vector;
-
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMDOMException;
 import com.sun.org.apache.xpath.internal.NodeSet;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Objects;
-
 import org.w3c.dom.Attr;
 import org.w3c.dom.CDATASection;
 import org.w3c.dom.Comment;
+import org.w3c.dom.DOMConfiguration;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.Document;
@@ -46,10 +46,8 @@
 import org.w3c.dom.NodeList;
 import org.w3c.dom.ProcessingInstruction;
 import org.w3c.dom.Text;
-
+import org.w3c.dom.TypeInfo;
 import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.TypeInfo;
 
 /**
  * <code>DTMNodeProxy</code> presents a DOM Node API front-end to the DTM model.
@@ -782,7 +780,7 @@
   @Override
   public final NodeList getElementsByTagName(String tagname)
   {
-       Vector listVector = new Vector();
+       List<Node> listVector = new ArrayList<>();
        Node retNode = dtm.getNode(node);
        if (retNode != null)
        {
@@ -804,7 +802,7 @@
        NodeSet nodeSet = new NodeSet(size);
        for (int i = 0; i < size; i++)
        {
-         nodeSet.addNode((Node) listVector.elementAt(i));
+         nodeSet.addNode(listVector.get(i));
        }
        return (NodeList) nodeSet;
   }
@@ -819,12 +817,8 @@
    *
    * Private method to be used for recursive iterations to obtain elements by tag name.
    */
-  private final void traverseChildren
-  (
-    Vector listVector,
-    Node tempNode,
-    String tagname,
-    boolean isTagNameWildCard) {
+  private final void traverseChildren(List<Node> listVector, Node tempNode,
+          String tagname, boolean isTagNameWildCard) {
     if (tempNode == null)
     {
       return;
@@ -913,7 +907,7 @@
   public final NodeList getElementsByTagNameNS(String namespaceURI,
                                                String localName)
   {
-    Vector listVector = new Vector();
+    List<Node> listVector = new ArrayList<>();
     Node retNode = dtm.getNode(node);
     if (retNode != null)
     {
@@ -936,7 +930,7 @@
     NodeSet nodeSet = new NodeSet(size);
     for (int i = 0; i < size; i++)
     {
-      nodeSet.addNode((Node)listVector.elementAt(i));
+      nodeSet.addNode(listVector.get(i));
     }
     return (NodeList) nodeSet;
   }
@@ -952,14 +946,9 @@
    * Private method to be used for recursive iterations to obtain elements by tag name
    * and namespaceURI.
    */
-  private final void traverseChildren
-  (
-   Vector listVector,
-   Node tempNode,
-   String namespaceURI,
-   String localname,
-   boolean isNamespaceURIWildCard,
-   boolean isLocalNameWildCard)
+  private final void traverseChildren(List<Node> listVector, Node tempNode,
+          String namespaceURI, String localname, boolean isNamespaceURIWildCard,
+          boolean isLocalNameWildCard)
    {
     if (tempNode == null)
     {
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMStringPool.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMStringPool.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,9 +21,9 @@
 
 package com.sun.org.apache.xml.internal.dtm.ref;
 
-import java.util.Vector;
-
 import com.sun.org.apache.xml.internal.utils.IntVector;
+import java.util.ArrayList;
+import java.util.List;
 
 /** <p>DTMStringPool is an "interning" mechanism for strings. It will
  * create a stable 1:1 mapping between a set of string values and a set of
@@ -56,7 +56,7 @@
  * */
 public class DTMStringPool
 {
-  Vector m_intToString;
+  List<String> m_intToString;
   static final int HASHPRIME=101;
   int[] m_hashStart=new int[HASHPRIME];
   IntVector m_hashChain;
@@ -69,8 +69,8 @@
    */
   public DTMStringPool(int chainSize)
     {
-      m_intToString=new Vector();
-      m_hashChain=new IntVector(chainSize);
+      m_intToString = new ArrayList<>();
+      m_hashChain= new IntVector(chainSize);
       removeAllElements();
 
       // -sb Add this to force empty strings to be index 0.
@@ -84,21 +84,21 @@
 
   public void removeAllElements()
     {
-      m_intToString.removeAllElements();
+      m_intToString.clear();
       for(int i=0;i<HASHPRIME;++i)
         m_hashStart[i]=NULL;
       m_hashChain.removeAllElements();
     }
 
   /** @return string whose value is uniquely identified by this integer index.
-   * @throws java.lang.ArrayIndexOutOfBoundsException
+   * @throws java.lang.IndexOutOfBoundsException
    *  if index doesn't map to a string.
    * */
   public String indexToString(int i)
-    throws java.lang.ArrayIndexOutOfBoundsException
+    throws java.lang.IndexOutOfBoundsException
     {
       if(i==NULL) return null;
-      return (String) m_intToString.elementAt(i);
+      return m_intToString.get(i);
     }
 
   /** @return integer index uniquely identifying the value of this string. */
@@ -114,7 +114,7 @@
       int hashcandidate=hashlast;
       while(hashcandidate!=NULL)
         {
-          if(m_intToString.elementAt(hashcandidate).equals(s))
+          if(m_intToString.get(hashcandidate).equals(s))
             return hashcandidate;
 
           hashlast=hashcandidate;
@@ -123,7 +123,7 @@
 
       // New value. Add to tables.
       int newIndex=m_intToString.size();
-      m_intToString.addElement(s);
+      m_intToString.add(s);
 
       m_hashChain.addElement(NULL);     // Initialize to no-following-same-hash
       if(hashlast==NULL)  // First for this hash
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -20,15 +21,13 @@
 
 package com.sun.org.apache.xml.internal.dtm.ref;
 
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+import com.sun.org.apache.xerces.internal.parsers.SAXParser;
+import com.sun.org.apache.xml.internal.res.XMLErrorResources;
+import com.sun.org.apache.xml.internal.res.XMLMessages;
 import java.io.IOException;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
-
-import com.sun.org.apache.xerces.internal.parsers.SAXParser;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.XMLReader;
@@ -57,7 +56,7 @@
   Method fConfigSetInput=null; // Xerces2 method
   Method fConfigParse=null; // Xerces2 method
   Method fSetInputSource=null; // Xerces2 pull control method
-  Constructor fConfigInputSourceCtor=null; // Xerces2 initialization method
+  Constructor<?> fConfigInputSourceCtor=null; // Xerces2 initialization method
   Method fConfigSetByteStream=null; // Xerces2 initialization method
   Method fConfigSetCharStream=null; // Xerces2 initialization method
   Method fConfigSetEncoding=null; // Xerces2 initialization method
@@ -100,16 +99,16 @@
                         // this will simplify significantly.
 
                         // If we can't get the magic constructor, no need to look further.
-                        Class xniConfigClass=ObjectFactory.findProviderClass(
+                        Class<?> xniConfigClass=ObjectFactory.findProviderClass(
                             "com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration",
                             true);
-                        Class[] args1={xniConfigClass};
-                        Constructor ctor=SAXParser.class.getConstructor(args1);
+                        Class<?>[] args1={xniConfigClass};
+                        Constructor<?> ctor=SAXParser.class.getConstructor(args1);
 
                         // Build the parser configuration object. StandardParserConfiguration
                         // happens to implement XMLPullParserConfiguration, which is the API
                         // we're going to want to use.
-                        Class xniStdConfigClass=ObjectFactory.findProviderClass(
+                        Class<?> xniStdConfigClass=ObjectFactory.findProviderClass(
                             "com.sun.org.apache.xerces.internal.parsers.StandardParserConfiguration",
                             true);
                         fPullParserConfig=xniStdConfigClass.getConstructor().newInstance();
@@ -119,24 +118,24 @@
                         // Preload all the needed the configuration methods... I want to know they're
                         // all here before we commit to trying to use them, just in case the
                         // API changes again.
-                        Class fXniInputSourceClass=ObjectFactory.findProviderClass(
+                        Class<?> fXniInputSourceClass=ObjectFactory.findProviderClass(
                             "com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource",
                             true);
-                        Class[] args3={fXniInputSourceClass};
+                        Class<?>[] args3={fXniInputSourceClass};
                         fConfigSetInput=xniStdConfigClass.getMethod("setInputSource",args3);
 
-                        Class[] args4={String.class,String.class,String.class};
+                        Class<?>[] args4={String.class,String.class,String.class};
                         fConfigInputSourceCtor=fXniInputSourceClass.getConstructor(args4);
-                        Class[] args5={java.io.InputStream.class};
+                        Class<?>[] args5={java.io.InputStream.class};
                         fConfigSetByteStream=fXniInputSourceClass.getMethod("setByteStream",args5);
-                        Class[] args6={java.io.Reader.class};
+                        Class<?>[] args6={java.io.Reader.class};
                         fConfigSetCharStream=fXniInputSourceClass.getMethod("setCharacterStream",args6);
-                        Class[] args7={String.class};
+                        Class<?>[] args7={String.class};
                         fConfigSetEncoding=fXniInputSourceClass.getMethod("setEncoding",args7);
 
-                        Class[] argsb={Boolean.TYPE};
+                        Class<?>[] argsb={Boolean.TYPE};
                         fConfigParse=xniStdConfigClass.getMethod("parse",argsb);
-                        Class[] noargs=new Class[0];
+                        Class<?>[] noargs=new Class<?>[0];
                         fReset=fIncrementalParser.getClass().getMethod("reset",noargs);
                 }
                 catch(Exception e)
@@ -172,10 +171,10 @@
                 // Xerces2 incremental support is made available on previously
                 // constructed SAXParser instances.
     fIncrementalParser=parser;
-                Class me=parser.getClass();
-    Class[] parms={InputSource.class};
+                Class<?> me=parser.getClass();
+    Class<?>[] parms={InputSource.class};
     fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
-    parms=new Class[0];
+    parms=new Class<?>[0];
     fParseSome=me.getMethod("parseSome",parms);
     // Fallback if this fails (implemented in createIncrementalSAXSource) is
     // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTM.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTM.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,11 +21,6 @@
 
 package com.sun.org.apache.xml.internal.dtm.ref.dom2dtm;
 
-import java.util.Vector;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.dom.DOMSource;
-
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMManager;
 import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
@@ -42,6 +37,10 @@
 import com.sun.org.apache.xml.internal.utils.XMLCharacterRecognizer;
 import com.sun.org.apache.xml.internal.utils.XMLString;
 import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.transform.SourceLocator;
+import javax.xml.transform.dom.DOMSource;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentType;
@@ -102,7 +101,7 @@
    * Text/CDATASection nodes in the DOM have been coalesced into a
    * single DTM Text node); this table points only to the first in
    * that sequence. */
-  protected Vector m_nodes = new Vector();
+  protected List<Node> m_nodes = new ArrayList<>();
 
   /**
    * Construct a DOM2DTM object from a DOM node.
@@ -243,7 +242,7 @@
       }
     }
 
-    m_nodes.addElement(node);
+    m_nodes.add(node);
 
     m_firstch.setElementAt(NOTPROCESSED,nodeIndex);
     m_nextsib.setElementAt(NOTPROCESSED,nodeIndex);
@@ -606,7 +605,7 @@
 
     int identity = makeNodeIdentity(nodeHandle);
 
-    return (Node) m_nodes.elementAt(identity);
+    return m_nodes.get(identity);
   }
 
   /**
@@ -618,7 +617,7 @@
    */
   protected Node lookupNode(int nodeIdentity)
   {
-    return (Node) m_nodes.elementAt(nodeIdentity);
+    return m_nodes.get(nodeIdentity);
   }
 
   /**
@@ -672,7 +671,7 @@
       {
         for (; i < len; i++)
         {
-          if (m_nodes.elementAt(i) == node)
+          if (m_nodes.get(i) == node)
             return makeNodeHandle(i);
         }
 
@@ -1025,7 +1024,7 @@
     {
       int id=makeNodeIdentity(nodeHandle);
       if(NULL==id) return null;
-      Node newnode=(Node)m_nodes.elementAt(id);
+      Node newnode=m_nodes.get(id);
       String newname=newnode.getLocalName();
       if (null == newname)
       {
@@ -1145,7 +1144,7 @@
     {
       int id=makeNodeIdentity(nodeHandle);
       if(id==NULL) return null;
-      Node node=(Node)m_nodes.elementAt(id);
+      Node node=m_nodes.get(id);
       return node.getNamespaceURI();
     }
     else
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -42,6 +43,7 @@
 import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Vector;
 import javax.xml.transform.Source;
@@ -176,7 +178,7 @@
    * Vector of entities.  Each record is composed of four Strings:
    *  publicId, systemID, notationName, and name.
    */
-  private ArrayList<String> m_entities = null;
+  private List<String> m_entities = null;
 
   /** m_entities public ID offset. */
   private static final int ENTITY_FIELD_PUBLICID = 0;
@@ -1359,7 +1361,7 @@
       } while ((uriIndex & 0x01) == 0);
 
       if (uriIndex >= 0) {
-        prefix = m_prefixMappings.elementAt(uriIndex - 1);
+        prefix = m_prefixMappings.get(uriIndex - 1);
       } else if (null != qname) {
         int indexOfNSSep = qname.indexOf(':');
 
@@ -1425,7 +1427,7 @@
     } while ((prefixIndex >= 0) && (prefixIndex & 0x01) == 0x01);
 
     if (prefixIndex > -1) {
-      uri = m_prefixMappings.elementAt(prefixIndex + 1);
+      uri = m_prefixMappings.get(prefixIndex + 1);
     }
 
     return uri;
@@ -1685,8 +1687,8 @@
 
     if(null == prefix)
       prefix = "";
-    m_prefixMappings.addElement(prefix);  // JDK 1.1.x compat -sc
-    m_prefixMappings.addElement(uri);  // JDK 1.1.x compat -sc
+    m_prefixMappings.add(prefix);
+    m_prefixMappings.add(uri);
   }
 
   /**
@@ -1740,7 +1742,7 @@
     int nDecls = prefixMappings.size();
 
     for (int i = startDecls; i < nDecls; i += 2) {
-      String prefixDecl = prefixMappings.elementAt(i);
+      String prefixDecl = prefixMappings.get(i);
 
       if (prefixDecl == null)
         continue;
@@ -1834,12 +1836,12 @@
     }
 
     for (int i = startDecls; i < nDecls; i += 2) {
-      prefix = m_prefixMappings.elementAt(i);
+      prefix = m_prefixMappings.get(i);
 
       if (prefix == null)
         continue;
 
-      String declURL = m_prefixMappings.elementAt(i + 1);
+      String declURL = m_prefixMappings.get(i + 1);
 
       exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE);
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -28,15 +29,16 @@
 import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
 import com.sun.org.apache.xml.internal.dtm.ref.ExpandedNameTable;
 import com.sun.org.apache.xml.internal.dtm.ref.ExtendedType;
+import com.sun.org.apache.xml.internal.res.XMLErrorResources;
+import com.sun.org.apache.xml.internal.res.XMLMessages;
+import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
 import com.sun.org.apache.xml.internal.utils.FastStringBuffer;
+import com.sun.org.apache.xml.internal.utils.SuballocatedIntVector;
 import com.sun.org.apache.xml.internal.utils.XMLString;
 import com.sun.org.apache.xml.internal.utils.XMLStringDefault;
 import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xml.internal.utils.SuballocatedIntVector;
 import java.util.ArrayList;
+import java.util.List;
 import javax.xml.transform.Source;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
@@ -1267,7 +1269,6 @@
         _startNode = node;
 
         while (nodeID != END) {
-          //m_ancestors.addElement(node);
           if (m_size >= m_ancestors.length)
           {
             int[] newAncestors = new int[m_size * 2];
@@ -1746,13 +1747,13 @@
   // %OPT% Cache the array of extended types in this class
   protected ExtendedType[] m_extendedTypes;
 
-  // A Vector which is used to store the values of attribute, namespace,
+  // A List which is used to store the values of attribute, namespace,
   // comment and PI nodes.
   //
   // %OPT% These values are unlikely to be equal. Storing
-  // them in a plain Vector is more efficient than storing in the
+  // them in a plain List is more efficient than storing in the
   // DTMStringPool because we can save the cost for hash calculation.
-  protected ArrayList<String> m_values;
+  protected List<String> m_values;
 
   // The current index into the m_values Vector.
   private int m_valueIndex = 0;
@@ -1873,7 +1874,7 @@
    */
   public final int _exptype2(int identity)
   {
-    //return m_exptype.elementAt(identity);
+    //return m_exptype.get(identity);
 
     if (identity < m_blocksize)
       return m_exptype_map0[identity];
@@ -1889,7 +1890,7 @@
    */
   public final int _nextsib2(int identity)
   {
-    //return m_nextsib.elementAt(identity);
+    //return m_nextsib.get(identity);
 
     if (identity < m_blocksize)
       return m_nextsib_map0[identity];
@@ -2063,12 +2064,12 @@
     }
 
     for (int i = startDecls; i < nDecls; i += 2) {
-      prefix = m_prefixMappings.elementAt(i);
+      prefix = m_prefixMappings.get(i);
 
       if (prefix == null)
         continue;
 
-      String declURL = m_prefixMappings.elementAt(i + 1);
+      String declURL = m_prefixMappings.get(i + 1);
 
       exName = m_expandedNameTable.getExpandedTypeID(null, prefix,
                                                      DTM.NAMESPACE_NODE);
@@ -3185,9 +3186,7 @@
         // doing anything.
         if (m_namespaceDeclSetElements != null &&
             m_namespaceDeclSetElements.size() == 1 &&
-            m_namespaceDeclSets != null &&
-            ((SuballocatedIntVector)m_namespaceDeclSets.elementAt(0))
-            .size() == 1)
+            m_namespaceDeclSets != null && (m_namespaceDeclSets.get(0)).size() == 1)
             return;
 
         SuballocatedIntVector nsContext = null;
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2RTFDTM.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2RTFDTM.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,8 +21,6 @@
 
 package com.sun.org.apache.xml.internal.dtm.ref.sax2dtm;
 
-import javax.xml.transform.Source;
-
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMManager;
 import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
@@ -30,7 +28,8 @@
 import com.sun.org.apache.xml.internal.utils.IntVector;
 import com.sun.org.apache.xml.internal.utils.StringVector;
 import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-
+import java.util.Vector;
+import javax.xml.transform.Source;
 import org.xml.sax.SAXException;
 
 /**
@@ -225,7 +224,7 @@
   {
     // Re-initialize the tree append process
     m_endDocumentOccured = false;
-    m_prefixMappings = new java.util.Vector();
+    m_prefixMappings = new Vector<>();
     m_contextIndexes = new IntStack();
     m_parents = new IntStack();
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -53,9 +54,10 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.Writer;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
-import java.util.Vector;
 import org.w3c.dom.DOMError;
 import org.w3c.dom.DOMErrorHandler;
 import org.w3c.dom.Document;
@@ -161,10 +163,10 @@
 
 
     /**
-     * Vector holding comments and PIs that come before the root
+     * List holding comments and PIs that come before the root
      * element (even after it), see {@link #serializePreRoot}.
      */
-    private Vector          _preRoot;
+    private List<String> _preRoot;
 
 
     /**
@@ -641,8 +643,8 @@
         // the PI directly but place it in the pre-root vector.
         if ( isDocumentState() ) {
             if ( _preRoot == null )
-                _preRoot = new Vector();
-            _preRoot.addElement( fStrBuffer.toString() );
+                _preRoot = new ArrayList<>();
+            _preRoot.add( fStrBuffer.toString() );
         } else {
             _printer.indent();
             printText( fStrBuffer.toString(), true, true );
@@ -688,8 +690,8 @@
         // the comment directly but place it in the pre-root vector.
         if ( isDocumentState() ) {
             if ( _preRoot == null )
-                _preRoot = new Vector();
-            _preRoot.addElement( fStrBuffer.toString() );
+                _preRoot = new ArrayList<>();
+            _preRoot.add( fStrBuffer.toString() );
         } else {
             // Indent this element on a new line if the first
             // content of the parent element or immediately
@@ -1479,11 +1481,11 @@
 
         if ( _preRoot != null ) {
             for ( i = 0 ; i < _preRoot.size() ; ++i ) {
-                printText( (String) _preRoot.elementAt( i ), true, true );
+                printText(_preRoot.get( i ), true, true );
                 if ( _indenting )
                 _printer.breakLine();
             }
-            _preRoot.removeAllElements();
+            _preRoot.clear();
         }
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -19,14 +20,6 @@
  */
 package com.sun.org.apache.xml.internal.serialize;
 
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-
 import com.sun.org.apache.xerces.internal.dom.AbortException;
 import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
 import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl;
@@ -41,6 +34,14 @@
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
 import com.sun.org.apache.xerces.internal.util.XML11Char;
 import com.sun.org.apache.xerces.internal.util.XMLChar;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Comment;
 import org.w3c.dom.DOMConfiguration;
@@ -334,7 +335,7 @@
     public DOMStringList getParameterNames() {
 
         if (fRecognizedParameters == null) {
-            ArrayList parameters = new ArrayList();
+            List<String> parameters = new ArrayList<>();
 
             //Add DOM recognized parameters
             //REVISIT: Would have been nice to have a list of
@@ -873,7 +874,7 @@
                     ? (Document) node
                     : node.getOwnerDocument();
             try {
-                versionChanged = document.getClass().getMethod("isXMLVersionChanged()", new Class[]{});
+                versionChanged = document.getClass().getMethod("isXMLVersionChanged()", new Class<?>[]{});
                 if (versionChanged != null) {
                     verifyNames = ((Boolean) versionChanged.invoke(document, (Object[]) null)).booleanValue();
                 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Encodings.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Encodings.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -64,7 +65,7 @@
     // note that the size of this Map
     // is bounded by the number of encodings recognized by EncodingMap;
     // therefore it poses no static mutability risk.
-    private static final Map<String, EncodingInfo> _encodings = new ConcurrentHashMap();
+    private static final Map<String, EncodingInfo> _encodings = new ConcurrentHashMap<>();
 
     /**
      * @param encoding a MIME charset name, or null.
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -51,7 +51,7 @@
     public static final String FactoriesProperty = "com.sun.org.apache.xml.internal.serialize.factories";
 
 
-    private static final Map<String, SerializerFactory>  _factories = Collections.synchronizedMap(new HashMap());
+    private static final Map<String, SerializerFactory>  _factories = Collections.synchronizedMap(new HashMap<>());
 
 
     static
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -33,18 +34,16 @@
 
 package com.sun.org.apache.xml.internal.serialize;
 
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.Map;
-
 import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
 import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
 import com.sun.org.apache.xerces.internal.util.XMLChar;
 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.Map;
 import org.w3c.dom.Attr;
 import org.w3c.dom.DOMError;
 import org.w3c.dom.Document;
@@ -341,12 +340,10 @@
             }
 
             if (_prefixes != null) {
-                Iterator entries = _prefixes.entrySet().iterator();
-                while (entries.hasNext()) {
+                for (Map.Entry<String, String> entry : _prefixes.entrySet()) {
                     _printer.printSpace();
-                    Map.Entry entry = (Map.Entry) entries.next();
-                    value = (String) entry.getKey();
-                    name = (String) entry.getValue();
+                    value = entry.getKey();
+                    name = entry.getValue();
                     if (name.length() == 0) {
                         _printer.printText( "xmlns=\"" );
                         printEscaped( value );
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/CharInfo.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/CharInfo.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -33,6 +33,7 @@
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Locale;
+import java.util.Map;
 import java.util.PropertyResourceBundle;
 import java.util.ResourceBundle;
 import javax.xml.transform.TransformerException;
@@ -51,7 +52,7 @@
 final class CharInfo
 {
     /** Given a character, lookup a String to output (e.g. a decorated entity reference). */
-    private HashMap m_charToString = new HashMap();
+    private Map<CharKey, String> m_charToString = new HashMap<>();
 
     /**
      * The name of the HTML entities file.
@@ -187,9 +188,9 @@
         } catch (Exception e) {}
 
         if (entities != null) {
-            Enumeration keys = entities.getKeys();
+            Enumeration<String> keys = entities.getKeys();
             while (keys.hasMoreElements()){
-                String name = (String) keys.nextElement();
+                String name = keys.nextElement();
                 String value = entities.getString(name);
                 int code = Integer.parseInt(value);
                 defineEntity(name, (char) code);
@@ -402,7 +403,7 @@
     {
         CharKey charKey = new CharKey();
         charKey.setChar(value);
-        return (String) m_charToString.get(charKey);
+        return m_charToString.get(charKey);
     }
 
     /**
@@ -477,7 +478,7 @@
      */
     static CharInfo getCharInfoInternal(String entitiesFileName, String method)
     {
-        CharInfo charInfo = (CharInfo) m_getCharInfoCache.get(entitiesFileName);
+        CharInfo charInfo = m_getCharInfoCache.get(entitiesFileName);
         if (charInfo != null) {
             return charInfo;
         }
@@ -533,7 +534,7 @@
     }
 
     /** Table of user-specified char infos. */
-    private static HashMap m_getCharInfoCache = new HashMap();
+    private static Map<String, CharInfo> m_getCharInfoCache = new HashMap<>();
 
     /**
      * Returns the array element holding the bit value for the
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,7 +24,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.Writer;
-import java.util.ArrayList;
+import java.util.List;
 import java.util.Properties;
 import javax.xml.transform.SourceLocator;
 import javax.xml.transform.Transformer;
@@ -136,7 +137,7 @@
     /**
      * @see SerializationHandler#setCdataSectionElements(java.util.ArrayList<String>)
      */
-    public void setCdataSectionElements(ArrayList<String> URI_and_localNames) {
+    public void setCdataSectionElements(List<String> URI_and_localNames) {
         aMethodIsCalled();
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/Encodings.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/Encodings.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -456,7 +456,7 @@
                 final Properties props = loadProperties();
 
                 // create instances of EncodingInfo from the loaded mapping
-                Enumeration keys = props.keys();
+                Enumeration<Object> keys = props.keys();
                 Map<String, EncodingInfo> canonicals = new HashMap<>();
                 while (keys.hasMoreElements()) {
                     final String javaName = (String) keys.nextElement();
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.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
@@ -24,7 +24,6 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Stack;
-
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 
@@ -79,7 +78,7 @@
      * mappings at deeper depths push later on such a stack.  Mappings pushed
      * earlier on the stack will have smaller values for MappingRecord.m_declarationDepth.
      */
-    private HashMap m_namespaces = new HashMap();
+    private HashMap<String, Stack<MappingRecord>> m_namespaces = new HashMap<>();
 
     /**
      * The top of this stack contains the MapRecord
@@ -93,7 +92,7 @@
      * Used to ensure prefix/uri map scopes are closed correctly
      *
      */
-    private Stack m_nodeStack = new Stack();
+    private Stack<MappingRecord> m_nodeStack = new Stack<>();
 
     private static final String EMPTYSTRING = "";
     private static final String XML_PREFIX = "xml"; // was "xmlns"
@@ -116,11 +115,11 @@
 
 
         // Define the default namespace (initially maps to "" uri)
-        Stack stack;
-        m_namespaces.put(EMPTYSTRING, stack = new Stack());
+        Stack<MappingRecord> stack;
+        m_namespaces.put(EMPTYSTRING, stack = new Stack<>());
         stack.push(new MappingRecord(EMPTYSTRING,EMPTYSTRING,0));
 
-        m_namespaces.put(XML_PREFIX, stack = new Stack());
+        m_namespaces.put(XML_PREFIX, stack = new Stack<>());
         stack.push(new MappingRecord( XML_PREFIX,
             "http://www.w3.org/XML/1998/namespace",0));
 
@@ -136,15 +135,13 @@
      */
     public String lookupNamespace(String prefix)
     {
-        final Stack stack = (Stack) m_namespaces.get(prefix);
-        return stack != null && !stack.isEmpty() ?
-            ((MappingRecord) stack.peek()).m_uri : null;
+        final Stack<MappingRecord> stack = m_namespaces.get(prefix);
+        return stack != null && !stack.isEmpty() ? (stack.peek()).m_uri : null;
     }
 
     MappingRecord getMappingFromPrefix(String prefix) {
-        final Stack stack = (Stack) m_namespaces.get(prefix);
-        return stack != null && !stack.isEmpty() ?
-            ((MappingRecord) stack.peek()) : null;
+        final Stack<MappingRecord> stack = m_namespaces.get(prefix);
+        return stack != null && !stack.isEmpty() ? (stack.peek()) : null;
     }
 
     /**
@@ -199,8 +196,8 @@
             return false;
         }
 
-        Stack stack;
-        if ((stack = (Stack) m_namespaces.get(prefix)) != null)
+        Stack<MappingRecord> stack;
+        if ((stack = m_namespaces.get(prefix)) != null)
         {
             stack.pop();
             return true;
@@ -222,14 +219,14 @@
             return false;
         }
 
-        Stack stack;
+        Stack<MappingRecord> stack;
         // Get the stack that contains URIs for the specified prefix
-        if ((stack = (Stack) m_namespaces.get(prefix)) == null)
+        if ((stack = m_namespaces.get(prefix)) == null)
         {
-            m_namespaces.put(prefix, stack = new Stack());
+            m_namespaces.put(prefix, stack = new Stack<>());
         }
 
-        if (!stack.empty() && uri.equals(((MappingRecord)stack.peek()).m_uri))
+        if (!stack.empty() && uri.equals((stack.peek()).m_uri))
         {
             return false;
         }
@@ -293,10 +290,11 @@
      * This method makes a clone of this object.
      *
      */
+    @SuppressWarnings("unchecked")
     public Object clone() throws CloneNotSupportedException {
         NamespaceMappings clone = new NamespaceMappings();
-        clone.m_nodeStack = (Stack) m_nodeStack.clone();
-        clone.m_namespaces = (HashMap) m_namespaces.clone();
+        clone.m_nodeStack = (Stack<MappingRecord>) m_nodeStack.clone();
+        clone.m_namespaces = (HashMap<String, Stack<MappingRecord>>) m_namespaces.clone();
         clone.count = count;
         return clone;
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -232,10 +232,10 @@
     /** The properties when method="" for the "unknown" wrapper */
     private static Properties m_unknown_properties = null;
 
-    private static final Class
+    private static final Class<?>
         ACCESS_CONTROLLER_CLASS = findAccessControllerClass();
 
-    private static Class findAccessControllerClass() {
+    private static Class<?> findAccessControllerClass() {
         try
         {
             // This Class was introduced in JDK 1.2. With the re-architecture of
@@ -381,9 +381,8 @@
         {
             if (ACCESS_CONTROLLER_CLASS != null)
             {
-                is = (InputStream) AccessController
-                    .doPrivileged(new PrivilegedAction() {
-                        public Object run()
+                is = AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
+                        public InputStream run()
                         {
                             return OutputPropertiesFactory.class
                                 .getResourceAsStream(resourceName);
@@ -459,7 +458,7 @@
         // the clone.  Many thanks to Padraig O'hIceadha
         // <padraig@gradient.ie> for finding this problem.  Bugzilla 2000.
 
-        Enumeration keys = ((Properties) props.clone()).keys();
+        Enumeration<Object> keys = ((Properties) props.clone()).keys();
         while (keys.hasMoreElements())
         {
             String key = (String) keys.nextElement();
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -20,13 +21,11 @@
 
 package com.sun.org.apache.xml.internal.serializer;
 
-import java.util.Properties;
-
-import javax.xml.transform.OutputKeys;
-
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
 import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
 import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+import java.util.Properties;
+import javax.xml.transform.OutputKeys;
 import org.xml.sax.ContentHandler;
 
 /**
@@ -120,7 +119,7 @@
 
 
 
-        Class cls = ObjectFactory.findProviderClass(className, true);
+        Class<?> cls = ObjectFactory.findProviderClass(className, true);
 
         // _serializers.put(method, cls);
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,7 +21,7 @@
 
 package com.sun.org.apache.xml.internal.serializer;
 
-import java.util.ArrayList;
+import java.util.List;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.ErrorHandler;
@@ -209,9 +210,9 @@
     /**
      * Does nothing. The setting of CDATA section elements has an impact on
      * stream serializers.
-     * @see SerializationHandler#setCdataSectionElements(java.util.ArrayList<String>)
+     * @see SerializationHandler#setCdataSectionElements(java.util.List<String>)
      */
-    public void setCdataSectionElements(ArrayList<String> URI_and_localNames) {
+    public void setCdataSectionElements(List<String> URI_and_localNames) {
         // do nothing
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -566,7 +566,7 @@
             // and the non-default values after that,
             // just in case there is some unexpected
             // residual values left over from over-ridden default values
-            Enumeration propNames;
+            Enumeration<?> propNames;
             propNames = format.propertyNames();
             while (propNames.hasMoreElements()) {
                 String key = (String) propNames.nextElement();
@@ -2649,14 +2649,14 @@
      *
      * This method is essentially a copy of getQNameProperties() from
      * OutputProperties. Eventually this method should go away and a call
-     * to setCdataSectionElements(ArrayList<String> v) should be made directly.
+     * to setCdataSectionElements(List<String> v) should be made directly.
      */
     private void setCdataSectionElements(String key, Properties props) {
         String s = props.getProperty(key);
 
         if (null != s) {
-            // ArrayList<String> of URI/LocalName pairs
-            ArrayList<String> al = new ArrayList<>();
+            // List<String> of URI/LocalName pairs
+            List<String> al = new ArrayList<>();
             int l = s.length();
             boolean inCurly = false;
             StringBuilder buf = new StringBuilder();
@@ -2706,7 +2706,7 @@
      *
      * @return a QName object
      */
-    private void addCdataSectionElement(String URI_and_localName, ArrayList<String> al) {
+    private void addCdataSectionElement(String URI_and_localName, List<String> al) {
         StringTokenizer tokenizer = new StringTokenizer(URI_and_localName, "{}", false);
         String s1 = tokenizer.nextToken();
         String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;
@@ -2729,7 +2729,7 @@
      *
      * @param URI_and_localNames an ArrayList of pairs of Strings (URI/local)
      */
-    public void setCdataSectionElements(ArrayList<String> URI_and_localNames) {
+    public void setCdataSectionElements(List<String> URI_and_localNames) {
         // convert to the new way.
         if (URI_and_localNames != null) {
             final int len = URI_and_localNames.size() - 1;
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,8 +24,9 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Properties;
-import java.util.ArrayList;
 import javax.xml.transform.SourceLocator;
 import javax.xml.transform.Transformer;
 import org.w3c.dom.Node;
@@ -94,13 +96,13 @@
      * A collection of namespace URI's (only for first element).
      * _namespacePrefix has the matching prefix for these URI's
      */
-    private ArrayList<String> m_namespaceURI = null;
+    private List<String> m_namespaceURI = null;
 
     /**
      * A collection of namespace Prefix (only for first element)
      * _namespaceURI has the matching URIs for these prefix'
      */
-    private ArrayList<String> m_namespacePrefix = null;
+    private List<String> m_namespacePrefix = null;
 
     /**
      * true if startDocument() was called before the underlying handler
@@ -1066,11 +1068,11 @@
     }
 
     /**
-     * @param URI_and_localNames Vector a list of pairs of URI/localName
+     * @param URI_and_localNames a list of pairs of URI/localName
      * specified in the cdata-section-elements attribute.
-     * @see SerializationHandler#setCdataSectionElements(java.util.Vector)
+     * @see SerializationHandler#setCdataSectionElements(List)
      */
-    public void setCdataSectionElements(ArrayList<String> URI_and_localNames) {
+    public void setCdataSectionElements(List<String> URI_and_localNames) {
         m_handler.setCdataSectionElements(URI_and_localNames);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.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,7 +21,7 @@
 
 package com.sun.org.apache.xml.internal.serializer;
 
-import java.util.ArrayList;
+import java.util.List;
 
 /**
  * This interface has methods associated with the XSLT xsl:output attribues
@@ -124,7 +124,7 @@
      * relevant in specifying which elements have their text to be output as
      * CDATA sections.
      */
-    public void setCdataSectionElements(ArrayList<String> URI_and_localNames);
+    public void setCdataSectionElements(List<String> URI_and_localNames);
 
     /** Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties
      * @param system the system identifier to be used in the DOCTYPE declaration
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -2010,10 +2011,7 @@
      * to be used while serializing the DOM.
      */
     protected void initProperties(Properties properties) {
-
-        for (Enumeration keys = properties.keys(); keys.hasMoreElements();) {
-
-            final String key = (String) keys.nextElement();
+        for(String key : properties.stringPropertyNames()) {
 
             // caonical-form
             // Other features will be enabled or disabled when this is set to true or false.
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/DOMStringListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/DOMStringListImpl.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
@@ -22,9 +22,9 @@
 
 package com.sun.org.apache.xml.internal.serializer.dom3;
 
-import java.util.Vector;
-
 //import org.apache.xerces.dom3.DOMStringList;
+import java.util.ArrayList;
+import java.util.List;
 import org.w3c.dom.DOMStringList;
 
 /**
@@ -35,19 +35,19 @@
 final class DOMStringListImpl implements DOMStringList {
 
     //A collection of DOMString values
-    private Vector fStrings;
+    private List<String> fStrings;
 
     /**
      * Construct an empty list of DOMStringListImpl
      */
     DOMStringListImpl() {
-        fStrings = new Vector();
+        fStrings = new ArrayList<>();
     }
 
     /**
      * Construct an empty list of DOMStringListImpl
      */
-    DOMStringListImpl(Vector params) {
+    DOMStringListImpl(List<String> params) {
         fStrings = params;
     }
 
@@ -55,7 +55,7 @@
      * Construct an empty list of DOMStringListImpl
      */
     DOMStringListImpl(String[] params ) {
-        fStrings = new Vector();
+        fStrings = new ArrayList<>();
         if (params != null) {
             for (int i=0; i < params.length; i++) {
                 fStrings.add(params[i]);
@@ -68,8 +68,8 @@
      */
     public String item(int index) {
         try {
-            return (String) fStrings.elementAt(index);
-        } catch (ArrayIndexOutOfBoundsException e) {
+            return fStrings.get(index);
+        } catch (IndexOutOfBoundsException e) {
             return null;
         }
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/NamespaceSupport.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/dom3/NamespaceSupport.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
@@ -39,9 +39,9 @@
  */
 public class NamespaceSupport {
 
-        static final String PREFIX_XML = "xml".intern();
+    static final String PREFIX_XML = "xml".intern();
 
-        static final String PREFIX_XMLNS = "xmlns".intern();
+    static final String PREFIX_XMLNS = "xmlns".intern();
 
     /**
      * The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is
@@ -246,32 +246,32 @@
         /**
          * @see org.apache.xerces.xni.NamespaceContext#getAllPrefixes()
          */
-        public Enumeration getAllPrefixes() {
-        int count = 0;
-        if (fPrefixes.length < (fNamespace.length/2)) {
-            // resize prefix array
-            String[] prefixes = new String[fNamespaceSize];
-            fPrefixes = prefixes;
-        }
-        String prefix = null;
-        boolean unique = true;
-        for (int i = 2; i < (fNamespaceSize-2); i += 2) {
-            prefix = fNamespace[i + 2];
-            for (int k=0;k<count;k++){
-                if (fPrefixes[k]==prefix){
-                    unique = false;
-                    break;
+        public Enumeration<String> getAllPrefixes() {
+            int count = 0;
+            if (fPrefixes.length < (fNamespace.length/2)) {
+                // resize prefix array
+                String[] prefixes = new String[fNamespaceSize];
+                fPrefixes = prefixes;
+            }
+            String prefix = null;
+            boolean unique = true;
+            for (int i = 2; i < (fNamespaceSize-2); i += 2) {
+                prefix = fNamespace[i + 2];
+                for (int k=0;k<count;k++){
+                    if (fPrefixes[k]==prefix){
+                        unique = false;
+                        break;
+                    }
                 }
-            }
-            if (unique){
-                fPrefixes[count++] = prefix;
+                if (unique){
+                    fPrefixes[count++] = prefix;
+                }
+                unique = true;
             }
-            unique = true;
-        }
-                return new Prefixes(fPrefixes, count);
+            return new Prefixes(fPrefixes, count);
         }
 
-    protected final class Prefixes implements Enumeration {
+    protected final class Prefixes implements Enumeration<String> {
         private String[] prefixes;
         private int counter = 0;
         private int size = 0;
@@ -294,15 +294,15 @@
                 /**
                  * @see java.util.Enumeration#nextElement()
                  */
-                public Object nextElement() {
-            if (counter< size){
-                return fPrefixes[counter++];
-            }
-                        throw new NoSuchElementException("Illegal access to Namespace prefixes enumeration.");
+                public String nextElement() {
+                    if (counter< size){
+                        return fPrefixes[counter++];
+                    }
+                    throw new NoSuchElementException("Illegal access to Namespace prefixes enumeration.");
                 }
 
         public String toString(){
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
             for (int i=0;i<size;i++){
                 buf.append(prefixes[i]);
                 buf.append(" ");
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOMBuilder.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/DOMBuilder.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,18 +21,16 @@
 
 package com.sun.org.apache.xml.internal.utils;
 
-import java.util.Stack;
-
 import com.sun.org.apache.xml.internal.res.XMLErrorResources;
 import com.sun.org.apache.xml.internal.res.XMLMessages;
-
+import java.util.List;
+import java.util.Stack;
+import org.w3c.dom.CDATASection;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentFragment;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.Text;
-import org.w3c.dom.CDATASection;
-
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.Locator;
@@ -62,8 +60,8 @@
   /** First node of document fragment or null if not a DocumentFragment     */
   public DocumentFragment m_docFrag = null;
 
-  /** Vector of element nodes          */
-  protected Stack m_elemStack = new Stack();
+  /** Stack of element nodes          */
+  protected Stack<Node> m_elemStack = new Stack<>();
 
   /**
    * DOMBuilder instance constructor... it will add the DOM nodes
@@ -402,7 +400,7 @@
           throws org.xml.sax.SAXException
   {
     m_elemStack.pop();
-    m_currentNode = m_elemStack.isEmpty() ? null : (Node)m_elemStack.peek();
+    m_currentNode = m_elemStack.isEmpty() ? null : m_elemStack.peek();
   }
 
   /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/ObjectPool.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/ObjectPool.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -20,12 +21,12 @@
 
 package com.sun.org.apache.xml.internal.utils;
 
-import java.util.ArrayList;
-
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
 import com.sun.org.apache.xml.internal.res.XMLErrorResources;
 import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
 import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
 
 
 /**
@@ -38,21 +39,21 @@
 
   /** Type of objects in this pool.
    *  @serial          */
-  private final Class objectType;
+  private final Class<?> objectType;
 
   /** Stack of given objects this points to.
    *  @serial          */
-  private final ArrayList freeStack;
+  private final List<Object> freeStack;
 
   /**
    * Constructor ObjectPool
    *
    * @param type Type of objects for this pool
    */
-  public ObjectPool(Class type)
+  public ObjectPool(Class<?> type)
   {
     objectType = type;
-    freeStack = new ArrayList();
+    freeStack = new ArrayList<>();
   }
 
   /**
@@ -70,7 +71,7 @@
     {
       throw new WrappedRuntimeException(cnfe);
     }
-    freeStack = new ArrayList();
+    freeStack = new ArrayList<>();
   }
 
 
@@ -81,10 +82,10 @@
    * @param type Type of objects for this pool
    * @param size Size of vector to allocate
    */
-  public ObjectPool(Class type, int size)
+  public ObjectPool(Class<?> type, int size)
   {
     objectType = type;
-    freeStack = new ArrayList(size);
+    freeStack = new ArrayList<>(size);
   }
 
   /**
@@ -94,7 +95,7 @@
   public ObjectPool()
   {
     objectType = null;
-    freeStack = new ArrayList();
+    freeStack = new ArrayList<>();
   }
 
   /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/QName.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/QName.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,12 +21,10 @@
 
 package com.sun.org.apache.xml.internal.utils;
 
+import com.sun.org.apache.xml.internal.res.XMLErrorResources;
+import com.sun.org.apache.xml.internal.res.XMLMessages;
 import java.util.Stack;
 import java.util.StringTokenizer;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-
 import org.w3c.dom.Element;
 
 /**
@@ -230,7 +228,7 @@
    * @param qname Qualified name to resolve
    * @param namespaces Namespace stack to use to resolve namespace
    */
-  public QName(String qname, Stack namespaces)
+  public QName(String qname, Stack<NameSpace> namespaces)
   {
     this(qname, namespaces, false);
   }
@@ -245,7 +243,7 @@
    * @param validate If true the new QName will be validated and an IllegalArgumentException will
    *                 be thrown if it is invalid.
    */
-  public QName(String qname, Stack namespaces, boolean validate)
+  public QName(String qname, Stack<NameSpace> namespaces, boolean validate)
   {
 
     String namespace = null;
@@ -271,7 +269,7 @@
 
         for (int i = depth - 1; i >= 0; i--)
         {
-          NameSpace ns = (NameSpace) namespaces.elementAt(i);
+          NameSpace ns = namespaces.get(i);
 
           while (null != ns)
           {
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/StringComparable.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/StringComparable.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,17 @@
 
 package com.sun.org.apache.xml.internal.utils;
 
-import java.util.Vector;
+import java.text.CollationElementIterator;
 import java.text.Collator;
 import java.text.RuleBasedCollator;
-import java.text.CollationElementIterator;
 import java.util.Locale;
-import java.text.CollationKey;
 
 
 /**
 * International friendly string comparison with case-order
  * @author Igor Hersht, igorh@ca.ibm.com
 */
-public class StringComparable implements Comparable  {
+public class StringComparable implements Comparable<StringComparable>  {
 
      public final static int UNKNOWN_CASE = -1;
      public final static int UPPER_CASE = 1;
@@ -45,7 +43,8 @@
      private String m_caseOrder;
      private int m_mask = 0xFFFFFFFF;
 
-    public StringComparable(final String text, final Locale locale, final Collator collator, final String caseOrder){
+    public StringComparable(final String text, final Locale locale,
+            final Collator collator, final String caseOrder){
          m_text =  text;
          m_locale = locale;
          m_collator = (RuleBasedCollator)collator;
@@ -53,23 +52,25 @@
          m_mask = getMask(m_collator.getStrength());
     }
 
-   public final static Comparable getComparator( final String text, final Locale locale, final Collator collator, final String caseOrder){
-       if((caseOrder == null) ||(caseOrder.length() == 0)){// no case-order specified
+    @SuppressWarnings({"rawtypes", "unchecked"})
+    public final static Comparable getComparator( final String text, final Locale locale,
+            final Collator collator, final String caseOrder){
+        if((caseOrder == null) ||(caseOrder.length() == 0)){// no case-order specified
             return  ((RuleBasedCollator)collator).getCollationKey(text);
-       }else{
+        }else{
             return new StringComparable(text, locale, collator, caseOrder);
-       }
-   }
+        }
+    }
 
    public final String toString(){return m_text;}
 
-   public int compareTo(Object o) {
-   final String pattern = ((StringComparable)o).toString();
-   if(m_text.equals(pattern)){//Code-point equals
-      return 0;
-   }
-   final int savedStrength = m_collator.getStrength();
-   int comp = 0;
+     public int compareTo(StringComparable o) {
+     final String pattern = o.toString();
+     if(m_text.equals(pattern)){//Code-point equals
+        return 0;
+     }
+     final int savedStrength = m_collator.getStrength();
+     int comp = 0;
       // Is there difference more significant than case-order?
      if(((savedStrength == Collator.PRIMARY) || (savedStrength == Collator.SECONDARY))){
          comp = m_collator.compare(m_text, pattern );
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/StylesheetPIHandler.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/StylesheetPIHandler.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,23 +21,21 @@
 
 package com.sun.org.apache.xml.internal.utils;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.StringTokenizer;
-import java.util.Vector;
-
 import javax.xml.transform.Source;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.URIResolver;
 import javax.xml.transform.sax.SAXSource;
-
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.helpers.DefaultHandler;
 
 /**
  * Search for the xml-stylesheet processing instructions in an XML document.
- * @see <a href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML documents, Version 1.0</a>
+ * @see <a href="http://www.w3.org/TR/xml-stylesheet/">
+ * Associating Style Sheets with XML documents, Version 1.0</a>
  */
 public class StylesheetPIHandler extends DefaultHandler
 {
@@ -54,7 +52,7 @@
   String m_charset;
 
   /** A list of SAXSource objects that match the criteria.  */
-  Vector m_stylesheets = new Vector();
+  List<Source> m_stylesheets = new ArrayList<>();
 
   // Add code to use a URIResolver. Patch from Dmitri Ilyin.
 
@@ -120,7 +118,7 @@
 
     if (sz > 0)
     {
-      Source source = (Source) m_stylesheets.elementAt(sz-1);
+      Source source = m_stylesheets.get(sz-1);
       return source;
     }
     else
@@ -136,7 +134,8 @@
    * @throws org.xml.sax.SAXException Any SAX exception, possibly
    *            wrapping another exception.
    * @see org.xml.sax.ContentHandler#processingInstruction
-   * @see <a href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML documents, Version 1.0</a>
+   * @see <a href="http://www.w3.org/TR/xml-stylesheet/">
+   * Associating Style Sheets with XML documents, Version 1.0</a>
    */
   public void processingInstruction(String target, String data)
           throws org.xml.sax.SAXException
@@ -299,7 +298,7 @@
             return;
         }
 
-        m_stylesheets.addElement(source);
+        m_stylesheets.add(source);
       }
     }
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/Expression.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/Expression.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,17 +21,17 @@
 
 package com.sun.org.apache.xpath.internal;
 
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.TransformerException;
-
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xml.internal.utils.XMLString;
 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
 import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
+import java.util.List;
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.TransformerException;
 import org.xml.sax.ContentHandler;
 
 /**
@@ -341,7 +341,7 @@
    * to be offset to the current stack frame).
    * NEEDSDOC @param globalsSize
    */
-  public abstract void fixupVariables(java.util.Vector vars, int globalsSize);
+  public abstract void fixupVariables(List<QName> vars, int globalsSize);
 
   /**
    * Compare this object with another object and see
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/ExtensionsProvider.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/ExtensionsProvider.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,9 +21,9 @@
 
 package com.sun.org.apache.xpath.internal;
 
-import java.util.Vector;
-
 import com.sun.org.apache.xpath.internal.functions.FuncExtFunction;
+import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 /**
  * Interface that XPath objects can call to obtain access to an
@@ -48,14 +48,13 @@
   /**
    * Execute the extension function.
    */
-  public Object extFunction(String ns, String funcName,
-                            Vector argVec, Object methodKey)
+  public Object extFunction(String ns, String funcName, List<XObject> argVec,
+          Object methodKey)
             throws javax.xml.transform.TransformerException;
 
   /**
    * Execute the extension function.
    */
-  public Object extFunction(FuncExtFunction extFunction,
-                            Vector argVec)
+  public Object extFunction(FuncExtFunction extFunction, List<XObject> argVec)
             throws javax.xml.transform.TransformerException;
 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -20,19 +21,17 @@
 
 package com.sun.org.apache.xpath.internal;
 
+import com.sun.org.apache.xml.internal.dtm.DTM;
+import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
 import java.io.IOException;
-import java.util.Vector;
-
+import java.util.ArrayList;
+import java.util.List;
 import javax.xml.transform.Source;
 import javax.xml.transform.SourceLocator;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.URIResolver;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.XMLReaderFactory;
 
@@ -45,8 +44,8 @@
 public class SourceTreeManager
 {
 
-  /** Vector of SourceTree objects that this manager manages. */
-  private Vector m_sourceTree = new Vector();
+  /** List of SourceTree objects that this manager manages. */
+  private List<SourceTree> m_sourceTree = new ArrayList<>();
 
   /**
    * Reset the list of SourceTree objects that this manager manages.
@@ -54,7 +53,7 @@
    */
   public void reset()
   {
-    m_sourceTree = new Vector();
+    m_sourceTree = new ArrayList<>();
   }
 
   /** The TrAX URI resolver used to obtain source trees. */
@@ -94,7 +93,7 @@
 
     for (int i = 0; i < n; i++)
     {
-      SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);
+      SourceTree sTree = m_sourceTree.get(i);
 
       if (owner == sTree.m_root)
         return sTree.m_url;
@@ -149,10 +148,10 @@
       return;
     for(int i=m_sourceTree.size()-1;i>=0;--i)
     {
-      SourceTree st=(SourceTree)m_sourceTree.elementAt(i);
+      SourceTree st= m_sourceTree.get(i);
       if(st!=null && st.m_root==n)
       {
-        m_sourceTree.removeElementAt(i);
+        m_sourceTree.remove(i);
         return;
       }
     }
@@ -183,7 +182,7 @@
     }
     if (null != source.getSystemId())
     {
-      m_sourceTree.addElement(new SourceTree(n, source.getSystemId()));
+      m_sourceTree.add(new SourceTree(n, source.getSystemId()));
     }
   }
 
@@ -211,7 +210,7 @@
     // System.out.println("getNode: "+n);
     for (int i = 0; i < n; i++)
     {
-      SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);
+      SourceTree sTree = m_sourceTree.get(i);
 
       // System.out.println("getNode -         url: "+url);
       // System.out.println("getNode - sTree.m_url: "+sTree.m_url);
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPath.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPath.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,22 +21,21 @@
 
 package com.sun.org.apache.xpath.internal;
 
-import java.io.Serializable;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.utils.PrefixResolver;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xml.internal.utils.SAXSourceLocator;
 import com.sun.org.apache.xpath.internal.compiler.Compiler;
 import com.sun.org.apache.xpath.internal.compiler.FunctionTable;
 import com.sun.org.apache.xpath.internal.compiler.XPathParser;
-import com.sun.org.apache.xpath.internal.functions.Function;
 import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
+import java.io.Serializable;
+import java.util.List;
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.SourceLocator;
+import javax.xml.transform.TransformerException;
 
 /**
  * The XPath class wraps an expression object and provides general services
@@ -84,7 +83,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     m_mainExp.fixupVariables(vars, globalsSize);
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -40,13 +41,14 @@
 import com.sun.org.apache.xpath.internal.objects.XString;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
 import java.lang.reflect.Method;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 import java.util.Stack;
-import java.util.Vector;
 import javax.xml.transform.ErrorListener;
 import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
 import javax.xml.transform.URIResolver;
 import org.xml.sax.XMLReader;
 
@@ -69,7 +71,7 @@
    * really a net win versus discarding the DTM and starting a new one...
    * but the retained RTF DTM will have been tail-pruned so should be small.
    */
-  private Vector m_rtfdtm_stack=null;
+  private List<DTM> m_rtfdtm_stack=null;
   /** Index of currently active RTF DTM in m_rtfdtm_stack */
   private int m_which_rtfdtm=-1;
 
@@ -83,7 +85,7 @@
    * HashMap of cached the DTMXRTreeFrag objects, which are identified by DTM IDs.
    * The object are just wrappers for DTMs which are used in  XRTreeFrag.
    */
-  private HashMap m_DTMXRTreeFrags = null;
+  private Map<Integer, DTMXRTreeFrag> m_DTMXRTreeFrags = null;
 
   /**
    * state of the secure processing feature.
@@ -319,7 +321,7 @@
   {
     m_owner = owner;
     try {
-      m_ownerGetErrorListener = m_owner.getClass().getMethod("getErrorListener", new Class[] {});
+      m_ownerGetErrorListener = m_owner.getClass().getMethod("getErrorListener", new Class<?>[] {});
     }
     catch (NoSuchMethodException nsme) {}
     init(true);
@@ -342,10 +344,12 @@
   public void reset()
   {
     releaseDTMXRTreeFrags();
-        // These couldn't be disposed of earlier (see comments in release()); zap them now.
-        if(m_rtfdtm_stack!=null)
-                 for (java.util.Enumeration e = m_rtfdtm_stack.elements() ; e.hasMoreElements() ;)
-                        m_dtmManager.release((DTM)e.nextElement(), true);
+    // These couldn't be disposed of earlier (see comments in release()); zap them now.
+    if(m_rtfdtm_stack!=null) {
+        for (DTM dtm : m_rtfdtm_stack) {
+            m_dtmManager.release(dtm, true);
+        }
+    }
 
     m_rtfdtm_stack=null; // drop our references too
     m_which_rtfdtm=-1;
@@ -360,16 +364,16 @@
                    );
 
     m_saxLocations.removeAllElements();
-        m_axesIteratorStack.removeAllElements();
-        m_contextNodeLists.removeAllElements();
-        m_currentExpressionNodes.removeAllElements();
-        m_currentNodes.removeAllElements();
-        m_iteratorRoots.RemoveAllNoClear();
-        m_predicatePos.removeAllElements();
-        m_predicateRoots.RemoveAllNoClear();
-        m_prefixResolvers.removeAllElements();
+    m_axesIteratorStack.removeAllElements();
+    m_contextNodeLists.removeAllElements();
+    m_currentExpressionNodes.removeAllElements();
+    m_currentNodes.removeAllElements();
+    m_iteratorRoots.RemoveAllNoClear();
+    m_predicatePos.removeAllElements();
+    m_predicateRoots.RemoveAllNoClear();
+    m_prefixResolvers.removeAllElements();
 
-        m_prefixResolvers.push(null);
+    m_prefixResolvers.push(null);
     m_currentNodes.push(DTM.NULL);
     m_currentExpressionNodes.push(DTM.NULL);
     m_saxLocations.push(null);
@@ -622,10 +626,10 @@
   /**
    * The current context node list.
    */
-  private Stack m_contextNodeLists = new Stack();
+  private Stack<DTMIterator> m_contextNodeLists = new Stack<>();
 
-  public Stack getContextNodeListsStack() { return m_contextNodeLists; }
-  public void setContextNodeListsStack(Stack s) { m_contextNodeLists = s; }
+  public Stack<DTMIterator> getContextNodeListsStack() { return m_contextNodeLists; }
+  public void setContextNodeListsStack(Stack<DTMIterator> s) { m_contextNodeLists = s; }
 
   /**
    * Get the current context node list.
@@ -637,7 +641,7 @@
   {
 
     if (m_contextNodeLists.size() > 0)
-      return (DTMIterator) m_contextNodeLists.peek();
+      return m_contextNodeLists.peek();
     else
       return null;
   }
@@ -925,10 +929,10 @@
   /**
    * Stack of AxesIterators.
    */
-  private Stack m_axesIteratorStack = new Stack();
+  private Stack<SubContextList> m_axesIteratorStack = new Stack<>();
 
-  public Stack getAxesIteratorStackStacks() { return m_axesIteratorStack; }
-  public void setAxesIteratorStackStacks(Stack s) { m_axesIteratorStack = s; }
+  public Stack<SubContextList> getAxesIteratorStackStacks() { return m_axesIteratorStack; }
+  public void setAxesIteratorStackStacks(Stack<SubContextList> s) { m_axesIteratorStack = s; }
 
   /**
    * Push a TreeWalker on the stack.
@@ -958,8 +962,7 @@
    */
   public SubContextList getSubContextList()
   {
-    return m_axesIteratorStack.isEmpty()
-           ? null : (SubContextList) m_axesIteratorStack.peek();
+    return m_axesIteratorStack.isEmpty() ? null : m_axesIteratorStack.peek();
   }
 
   /**
@@ -972,8 +975,7 @@
 
   public com.sun.org.apache.xpath.internal.axes.SubContextList getCurrentNodeList()
   {
-    return m_axesIteratorStack.isEmpty()
-           ? null : (SubContextList) m_axesIteratorStack.elementAt(0);
+    return m_axesIteratorStack.isEmpty() ? null : m_axesIteratorStack.get(0);
   }
   //==========================================================
   // SECTION: Implementation of ExpressionContext interface
@@ -1200,35 +1202,35 @@
 
         if(m_rtfdtm_stack==null)
         {
-                m_rtfdtm_stack=new Vector();
-                rtfdtm=(SAX2RTFDTM)m_dtmManager.getDTM(null,true,null,false,false);
-    m_rtfdtm_stack.addElement(rtfdtm);
-                ++m_which_rtfdtm;
+            m_rtfdtm_stack=new ArrayList<>();
+            rtfdtm=(SAX2RTFDTM)m_dtmManager.getDTM(null,true,null,false,false);
+            m_rtfdtm_stack.add(rtfdtm);
+            ++m_which_rtfdtm;
         }
         else if(m_which_rtfdtm<0)
         {
-                rtfdtm=(SAX2RTFDTM)m_rtfdtm_stack.elementAt(++m_which_rtfdtm);
+            rtfdtm=(SAX2RTFDTM)m_rtfdtm_stack.get(++m_which_rtfdtm);
         }
         else
         {
-                rtfdtm=(SAX2RTFDTM)m_rtfdtm_stack.elementAt(m_which_rtfdtm);
+            rtfdtm=(SAX2RTFDTM)m_rtfdtm_stack.get(m_which_rtfdtm);
 
-                // It might already be under construction -- the classic example would be
-                // an xsl:variable which uses xsl:call-template as part of its value. To
-                // handle this recursion, we have to start a new RTF DTM, pushing the old
-                // one onto a stack so we can return to it. This is not as uncommon a case
-                // as we might wish, unfortunately, as some folks insist on coding XSLT
-                // as if it were a procedural language...
-                if(rtfdtm.isTreeIncomplete())
+            // It might already be under construction -- the classic example would be
+            // an xsl:variable which uses xsl:call-template as part of its value. To
+            // handle this recursion, we have to start a new RTF DTM, pushing the old
+            // one onto a stack so we can return to it. This is not as uncommon a case
+            // as we might wish, unfortunately, as some folks insist on coding XSLT
+            // as if it were a procedural language...
+            if(rtfdtm.isTreeIncomplete())
+            {
+                if(++m_which_rtfdtm < m_rtfdtm_stack.size())
+                    rtfdtm=(SAX2RTFDTM)m_rtfdtm_stack.get(m_which_rtfdtm);
+                else
                 {
-                        if(++m_which_rtfdtm < m_rtfdtm_stack.size())
-                                rtfdtm=(SAX2RTFDTM)m_rtfdtm_stack.elementAt(m_which_rtfdtm);
-                        else
-                        {
-                                rtfdtm=(SAX2RTFDTM)m_dtmManager.getDTM(null,true,null,false,false);
-          m_rtfdtm_stack.addElement(rtfdtm);
-                        }
+                    rtfdtm=(SAX2RTFDTM)m_dtmManager.getDTM(null,true,null,false,false);
+                    m_rtfdtm_stack.add(rtfdtm);
                 }
+            }
         }
 
     return rtfdtm;
@@ -1269,7 +1271,7 @@
         {
                 if(previous>=0) // guard against none-active
                 {
-                        boolean isEmpty=((SAX2RTFDTM)(m_rtfdtm_stack.elementAt(previous))).popRewindMark();
+                        boolean isEmpty=((SAX2RTFDTM)(m_rtfdtm_stack.get(previous))).popRewindMark();
                 }
         }
         else while(m_which_rtfdtm!=previous)
@@ -1277,7 +1279,7 @@
                 // Empty each DTM before popping, so it's ready for reuse
                 // _DON'T_ pop the previous, since it's still open (which is why we
                 // stacked up more of these) and did not receive a mark.
-                boolean isEmpty=((SAX2RTFDTM)(m_rtfdtm_stack.elementAt(m_which_rtfdtm))).popRewindMark();
+                boolean isEmpty=((SAX2RTFDTM)(m_rtfdtm_stack.get(m_which_rtfdtm))).popRewindMark();
                 --m_which_rtfdtm;
         }
   }
@@ -1291,11 +1293,11 @@
    */
   public DTMXRTreeFrag getDTMXRTreeFrag(int dtmIdentity){
     if(m_DTMXRTreeFrags == null){
-      m_DTMXRTreeFrags = new HashMap();
+      m_DTMXRTreeFrags = new HashMap<>();
     }
 
     if(m_DTMXRTreeFrags.containsKey(dtmIdentity)){
-       return (DTMXRTreeFrag)m_DTMXRTreeFrags.get(dtmIdentity);
+       return m_DTMXRTreeFrags.get(dtmIdentity);
     }else{
       final DTMXRTreeFrag frag = new DTMXRTreeFrag(dtmIdentity,this);
       m_DTMXRTreeFrags.put(dtmIdentity,frag);
@@ -1311,9 +1313,9 @@
     if(m_DTMXRTreeFrags == null){
       return;
     }
-    final Iterator iter = (m_DTMXRTreeFrags.values()).iterator();
+    final Iterator<DTMXRTreeFrag> iter = (m_DTMXRTreeFrags.values()).iterator();
     while(iter.hasNext()){
-      DTMXRTreeFrag frag = (DTMXRTreeFrag)iter.next();
+      DTMXRTreeFrag frag = iter.next();
       frag.destruct();
       iter.remove();
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathException.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathException.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
@@ -22,7 +22,6 @@
 package com.sun.org.apache.xpath.internal;
 
 import javax.xml.transform.TransformerException;
-
 import org.w3c.dom.Node;
 
 /**
@@ -268,7 +267,7 @@
 
     boolean isJdk14OrHigher = false;
     try {
-        Throwable.class.getMethod("getCause", (Class[]) null);
+        Throwable.class.getMethod("getCause", (Class<?>[]) null);
         isJdk14OrHigher = true;
     } catch (NoSuchMethodException nsme) {
         // do nothing
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/AxesWalker.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/AxesWalker.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,8 +21,6 @@
 
 package com.sun.org.apache.xpath.internal.axes;
 
-import java.util.Vector;
-
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
@@ -33,6 +31,7 @@
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.compiler.Compiler;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
+import java.util.List;
 
 /**
  * Serves as common interface for axes Walkers, and stores common
@@ -111,7 +110,7 @@
    * @return non-null clone, which may be a new clone, or may be a clone
    *         contained on the cloneList.
    */
-  AxesWalker cloneDeep(WalkingIterator cloneOwner, Vector cloneList)
+  AxesWalker cloneDeep(WalkingIterator cloneOwner, List<AxesWalker> cloneList)
      throws CloneNotSupportedException
   {
     AxesWalker clone = findClone(this, cloneList);
@@ -121,8 +120,8 @@
     clone.setLocPathIterator(cloneOwner);
     if(null != cloneList)
     {
-      cloneList.addElement(this);
-      cloneList.addElement(clone);
+      cloneList.add(this);
+      cloneList.add(clone);
     }
 
     if(wi().m_lastUsedWalker == this)
@@ -155,7 +154,7 @@
    *
    * @return A clone that corresponds to the key, or null if key not found.
    */
-  static AxesWalker findClone(AxesWalker key, Vector cloneList)
+  static AxesWalker findClone(AxesWalker key, List<AxesWalker> cloneList)
   {
     if(null != cloneList)
     {
@@ -163,8 +162,8 @@
       int n = cloneList.size();
       for (int i = 0; i < n; i+=2)
       {
-        if(key == cloneList.elementAt(i))
-          return (AxesWalker)cloneList.elementAt(i+1);
+        if(key == cloneList.get(i))
+          return cloneList.get(i+1);
       }
     }
     return null;
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.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
@@ -22,10 +22,12 @@
 package com.sun.org.apache.xpath.internal.axes;
 
 import com.sun.org.apache.xml.internal.dtm.DTM;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
+import java.util.List;
 
 public class FilterExprIterator extends BasicTestIterator
 {
@@ -114,7 +116,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     super.fixupVariables(vars, globalsSize);
     m_expr.fixupVariables(vars, globalsSize);
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.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
@@ -24,12 +24,14 @@
 import com.sun.org.apache.xml.internal.dtm.Axis;
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.utils.PrefixResolver;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.VariableStack;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
+import java.util.List;
 
 /**
  * Class to use for one-step iteration that doesn't have a predicate, and
@@ -199,7 +201,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     super.fixupVariables(vars, globalsSize);
     m_expr.fixupVariables(vars, globalsSize);
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.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
@@ -24,6 +24,7 @@
 import com.sun.org.apache.xml.internal.dtm.Axis;
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathContext;
@@ -31,6 +32,7 @@
 import com.sun.org.apache.xpath.internal.compiler.Compiler;
 import com.sun.org.apache.xpath.internal.compiler.OpCodes;
 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
+import java.util.List;
 
 /**
  * Walker for the OP_VARIABLE, or OP_EXTFUNCTION, or OP_FUNCTION, or OP_GROUP,
@@ -236,7 +238,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     super.fixupVariables(vars, globalsSize);
     m_expr.fixupVariables(vars, globalsSize);
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/IteratorPool.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/IteratorPool.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,10 +21,10 @@
 
 package com.sun.org.apache.xpath.internal.axes;
 
-import java.util.ArrayList;
-
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
 import com.sun.org.apache.xml.internal.utils.WrappedRuntimeException;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Pool of object of a given type to pick from to help memory usage
@@ -42,7 +42,7 @@
   /**
    * Stack of given objects this points to.
    */
-  private final ArrayList m_freeStack;
+  private final List<DTMIterator> m_freeStack;
 
   /**
    * Constructor IteratorPool
@@ -52,7 +52,7 @@
   public IteratorPool(DTMIterator original)
   {
     m_orig = original;
-    m_freeStack = new ArrayList();
+    m_freeStack = new ArrayList<>();
   }
 
   /**
@@ -73,7 +73,7 @@
     else
     {
       // Remove object from end of free pool.
-      DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
+      DTMIterator result = m_freeStack.remove(m_freeStack.size() - 1);
       return result;
     }
   }
@@ -102,7 +102,7 @@
     else
     {
       // Remove object from end of free pool.
-      DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
+      DTMIterator result = m_freeStack.remove(m_freeStack.size() - 1);
       return result;
     }
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.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,16 +21,16 @@
 
 package com.sun.org.apache.xpath.internal.axes;
 
-import java.util.Vector;
-
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMFilter;
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
 import com.sun.org.apache.xml.internal.dtm.DTMManager;
 import com.sun.org.apache.xml.internal.utils.NodeVector;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.NodeSetDTM;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 /**
  * This class is the dynamic wrapper for a Xalan DTMIterator instance, and
@@ -713,7 +713,7 @@
   /**
    * @see org.apache.xpath.Expression#fixupVariables(Vector, int)
    */
-  public void fixupVariables(Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
         super.fixupVariables(vars, globalsSize);
   }
@@ -766,7 +766,7 @@
 
       // checkDups();
       return insertIndex;
-    } // end addNodeInDocOrder(Vector v, Object obj)
+    } // end addNodeInDocOrder(List<QName> v, Object obj)
 
    /**
     * It used to be that many locations in the code simply
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.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
@@ -24,6 +24,7 @@
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
 import com.sun.org.apache.xml.internal.utils.PrefixResolver;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathContext;
@@ -31,6 +32,7 @@
 import com.sun.org.apache.xpath.internal.compiler.Compiler;
 import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.patterns.NodeTest;
+import java.util.List;
 
 public abstract class PredicatedNodeTest extends NodeTest implements SubContextList
 {
@@ -415,7 +417,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     super.fixupVariables(vars, globalsSize);
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.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
@@ -22,9 +22,11 @@
 package com.sun.org.apache.xpath.internal.axes;
 
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.patterns.NodeTest;
+import java.util.List;
 
 /**
  * This class defines a simplified type of union iterator that only
@@ -92,7 +94,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     super.fixupVariables(vars, globalsSize);
     if (m_nodeTests != null) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.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
@@ -24,12 +24,14 @@
 import com.sun.org.apache.xml.internal.dtm.Axis;
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.compiler.Compiler;
 import com.sun.org.apache.xpath.internal.compiler.OpCodes;
 import com.sun.org.apache.xpath.internal.compiler.OpMap;
+import java.util.List;
 
 /**
  * This class extends NodeSetDTM, which implements DTMIterator,
@@ -451,7 +453,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     for (int i = 0; i < m_exprs.length; i++)
     {
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIterator.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
@@ -23,12 +23,14 @@
 
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.utils.PrefixResolver;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.VariableStack;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.compiler.Compiler;
 import com.sun.org.apache.xpath.internal.compiler.OpMap;
+import java.util.List;
 
 /**
  * Location path iterator that uses Walkers.
@@ -284,7 +286,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     m_predicateIndex = -1;
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.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
@@ -23,7 +23,9 @@
 
 import com.sun.org.apache.xml.internal.dtm.Axis;
 import com.sun.org.apache.xml.internal.utils.PrefixResolver;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.compiler.Compiler;
+import java.util.List;
 
 /**
  * This class iterates over set of nodes that needs to be sorted.
@@ -194,7 +196,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     super.fixupVariables(vars, globalsSize);
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -25,6 +26,7 @@
 import com.sun.org.apache.xpath.internal.functions.Function;
 import java.lang.reflect.InvocationTargetException;
 import java.util.HashMap;
+import java.util.Map;
 import javax.xml.transform.TransformerException;
 
 /**
@@ -146,20 +148,20 @@
   /**
    * The function table.
    */
-  private static Class m_functions[];
+  private static Class<?> m_functions[];
 
   /** Table of function name to function ID associations. */
-  private static final HashMap<String, Integer> m_functionID = new HashMap<>();
+  private static final Map<String, Integer> m_functionID = new HashMap<>();
 
   /**
    * The function table contains customized functions
    */
-  private Class m_functions_customer[] = new Class[NUM_ALLOWABLE_ADDINS];
+  private Class<?> m_functions_customer[] = new Class<?>[NUM_ALLOWABLE_ADDINS];
 
   /**
    * Table of function name to function ID associations for customized functions
    */
-  private HashMap<String, Integer> m_functionID_customer = new HashMap<>();
+  private Map<String, Integer> m_functionID_customer = new HashMap<>();
 
   /**
    * Number of built in functions.  Be sure to update this as
@@ -179,7 +181,7 @@
 
   static
   {
-    m_functions = new Class[NUM_BUILT_IN_FUNCS];
+    m_functions = new Class<?>[NUM_BUILT_IN_FUNCS];
     m_functions[FUNC_CURRENT] = com.sun.org.apache.xpath.internal.functions.FuncCurrent.class;
     m_functions[FUNC_LAST] = com.sun.org.apache.xpath.internal.functions.FuncLast.class;
     m_functions[FUNC_POSITION] = com.sun.org.apache.xpath.internal.functions.FuncPosition.class;
@@ -370,7 +372,7 @@
    * @param func A Implementation of an XPath Function object.
    * @return the position of the function in the internal index.
    */
-  public int installFunction(String name, Class func)
+  public int installFunction(String name, Class<?> func)
   {
 
     int funcIndex;
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.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,10 +21,9 @@
 
 package com.sun.org.apache.xpath.internal.compiler;
 
-import java.util.Vector;
-
 import com.sun.org.apache.xml.internal.utils.PrefixResolver;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
+import java.util.List;
 
 /**
  * This class is in charge of lexical processing of the XPath
@@ -103,11 +102,11 @@
    * Walk through the expression and build a token queue, and a map of the top-level
    * elements.
    * @param pat XSLT Expression.
-   * @param targetStrings Vector to hold Strings, may be null.
+   * @param targetStrings a list to hold Strings, may be null.
    *
    * @throws javax.xml.transform.TransformerException
    */
-  void tokenize(String pat, Vector targetStrings)
+  void tokenize(String pat, List<String> targetStrings)
           throws javax.xml.transform.TransformerException
   {
 
@@ -489,9 +488,9 @@
   /**
    * Record the current token in the passed vector.
    *
-   * @param targetStrings Vector of string.
+   * @param targetStrings a list of strings.
    */
-  private void recordTokenString(Vector targetStrings)
+  private void recordTokenString(List<String> targetStrings)
   {
 
     int tokPos = getTokenQueuePosFromMap(m_patternMapSize - 1);
@@ -505,25 +504,25 @@
       switch (tok)
       {
       case OpCodes.NODETYPE_COMMENT :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_COMMENT);
+        targetStrings.add(PsuedoNames.PSEUDONAME_COMMENT);
         break;
       case OpCodes.NODETYPE_TEXT :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_TEXT);
+        targetStrings.add(PsuedoNames.PSEUDONAME_TEXT);
         break;
       case OpCodes.NODETYPE_NODE :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
+        targetStrings.add(PsuedoNames.PSEUDONAME_ANY);
         break;
       case OpCodes.NODETYPE_ROOT :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_ROOT);
+        targetStrings.add(PsuedoNames.PSEUDONAME_ROOT);
         break;
       case OpCodes.NODETYPE_ANYELEMENT :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
+        targetStrings.add(PsuedoNames.PSEUDONAME_ANY);
         break;
       case OpCodes.NODETYPE_PI :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
+        targetStrings.add(PsuedoNames.PSEUDONAME_ANY);
         break;
       default :
-        targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
+        targetStrings.add(PsuedoNames.PSEUDONAME_ANY);
       }
     }
     else
@@ -540,7 +539,7 @@
         tokPos += 2;
       }
 
-      targetStrings.addElement(m_compiler.getTokenQueue().elementAt(tokPos));
+      targetStrings.add((String)m_compiler.getTokenQueue().elementAt(tokPos));
     }
   }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncCurrent.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncCurrent.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,17 +21,18 @@
 
 package com.sun.org.apache.xpath.internal.functions;
 
+import com.sun.org.apache.xalan.internal.res.XSLMessages;
+import com.sun.org.apache.xalan.internal.res.XSLTErrorResources;
 import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.axes.LocPathIterator;
 import com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest;
+import com.sun.org.apache.xpath.internal.axes.SubContextList;
 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
 import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.axes.SubContextList;
 import com.sun.org.apache.xpath.internal.patterns.StepPattern;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xalan.internal.res.XSLTErrorResources;
+import java.util.List;
 
 
 /**
@@ -75,7 +76,7 @@
   /**
    * No arguments to process, so this does nothing.
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     // no-op
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.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,9 +21,8 @@
 
 package com.sun.org.apache.xpath.internal.functions;
 
-import java.util.Vector;
-
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionNode;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
@@ -34,6 +33,8 @@
 import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
 import com.sun.org.apache.xpath.internal.res.XPATHMessages;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * An object of this class represents an extension call expression.  When
@@ -70,7 +71,7 @@
    *  function.
    *  @serial
    */
-  Vector m_argVec = new Vector();
+  List<Expression> m_argVec = new ArrayList<>();
 
   /**
    * This function is used to fixup variables from QNames to stack frame
@@ -83,7 +84,7 @@
    * to be offset to the current stack frame).
    * NEEDSDOC @param globalsSize
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
 
     if (null != m_argVec)
@@ -92,7 +93,7 @@
 
       for (int i = 0; i < nArgs; i++)
       {
-        Expression arg = (Expression) m_argVec.elementAt(i);
+        Expression arg = m_argVec.get(i);
 
         arg.fixupVariables(vars, globalsSize);
       }
@@ -137,7 +138,7 @@
    */
   public Expression getArg(int n) {
     if (n >= 0 && n < m_argVec.size())
-      return (Expression) m_argVec.elementAt(n);
+      return m_argVec.get(n);
     else
       return null;
   }
@@ -190,19 +191,19 @@
           new Object[] {toString()}));
 
     XObject result;
-    Vector argVec = new Vector();
+    List<XObject> argVec = new ArrayList<>();
     int nArgs = m_argVec.size();
 
     for (int i = 0; i < nArgs; i++)
     {
-      Expression arg = (Expression) m_argVec.elementAt(i);
+      Expression arg = m_argVec.get(i);
 
       XObject xobj = arg.execute(xctxt);
       /*
        * Should cache the arguments for func:function
        */
       xobj.allowDetachToRelease(false);
-      argVec.addElement(xobj);
+      argVec.add(xobj);
     }
     //dml
     ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject();
@@ -233,7 +234,7 @@
   public void setArg(Expression arg, int argNum)
           throws WrongNumberArgsException
   {
-    m_argVec.addElement(arg);
+    m_argVec.add(arg);
     arg.exprSetParent(this);
   }
 
@@ -285,7 +286,7 @@
   {
       for (int i = 0; i < m_argVec.size(); i++)
       {
-         Expression exp = (Expression)m_argVec.elementAt(i);
+         Expression exp = m_argVec.get(i);
          exp.callVisitors(new ArgExtOwner(exp), visitor);
       }
 
@@ -307,7 +308,7 @@
 
     for (int i = 0; i < nArgs; i++)
     {
-      Expression arg = (Expression) m_argVec.elementAt(i);
+      Expression arg = m_argVec.get(i);
 
       arg.exprSetParent(n);
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncFalse.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncFalse.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,9 +21,11 @@
 
 package com.sun.org.apache.xpath.internal.functions;
 
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.objects.XBoolean;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 /**
  * Execute the False() function.
@@ -49,7 +51,7 @@
   /**
    * No arguments to process, so this does nothing.
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     // no-op
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncHere.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncHere.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -21,15 +22,17 @@
  */
 package com.sun.org.apache.xpath.internal.functions;
 
-import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
 import com.sun.org.apache.xml.internal.dtm.DTM;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.NodeSetDTM;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
 import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
+import java.util.List;
+import javax.xml.transform.TransformerException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
 
 /**
  * Execute the XML Signature here() function.
@@ -103,5 +106,5 @@
     }
 
     @Override
-    public void fixupVariables(java.util.Vector vars, int globalsSize) { }
+    public void fixupVariables(List<QName> vars, int globalsSize) { }
 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncLast.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncLast.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
@@ -22,11 +22,13 @@
 package com.sun.org.apache.xpath.internal.functions;
 
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.axes.SubContextList;
 import com.sun.org.apache.xpath.internal.compiler.Compiler;
 import com.sun.org.apache.xpath.internal.objects.XNumber;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 
 /**
@@ -99,7 +101,7 @@
   /**
    * No arguments to process, so this does nothing.
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     // no-op
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncPosition.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncPosition.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
@@ -23,11 +23,13 @@
 
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.axes.SubContextList;
 import com.sun.org.apache.xpath.internal.compiler.Compiler;
 import com.sun.org.apache.xpath.internal.objects.XNumber;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 /**
  * Execute the Position() function.
@@ -128,7 +130,7 @@
   /**
    * No arguments to process, so this does nothing.
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     // no-op
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncTrue.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncTrue.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,9 +21,11 @@
 
 package com.sun.org.apache.xpath.internal.functions;
 
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.objects.XBoolean;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 /**
  * Execute the True() function.
@@ -49,7 +51,7 @@
   /**
    * No arguments to process, so this does nothing.
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     // no-op
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/Function2Args.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/Function2Args.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
@@ -22,9 +22,11 @@
 package com.sun.org.apache.xpath.internal.functions;
 
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
+import java.util.List;
 
 /**
  * Base class for functions that accept two arguments.
@@ -59,7 +61,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     super.fixupVariables(vars, globalsSize);
     if(null != m_arg1)
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/Function3Args.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/Function3Args.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
@@ -22,9 +22,11 @@
 package com.sun.org.apache.xpath.internal.functions;
 
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
+import java.util.List;
 
 /**
  * Base class for functions that accept three arguments.
@@ -59,7 +61,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     super.fixupVariables(vars, globalsSize);
     if(null != m_arg2)
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.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
@@ -22,10 +22,12 @@
 package com.sun.org.apache.xpath.internal.functions;
 
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
+import java.util.List;
 
 /**
  * Base class for functions that accept an undetermined number of multiple
@@ -98,7 +100,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     super.fixupVariables(vars, globalsSize);
     if(null != m_args)
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.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
@@ -22,9 +22,11 @@
 package com.sun.org.apache.xpath.internal.functions;
 
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
+import java.util.List;
 
 /**
  * Base class for functions that accept one argument.
@@ -116,7 +118,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     if(null != m_arg0)
       m_arg0.fixupVariables(vars, globalsSize);
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -27,7 +28,7 @@
 import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
 import java.util.ArrayList;
-import java.util.Vector;
+import java.util.List;
 import javax.xml.namespace.QName;
 import javax.xml.xpath.XPathFunction;
 import javax.xml.xpath.XPathFunctionException;
@@ -97,7 +98,7 @@
     /**
      * Execute the extension function.
      */
-    public Object extFunction(String ns, String funcName, Vector argVec,
+    public Object extFunction(String ns, String funcName, List<XObject> argVec,
         Object methodKey) throws javax.xml.transform.TransformerException {
         try {
 
@@ -128,9 +129,9 @@
                 resolver.resolveFunction ( myQName, arity );
 
             // not using methodKey
-            ArrayList argList = new ArrayList( arity);
+            List<Object> argList = new ArrayList<>( arity);
             for ( int i=0; i<arity; i++ ) {
-                Object argument = argVec.elementAt( i );
+                XObject argument = argVec.get( i );
                 // XNodeSet object() returns NodeVector and not NodeList
                 // Explicitly getting NodeList by using nodelist()
                 if ( argument instanceof XNodeSet ) {
@@ -157,8 +158,7 @@
     /**
      * Execute the extension function.
      */
-    public Object extFunction(FuncExtFunction extFunction,
-                              Vector argVec)
+    public Object extFunction(FuncExtFunction extFunction, List<XObject> argVec)
         throws javax.xml.transform.TransformerException {
         try {
             String namespace = extFunction.getNamespace();
@@ -172,16 +172,17 @@
             // throw XPathFunctionException
             if ( extensionInvocationDisabled ) {
                 String fmsg = XSLMessages.createXPATHMessage(
-                    XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,                    new Object[] { myQName.toString() } );
+                    XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
+                        new Object[] { myQName.toString() } );
                 throw new XPathFunctionException ( fmsg );
             }
 
             XPathFunction xpathFunction =
                 resolver.resolveFunction( myQName, arity );
 
-            ArrayList argList = new ArrayList( arity);
+            List<Object> argList = new ArrayList<>( arity);
             for ( int i=0; i<arity; i++ ) {
-                Object argument = argVec.elementAt( i );
+                XObject argument = argVec.get( i );
                 // XNodeSet object() returns NodeVector and not NodeList
                 // Explicitly getting NodeList by using nodelist()
                 if ( argument instanceof XNodeSet ) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XNodeSet.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XNodeSet.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
@@ -27,7 +27,8 @@
 import com.sun.org.apache.xml.internal.utils.XMLString;
 import com.sun.org.apache.xpath.internal.NodeSetDTM;
 import com.sun.org.apache.xpath.internal.axes.NodeSequence;
-
+import java.util.ArrayList;
+import java.util.List;
 import org.w3c.dom.NodeList;
 import org.w3c.dom.traversal.NodeIterator;
 
@@ -495,7 +496,7 @@
       DTMIterator list1 = iterRaw();
       DTMIterator list2 = ((XNodeSet) obj2).iterRaw();
       int node1;
-      java.util.Vector node2Strings = null;
+      List<XMLString> node2Strings = null;
 
       while (DTM.NULL != (node1 = list1.nextNode()))
       {
@@ -517,9 +518,9 @@
             }
 
             if (null == node2Strings)
-              node2Strings = new java.util.Vector();
+              node2Strings = new ArrayList<>();
 
-            node2Strings.addElement(s2);
+            node2Strings.add(s2);
           }
         }
         else
@@ -528,7 +529,7 @@
 
           for (int i = 0; i < n; i++)
           {
-            if (comparator.compareStrings(s1, (XMLString)node2Strings.elementAt(i)))
+            if (comparator.compareStrings(s1, node2Strings.get(i)))
             {
               result = true;
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XObject.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XObject.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,6 @@
 /*
  * 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
@@ -20,11 +21,10 @@
 
 package com.sun.org.apache.xpath.internal.objects;
 
-import java.io.Serializable;
-
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xml.internal.utils.XMLString;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
@@ -33,7 +33,8 @@
 import com.sun.org.apache.xpath.internal.XPathException;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
+import java.io.Serializable;
+import java.util.List;
 import org.w3c.dom.DocumentFragment;
 import org.w3c.dom.NodeList;
 import org.w3c.dom.traversal.NodeIterator;
@@ -714,7 +715,7 @@
   /**
    * XObjects should not normally need to fix up variables.
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     // no-op
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XRTreeFragSelectWrapper.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/objects/XRTreeFragSelectWrapper.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
@@ -23,10 +23,12 @@
 
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xml.internal.utils.XMLString;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
+import java.util.List;
 
 /**
  * This class makes an select statement act like an result tree fragment.
@@ -49,7 +51,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     ((Expression)m_obj).fixupVariables(vars, globalsSize);
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/operations/Operation.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/operations/Operation.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,11 +21,13 @@
 
 package com.sun.org.apache.xpath.internal.operations;
 
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 /**
  * The baseclass for a binary operation.
@@ -52,7 +54,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     m_left.fixupVariables(vars, globalsSize);
     m_right.fixupVariables(vars, globalsSize);
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/operations/UnaryOperation.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/operations/UnaryOperation.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,11 +21,13 @@
 
 package com.sun.org.apache.xpath.internal.operations;
 
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 /**
  * The unary operation base class.
@@ -48,7 +50,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     m_right.fixupVariables(vars, globalsSize);
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/operations/Variable.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/operations/Variable.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,13 +21,10 @@
 
 package com.sun.org.apache.xpath.internal.operations;
 
-import javax.xml.transform.TransformerException;
-
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
 import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPath;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.axes.PathComponent;
@@ -35,6 +32,8 @@
 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
 import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
+import java.util.List;
+import javax.xml.transform.TransformerException;
 
 
 /**
@@ -115,14 +114,14 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     m_fixUpWasCalled = true;
     int sz = vars.size();
 
     for (int i = vars.size()-1; i >= 0; i--)
     {
-      QName qn = (QName)vars.elementAt(i);
+      QName qn = vars.get(i);
       // System.out.println("qn: "+qn);
       if(qn.equals(m_qname))
       {
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.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
@@ -23,12 +23,14 @@
 
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.objects.XNumber;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 /**
  * Match pattern step that contains a function.
@@ -80,7 +82,7 @@
    * in the stack frame (but variables above the globalsTop value will need
    * to be offset to the current stack frame).
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     super.fixupVariables(vars, globalsSize);
     m_functionExpr.fixupVariables(vars, globalsSize);
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/NodeTest.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/NodeTest.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
@@ -23,6 +23,7 @@
 
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMFilter;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPath;
@@ -30,6 +31,8 @@
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.objects.XNumber;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * This is the basic node test class for both match patterns and location path
@@ -414,46 +417,46 @@
   public static void debugWhatToShow(int whatToShow)
   {
 
-    java.util.Vector v = new java.util.Vector();
+    List<String> v = new ArrayList<>();
 
     if (0 != (whatToShow & DTMFilter.SHOW_ATTRIBUTE))
-      v.addElement("SHOW_ATTRIBUTE");
+      v.add("SHOW_ATTRIBUTE");
 
     if (0 != (whatToShow & DTMFilter.SHOW_NAMESPACE))
-      v.addElement("SHOW_NAMESPACE");
+      v.add("SHOW_NAMESPACE");
 
     if (0 != (whatToShow & DTMFilter.SHOW_CDATA_SECTION))
-      v.addElement("SHOW_CDATA_SECTION");
+      v.add("SHOW_CDATA_SECTION");
 
     if (0 != (whatToShow & DTMFilter.SHOW_COMMENT))
-      v.addElement("SHOW_COMMENT");
+      v.add("SHOW_COMMENT");
 
     if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT))
-      v.addElement("SHOW_DOCUMENT");
+      v.add("SHOW_DOCUMENT");
 
     if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_FRAGMENT))
-      v.addElement("SHOW_DOCUMENT_FRAGMENT");
+      v.add("SHOW_DOCUMENT_FRAGMENT");
 
     if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_TYPE))
-      v.addElement("SHOW_DOCUMENT_TYPE");
+      v.add("SHOW_DOCUMENT_TYPE");
 
     if (0 != (whatToShow & DTMFilter.SHOW_ELEMENT))
-      v.addElement("SHOW_ELEMENT");
+      v.add("SHOW_ELEMENT");
 
     if (0 != (whatToShow & DTMFilter.SHOW_ENTITY))
-      v.addElement("SHOW_ENTITY");
+      v.add("SHOW_ENTITY");
 
     if (0 != (whatToShow & DTMFilter.SHOW_ENTITY_REFERENCE))
-      v.addElement("SHOW_ENTITY_REFERENCE");
+      v.add("SHOW_ENTITY_REFERENCE");
 
     if (0 != (whatToShow & DTMFilter.SHOW_NOTATION))
-      v.addElement("SHOW_NOTATION");
+      v.add("SHOW_NOTATION");
 
     if (0 != (whatToShow & DTMFilter.SHOW_PROCESSING_INSTRUCTION))
-      v.addElement("SHOW_PROCESSING_INSTRUCTION");
+      v.add("SHOW_PROCESSING_INSTRUCTION");
 
     if (0 != (whatToShow & DTMFilter.SHOW_TEXT))
-      v.addElement("SHOW_TEXT");
+      v.add("SHOW_TEXT");
 
     int n = v.size();
 
@@ -462,7 +465,7 @@
       if (i > 0)
         System.out.print(" | ");
 
-      System.out.print(v.elementAt(i));
+      System.out.print(v.get(i));
     }
 
     if (0 == n)
@@ -677,7 +680,7 @@
   /**
    * Node tests by themselves do not need to fix up variables.
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     // no-op
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/StepPattern.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/StepPattern.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
@@ -25,6 +25,7 @@
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
 import com.sun.org.apache.xml.internal.dtm.DTMFilter;
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathContext;
@@ -32,6 +33,7 @@
 import com.sun.org.apache.xpath.internal.axes.SubContextList;
 import com.sun.org.apache.xpath.internal.compiler.PsuedoNames;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 /**
  * This class represents a single pattern match step.
@@ -156,7 +158,7 @@
    * to be offset to the current stack frame).
    * @param globalsSize The number of variables in the global variable area.
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
 
     super.fixupVariables(vars, globalsSize);
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/UnionPattern.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/patterns/UnionPattern.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,11 +21,13 @@
 
 package com.sun.org.apache.xpath.internal.patterns;
 
+import com.sun.org.apache.xml.internal.utils.QName;
 import com.sun.org.apache.xpath.internal.Expression;
 import com.sun.org.apache.xpath.internal.ExpressionOwner;
 import com.sun.org.apache.xpath.internal.XPathContext;
 import com.sun.org.apache.xpath.internal.XPathVisitor;
 import com.sun.org.apache.xpath.internal.objects.XObject;
+import java.util.List;
 
 /**
  * This class represents a union pattern, which can have multiple individual
@@ -43,7 +45,7 @@
   /**
    * No arguments to process, so this does nothing.
    */
-  public void fixupVariables(java.util.Vector vars, int globalsSize)
+  public void fixupVariables(List<QName> vars, int globalsSize)
   {
     for (int i = 0; i < m_patterns.length; i++)
     {
--- a/src/java.xml/share/classes/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,12 +39,12 @@
  * @author Santiago.PericasGeertsen@sun.com
  */
 public class ThreadLocalBufferAllocator {
-   private static ThreadLocal<SoftReference> tlba = new ThreadLocal<>();
+   private static ThreadLocal<SoftReference<BufferAllocator>> tlba = new ThreadLocal<>();
 
    public static BufferAllocator getBufferAllocator() {
         SoftReference<BufferAllocator> bAllocatorRef = tlba.get();
         if (bAllocatorRef == null || bAllocatorRef.get() == null) {
-            bAllocatorRef = new SoftReference(new BufferAllocator());
+            bAllocatorRef = new SoftReference<>(new BufferAllocator());
             tlba.set(bAllocatorRef);
         }
 
--- a/src/java.xml/share/classes/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -42,9 +42,10 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 import java.util.Random;
 import java.util.Set;
-import java.util.Vector;
 import javax.xml.XMLConstants;
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.stream.XMLOutputFactory;
@@ -111,12 +112,12 @@
     /**
      * Collects attributes when the writer is in reparing mode.
      */
-    private ArrayList<Attribute> fAttributeCache;
+    private List<Attribute> fAttributeCache;
 
     /**
      * Collects namespace declarations when the writer is in reparing mode.
      */
-    private ArrayList<QName> fNamespaceDecls;
+    private List<QName> fNamespaceDecls;
 
     /**
      * Namespace context encapsulating user specified context
@@ -164,7 +165,7 @@
      * the same uri as the default namespace; It's added to avoid changing the
      * current impl. which has many redundant code for the repair mode
      */
-    HashMap<String, String> fAttrNamespace = null;
+    Map<String, String> fAttrNamespace = null;
 
     /**
      * Creates a new instance of XMLStreamWriterImpl. Uses platform's default
@@ -2146,7 +2147,7 @@
 
         //Cleanup note: leaving these warnings to a xerces.internal.util cleanup
         public Iterator<String> getPrefixes(String uri) {
-            Vector prefixes = null;
+            List<String> prefixes = null;
             Iterator<String> itr = null;
 
             if (uri != null) {
--- a/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java	Wed Oct 18 13:25:49 2017 -0700
@@ -270,5 +270,5 @@
      * @throws IllegalArgumentException When {@code namespaceURI} is
      *   {@code null}
      */
-    Iterator getPrefixes(String namespaceURI);
+    Iterator<String> getPrefixes(String namespaceURI);
 }
--- a/src/java.xml/share/classes/javax/xml/namespace/QName.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/javax/xml/namespace/QName.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,8 @@
 package javax.xml.namespace;
 
 import java.io.Serializable;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
 import javax.xml.XMLConstants;
+import jdk.xml.internal.SecuritySupport;
 
 /**
  * <p><code>QName</code> represents a <strong>qualified name</strong>
@@ -106,14 +104,11 @@
     static {
         try {
             // use a privileged block as reading a system property
-            String valueUseCompatibleSerialVersionUID = (String) AccessController.doPrivileged(
-                    new PrivilegedAction() {
-                        public Object run() {
-                            return System.getProperty("com.sun.xml.namespace.QName.useCompatibleSerialVersionUID");
-                        }
-                    }
-            );
-            useDefaultSerialVersionUID = (valueUseCompatibleSerialVersionUID != null && valueUseCompatibleSerialVersionUID.equals("1.0")) ? false : true;
+            String valueUseCompatibleSerialVersionUID = SecuritySupport.getSystemProperty(
+                    "com.sun.xml.namespace.QName.useCompatibleSerialVersionUID");
+
+            useDefaultSerialVersionUID = (valueUseCompatibleSerialVersionUID != null
+                    && valueUseCompatibleSerialVersionUID.equals("1.0")) ? false : true;
         } catch (Exception exception) {
             // use default if any Exceptions
             useDefaultSerialVersionUID = true;
--- a/src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java	Wed Oct 18 13:25:49 2017 -0700
@@ -94,7 +94,7 @@
      *
      * Use bootstrap classLoader if cl = null and useBSClsLoader is true
      */
-    static private Class getProviderClass(String className, ClassLoader cl,
+    static private Class<?> getProviderClass(String className, ClassLoader cl,
             boolean doFallback, boolean useBSClsLoader) throws ClassNotFoundException
     {
         try {
--- a/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java	Wed Oct 18 13:25:49 2017 -0700
@@ -236,7 +236,7 @@
      * @return Created class or <code>null</code>.
      */
     private Class<?> createClass(String className) {
-        Class clazz;
+        Class<?> clazz;
         // make sure we have access to restricted packages
         boolean internal = false;
         if (System.getSecurityManager() != null) {
--- a/src/java.xml/share/classes/javax/xml/xpath/XPathFunction.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/javax/xml/xpath/XPathFunction.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,6 +51,6 @@
    *
    * @throws XPathFunctionException If <code>args</code> cannot be evaluated with this <code>XPath</code> function.
    */
-  public Object evaluate(List args)
+  public Object evaluate(List<Object> args)
     throws XPathFunctionException;
 }
--- a/src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java	Wed Oct 18 13:25:49 2017 -0700
@@ -42,17 +42,18 @@
 
 package org.w3c.dom.bootstrap;
 
-import java.util.StringTokenizer;
-import java.util.Vector;
-import org.w3c.dom.DOMImplementationSource;
-import org.w3c.dom.DOMImplementationList;
-import org.w3c.dom.DOMImplementation;
+import java.io.BufferedReader;
 import java.io.InputStream;
-import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.lang.reflect.InvocationTargetException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.DOMImplementationList;
+import org.w3c.dom.DOMImplementationSource;
 
 /**
  * A factory that enables applications to obtain instances of
@@ -98,7 +99,7 @@
     /**
      * The list of DOMImplementationSources.
      */
-    private Vector sources;
+    private List<DOMImplementationSource> sources;
 
     /**
      * Default class name.
@@ -109,9 +110,9 @@
             "com.sun.org.apache.xerces.internal.dom";
     /**
      * Private constructor.
-     * @param srcs Vector List of DOMImplementationSources
+     * @param srcs List of DOMImplementationSources
      */
-    private DOMImplementationRegistry(final Vector srcs) {
+    private DOMImplementationRegistry(final List<DOMImplementationSource> srcs) {
         sources = srcs;
     }
 
@@ -148,7 +149,7 @@
         InstantiationException,
         IllegalAccessException,
         ClassCastException {
-        Vector sources = new Vector();
+        List<DOMImplementationSource> sources = new ArrayList<>();
 
         ClassLoader classLoader = getClassLoader();
         // fetch system property:
@@ -164,7 +165,7 @@
             //
             // DOM Implementations can modify here to add *additional* fallback
             // mechanisms to access a list of default DOMImplementationSources.
-            //fall back to JAXP implementation class com.sun.org.apache.xerces.internal.dom.DOMXSImplementationSourceImpl
+            //fall back to JAXP implementation class DOMXSImplementationSourceImpl
             p = FALLBACK_CLASS;
         }
         if (p != null) {
@@ -178,7 +179,7 @@
                         internal = true;
                     }
                 }
-                Class sourceClass = null;
+                Class<?> sourceClass = null;
                 if (classLoader != null && !internal) {
                     sourceClass = classLoader.loadClass(sourceName);
                 } else {
@@ -187,7 +188,7 @@
                 try {
                     DOMImplementationSource source =
                         (DOMImplementationSource) sourceClass.getConstructor().newInstance();
-                    sources.addElement(source);
+                    sources.add(source);
                 } catch (NoSuchMethodException | InvocationTargetException e) {
                     throw new InstantiationException(e.getMessage());
                 }
@@ -213,7 +214,7 @@
         String name = null;
         for (int i = 0; i < size; i++) {
             DOMImplementationSource source =
-                (DOMImplementationSource) sources.elementAt(i);
+                (DOMImplementationSource) sources.get(i);
             DOMImplementation impl = source.getDOMImplementation(features);
             if (impl != null) {
                 return impl;
@@ -234,16 +235,16 @@
      * @return A list of DOMImplementations that support the desired features.
      */
     public DOMImplementationList getDOMImplementationList(final String features) {
-        final Vector implementations = new Vector();
+        final List<DOMImplementation> implementations = new ArrayList<>();
         int size = sources.size();
         for (int i = 0; i < size; i++) {
             DOMImplementationSource source =
-                (DOMImplementationSource) sources.elementAt(i);
+                (DOMImplementationSource) sources.get(i);
             DOMImplementationList impls =
                 source.getDOMImplementationList(features);
             for (int j = 0; j < impls.getLength(); j++) {
                 DOMImplementation impl = impls.item(j);
-                implementations.addElement(impl);
+                implementations.add(impl);
             }
         }
         return new DOMImplementationList() {
@@ -251,8 +252,8 @@
                     if (index >= 0 && index < implementations.size()) {
                         try {
                             return (DOMImplementation)
-                                implementations.elementAt(index);
-                        } catch (ArrayIndexOutOfBoundsException e) {
+                                implementations.get(index);
+                        } catch (IndexOutOfBoundsException e) {
                             return null;
                         }
                     }
@@ -275,7 +276,7 @@
             throw new NullPointerException();
         }
         if (!sources.contains(s)) {
-            sources.addElement(s);
+            sources.add(s);
         }
     }
 
@@ -343,7 +344,7 @@
      * @return The Context Classloader
      */
     private static ClassLoader getContextClassLoader() {
-        return AccessController.doPrivileged(new PrivilegedAction<>() {
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
                 @Override
                 public ClassLoader run() {
                     ClassLoader classLoader = null;
@@ -365,7 +366,7 @@
      * @return the system property
      */
     private static String getSystemProperty(final String name) {
-        return AccessController.doPrivileged(new PrivilegedAction<>() {
+        return AccessController.doPrivileged(new PrivilegedAction<String>() {
                     @Override
                     public String run() {
                         return System.getProperty(name);
@@ -384,7 +385,7 @@
      */
     private static InputStream getResourceAsStream(final ClassLoader classLoader,
                                                    final String name) {
-        return AccessController.doPrivileged(new PrivilegedAction<>() {
+        return AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
                 @Override
                 public InputStream run() {
                     InputStream ris;
--- a/src/java.xml/share/classes/org/xml/sax/helpers/AttributeListImpl.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/org/xml/sax/helpers/AttributeListImpl.java	Wed Oct 18 13:25:49 2017 -0700
@@ -30,10 +30,10 @@
 
 package org.xml.sax.helpers;
 
+import java.util.ArrayList;
+import java.util.List;
 import org.xml.sax.AttributeList;
 
-import java.util.Vector;
-
 
 /**
  * Default implementation for AttributeList.
@@ -163,9 +163,9 @@
      */
     public void addAttribute (String name, String type, String value)
     {
-        names.addElement(name);
-        types.addElement(type);
-        values.addElement(value);
+        names.add(name);
+        types.add(type);
+        values.add(value);
     }
 
 
@@ -188,9 +188,9 @@
         int i = names.indexOf(name);
 
         if (i >= 0) {
-            names.removeElementAt(i);
-            types.removeElementAt(i);
-            values.removeElementAt(i);
+            names.remove(i);
+            types.remove(i);
+            values.remove(i);
         }
     }
 
@@ -207,9 +207,9 @@
      */
     public void clear ()
     {
-        names.removeAllElements();
-        types.removeAllElements();
-        values.removeAllElements();
+        names.clear();
+        types.clear();
+        values.clear();
     }
 
 
@@ -245,8 +245,8 @@
             return null;
         }
         try {
-            return (String)names.elementAt(i);
-        } catch (ArrayIndexOutOfBoundsException e) {
+            return names.get(i);
+        } catch (IndexOutOfBoundsException e) {
             return null;
         }
     }
@@ -268,8 +268,8 @@
             return null;
         }
         try {
-            return (String)types.elementAt(i);
-        } catch (ArrayIndexOutOfBoundsException e) {
+            return types.get(i);
+        } catch (IndexOutOfBoundsException e) {
             return null;
         }
     }
@@ -289,8 +289,8 @@
             return null;
         }
         try {
-            return (String)values.elementAt(i);
-        } catch (ArrayIndexOutOfBoundsException e) {
+            return values.get(i);
+        } catch (IndexOutOfBoundsException e) {
             return null;
         }
     }
@@ -328,9 +328,9 @@
     // Internal state.
     ////////////////////////////////////////////////////////////////////
 
-    Vector names = new Vector();
-    Vector types = new Vector();
-    Vector values = new Vector();
+    List<String> names = new ArrayList<>();
+    List<String> types = new ArrayList<>();
+    List<String> values = new ArrayList<>();
 
 }
 
--- a/src/java.xml/share/classes/org/xml/sax/helpers/NamespaceSupport.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/org/xml/sax/helpers/NamespaceSupport.java	Wed Oct 18 13:25:49 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -140,7 +140,7 @@
     /**
      * An empty enumeration.
      */
-    private final static Enumeration EMPTY_ENUMERATION =
+    private final static Enumeration<String> EMPTY_ENUMERATION =
             Collections.enumeration(new ArrayList<String>());
 
 
@@ -409,7 +409,7 @@
      * @see #getDeclaredPrefixes
      * @see #getURI
      */
-    public Enumeration getPrefixes ()
+    public Enumeration<String> getPrefixes ()
     {
         return currentContext.getPrefixes();
     }
@@ -463,12 +463,12 @@
      * @see #getDeclaredPrefixes
      * @see #getURI
      */
-    public Enumeration getPrefixes (String uri)
+    public Enumeration<String> getPrefixes (String uri)
     {
         List<String> prefixes = new ArrayList<>();
-        Enumeration allPrefixes = getPrefixes();
+        Enumeration<String> allPrefixes = getPrefixes();
         while (allPrefixes.hasMoreElements()) {
-            String prefix = (String)allPrefixes.nextElement();
+            String prefix = allPrefixes.nextElement();
             if (uri.equals(getURI(prefix))) {
                 prefixes.add(prefix);
             }
@@ -489,7 +489,7 @@
      * @see #getPrefixes
      * @see #getURI
      */
-    public Enumeration getDeclaredPrefixes ()
+    public Enumeration<String> getDeclaredPrefixes ()
     {
         return currentContext.getDeclaredPrefixes();
     }
@@ -766,7 +766,7 @@
          * @return An enumeration of prefixes (possibly empty).
          * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes
          */
-        Enumeration getDeclaredPrefixes ()
+        Enumeration<String> getDeclaredPrefixes ()
         {
             if (declarations == null) {
                 return EMPTY_ENUMERATION;
@@ -784,7 +784,7 @@
          * @return An enumeration of prefixes (never empty).
          * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes
          */
-        Enumeration getPrefixes ()
+        Enumeration<String> getPrefixes ()
         {
             if (prefixTable == null) {
                 return EMPTY_ENUMERATION;
--- a/src/java.xml/share/classes/org/xml/sax/helpers/ParserAdapter.java	Tue Sep 05 13:40:14 2017 +0200
+++ b/src/java.xml/share/classes/org/xml/sax/helpers/ParserAdapter.java	Wed Oct 18 13:25:49 2017 -0700
@@ -32,8 +32,9 @@
 package org.xml.sax.helpers;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Enumeration;
-import java.util.Vector;
+import java.util.List;
 import jdk.xml.internal.SecuritySupport;
 import org.xml.sax.AttributeList; // deprecated
 import org.xml.sax.Attributes;
@@ -508,7 +509,7 @@
                                 // first pass; they should be
                                 // ignored if there's a second pass,
                                 // but reported otherwise.
-        Vector exceptions = null;
+        List<SAXException> exceptions = null;
 
                                 // If we're not doing Namespace
                                 // processing, dispatch this quickly.
@@ -602,8 +603,8 @@
                                   type, value);
             } catch (SAXException e) {
                 if (exceptions == null)
-                    exceptions = new Vector();
-                exceptions.addElement(e);
+                    exceptions = new ArrayList<>();
+                exceptions.add(e);
                 atts.addAttribute("", attQName, attQName, type, value);
             }
         }
@@ -612,7 +613,7 @@
         if (exceptions != null && errorHandler != null) {
             for (int i = 0; i < exceptions.size(); i++)
                 errorHandler.error((SAXParseException)
-                                (exceptions.elementAt(i)));
+                                (exceptions.get(i)));
         }
 
                                 // OK, finally report the event.
@@ -648,9 +649,9 @@
         String names[] = processName(qName, false, false);
         if (contentHandler != null) {
             contentHandler.endElement(names[0], names[1], names[2]);
-            Enumeration prefixes = nsSupport.getDeclaredPrefixes();
-            while (prefixes.hasMoreElements()) {
-                String prefix = (String)prefixes.nextElement();
+            Enumeration<String> ePrefixes = nsSupport.getDeclaredPrefixes();
+            while (ePrefixes.hasMoreElements()) {
+                String prefix = ePrefixes.nextElement();
                 contentHandler.endPrefixMapping(prefix);
             }
         }