8181151: Fix lint warnings in JAXP repo: cast
authorjoehw
Tue, 07 Nov 2017 16:19:55 -0800
changeset 47712 bde0215f1f70
parent 47711 c992889ffb50
child 47713 530f16bacbfd
child 55801 415b54aa1007
8181151: Fix lint warnings in JAXP repo: cast Reviewed-by: lancea, rriggs
src/java.xml/share/classes/com/sun/java_cup/internal/runtime/lr_parser.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.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/BinOpExpr.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/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/LogicalExpr.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Message.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/Number.java
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.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/SyntaxTreeNode.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/UnionPathExpr.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/util/MethodGenerator.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/SAX2StAXEventWriter.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/CoreDocumentImpl.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/DocumentImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.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/dv/util/Base64.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.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/xs/AttributePSVImpl.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.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/XSComplexTypeDecl.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/models/CMBuilder.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/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/XSDUniqueOrKeyTraverser.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/jaxp/validation/SimpleXMLSchema.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/parsers/AbstractDOMParser.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/SymbolHash.java
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMManagerDefault.java
src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeList.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/serialize/BaseMarkupSerializer.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/ToStream.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/NodeSet.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/VariableStack.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/LocPathIterator.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/compiler/OpMap.java
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java
src/java.xml/share/classes/javax/xml/xpath/XPathException.java
src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java
src/java.xml/share/classes/org/xml/sax/helpers/NamespaceSupport.java
--- a/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/lr_parser.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/java_cup/internal/runtime/lr_parser.java	Tue Nov 07 16:19:55 2017 -0800
@@ -946,7 +946,7 @@
           if (debug)
             debug_message("# Pop stack by one, state was # " +
                           (stack.peek()).parse_state);
-          left_pos = ((Symbol)stack.pop()).left;
+          left_pos = stack.pop().left;
           tos--;
 
           /* if we have hit bottom, we fail */
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -616,7 +616,7 @@
     public static boolean leapYear()
     {
       Calendar cal = Calendar.getInstance();
-      int yr = (int)cal.get(Calendar.YEAR);
+      int yr = cal.get(Calendar.YEAR);
       return (yr % 400 == 0 || (yr % 100 != 0 && yr % 4 == 0));
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -115,7 +115,7 @@
         final List<SyntaxTreeNode> contents = getContents();
         final int count = contents.size();
         for (int i=0; i<count; i++) {
-            SyntaxTreeNode child = (SyntaxTreeNode)contents.get(i);
+            SyntaxTreeNode child = contents.get(i);
             if (child instanceof XslAttribute) {
                 parser.getSymbolTable().setCurrentNode(child);
                 child.parseContents(parser);
@@ -184,7 +184,7 @@
         // Translate all local attributes
         final Iterator<SyntaxTreeNode> attributes = elements();
         while (attributes.hasNext()) {
-            SyntaxTreeNode element = (SyntaxTreeNode)attributes.next();
+            SyntaxTreeNode element = attributes.next();
             if (element instanceof XslAttribute) {
                 final XslAttribute attribute = (XslAttribute)element;
                 attribute.translate(classGen, methodGen);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 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().get(0);
+            final Type arg1 = ptype.argsType().get(0);
             if (!arg1.identicalTo(tleft)) {
                 _left = new CastExpr(_left, arg1);
             }
-            final Type arg2 = (Type) ptype.argsType().get(1);
+            final 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/FilterExpr.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -75,7 +75,7 @@
         if (_predicates != null) {
             final int n = _predicates.size();
             for (int i = 0; i < n; i++) {
-                final Expression exp = (Expression)_predicates.get(i);
+                final Expression exp = _predicates.get(i);
                 exp.setParser(parser);
                 exp.setParent(this);
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -53,7 +53,7 @@
      */
     public FunctionAvailableCall(QName fname, List<Expression> arguments) {
         super(fname, arguments);
-        _arg = (Expression)arguments.get(0);
+        _arg = arguments.get(0);
         _type = null;
 
         if (_arg instanceof LiteralExpr) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -443,7 +443,7 @@
 
         if (ptype != null) {
             for (int i = 0; i < n; i++) {
-                final Type argType = (Type) ptype.argsType().get(i);
+                final Type argType = ptype.argsType().get(i);
                 final Expression exp = _arguments.get(i);
                 if (!argType.identicalTo(exp.getType())) {
                     try {
@@ -557,7 +557,7 @@
                     hasThisArgument = true;
 
                 Expression firstArg = _arguments.get(0);
-                Type firstArgType = (Type)firstArg.typeCheck(stable);
+                Type firstArgType = firstArg.typeCheck(stable);
 
                 if (_namespace_format == NAMESPACE_FORMAT_CLASS
                     && firstArgType instanceof ObjectType
@@ -608,7 +608,7 @@
         _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.get(i);
+            final Method method = methods.get(i);
             final Class<?>[] paramTypes = method.getParameterTypes();
 
             int currMethodDistance = 0;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 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().get(0);
+            Type arg1 = 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().get(1);
+            Type arg2 = 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/Message.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Message.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -67,7 +67,7 @@
                 il.append(new PUSH(cpg, ""));
             break;
             case 1:
-                SyntaxTreeNode child = (SyntaxTreeNode) elementAt(0);
+                SyntaxTreeNode child = elementAt(0);
                 if (child instanceof Text) {
                     il.append(new PUSH(cpg, ((Text) child).getText()));
                     break;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -229,12 +229,12 @@
     }
 
     private int partition(List<Template> templates, int p, int r) {
-        final Template x = (Template)templates.get(p);
+        final Template x = templates.get(p);
         int i = p - 1;
         int j = r + 1;
         while (true) {
-            while (x.compareTo((Template)templates.get(--j)) > 0);
-            while (x.compareTo((Template)templates.get(++i)) < 0);
+            while (x.compareTo(templates.get(--j)) > 0);
+            while (x.compareTo(templates.get(++i)) < 0);
             if (i < j) {
                 templates.set(j, templates.set(i, templates.get(j)));
             }
@@ -366,7 +366,7 @@
             boolean inserted = false;
             for (int i = 0; i < patterns.size(); i++) {
                 final LocationPathPattern lppToCompare =
-                    (LocationPathPattern)patterns.get(i);
+                    patterns.get(i);
 
                 if (pattern.noSmallerThan(lppToCompare)) {
                     inserted = true;
@@ -1136,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.get(i);
+            final String name = names.get(i);
             isAttribute[i+DTM.NTYPES] = isAttributeName(name);
             isNamespace[i+DTM.NTYPES] = isNamespaceName(name);
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -481,7 +481,7 @@
 
         // Initialize closure variables
         for (int i = 0; i < closureLen; i++) {
-            final VariableRefBase varRef = (VariableRefBase) _closureVars.get(i);
+            final VariableRefBase varRef = _closureVars.get(i);
             final VariableBase var = varRef.getVariable();
             final Type varType = var.getType();
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -433,7 +433,7 @@
             reader.setContentHandler(this);
             reader.parse(input);
             // Find the start of the stylesheet within the tree
-            return (SyntaxTreeNode)getStylesheet(_root);
+            return getStylesheet(_root);
         }
         catch (IOException e) {
             if (_xsltc.debug()) e.printStackTrace();
@@ -668,7 +668,7 @@
         else
             source = new InputSource(location);
 
-        SyntaxTreeNode external = (SyntaxTreeNode)parse(source);
+        SyntaxTreeNode external = parse(source);
         return(external);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -419,7 +419,7 @@
         final List<VariableRefBase> dups = new ArrayList<>();
 
         for (int j = 0; j < nsorts; j++) {
-            final Sort sort = (Sort) sortObjects.get(j);
+            final Sort sort = sortObjects.get(j);
             final int length = (sort._closureVars == null) ? 0 :
                 sort._closureVars.size();
 
@@ -553,7 +553,7 @@
         // Initialize closure in record class
         final int ndups = dups.size();
         for (int i = 0; i < ndups; i++) {
-            final VariableRefBase varRef = (VariableRefBase) dups.get(i);
+            final VariableRefBase varRef = dups.get(i);
             final VariableBase var = varRef.getVariable();
             final Type varType = var.getType();
 
@@ -617,7 +617,7 @@
             final int length = (sort._closureVars == null) ? 0 :
                 sort._closureVars.size();
             for (int i = 0; i < length; i++) {
-                final VariableRefBase varRef = (VariableRefBase) sort._closureVars.get(i);
+                final VariableRefBase varRef = sort._closureVars.get(i);
 
                 // Discard duplicate variable references
                 if (dups.contains(varRef)) continue;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -856,7 +857,7 @@
      */
     protected final SyntaxTreeNode lastChild() {
         if (_contents.isEmpty()) return null;
-        return (SyntaxTreeNode)_contents.get(_contents.size() - 1);
+        return _contents.get(_contents.size() - 1);
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -191,7 +191,7 @@
      * (e.g. match="A/B | A/C").
      */
     private InstructionHandle getTemplateHandle(Template template) {
-        return (InstructionHandle)_mode.getTemplateInstructionHandle(template);
+        return _mode.getTemplateInstructionHandle(template);
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -60,7 +60,7 @@
         final List<Expression> components = new ArrayList<>();
         flatten(components);
         final int size = components.size();
-        _components = (Expression[])components.toArray(new Expression[size]);
+        _components = components.toArray(new Expression[size]);
         for (int i = 0; i < size; i++) {
             _components[i].setParser(parser);
             _components[i].setParent(this);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1311,7 +1311,7 @@
               QName RESULT = null;
                 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;
+                String qname = (String)(parser_stack.get(parser_top-0)).value;
                  RESULT = parser.getQNameIgnoreDefaultNs(qname);
               parser_result = new Symbol(37/*QName*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1323,7 +1323,7 @@
               Object RESULT = null;
                 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;
+                QName qn = (QName)(parser_stack.get(parser_top-0)).value;
                  RESULT = qn;
               parser_result = new Symbol(26/*NameTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1353,7 +1353,7 @@
               Object RESULT = null;
                 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;
+                String l = (String)(parser_stack.get(parser_top-1)).value;
 
            QName name = parser.getQNameIgnoreDefaultNs("name");
            Expression exp = new EqualityExpr(Operators.EQ,
@@ -1400,7 +1400,7 @@
               Object RESULT = null;
                 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;
+                Object nt = parser_stack.get(parser_top-0).value;
                  RESULT = nt;
               parser_result = new Symbol(25/*NodeTest*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1412,7 +1412,7 @@
               Expression RESULT = null;
                 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;
+                Expression ex = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ex;
               parser_result = new Symbol(3/*Argument*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1424,7 +1424,7 @@
               QName RESULT = null;
                 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;
+                QName vname = (QName)(parser_stack.get(parser_top-0)).value;
 
             RESULT = vname;
 
@@ -1438,7 +1438,7 @@
               QName RESULT = null;
                 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;
+                QName fname = (QName)(parser_stack.get(parser_top-0)).value;
 
             RESULT = fname;
 
@@ -1452,11 +1452,11 @@
                 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;
+                Expression arg = (Expression)(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;
+                List<Expression> argl = (ArrayList<Expression>)(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);
@@ -1469,7 +1469,7 @@
               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;
+                Expression arg = (Expression)(parser_stack.get(parser_top-0)).value;
 
             List<Expression> temp = new ArrayList<>();
             temp.add(arg);
@@ -1485,11 +1485,11 @@
                 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;
+                QName fname = (QName)(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;
+                List<Expression> argl = (ArrayList<Expression>)(parser_stack.get(parser_top-1)).value;
 
           if (fname == parser.getQNameIgnoreDefaultNs("concat")) {
             RESULT = new ConcatCall(fname, argl);
@@ -1584,7 +1584,7 @@
               Expression RESULT = null;
                 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;
+                QName fname = (QName)(parser_stack.get(parser_top-2)).value;
 
 
           if (fname == parser.getQNameIgnoreDefaultNs("current")) {
@@ -1640,7 +1640,7 @@
               Expression RESULT = null;
                 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;
+                QName varName = (QName)(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.
@@ -1672,7 +1672,7 @@
               Expression RESULT = null;
                 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;
+                Expression fc = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = fc;
               parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1684,7 +1684,7 @@
               Expression RESULT = null;
                 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;
+                Double num = (Double)(parser_stack.get(parser_top-0)).value;
                  RESULT = new RealExpr(num.doubleValue());
               parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1696,7 +1696,7 @@
               Expression RESULT = null;
                 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 num = (Long)(parser_stack.get(parser_top-0)).value;
 
            long value = num.longValue();
            if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
@@ -1723,7 +1723,7 @@
               Expression RESULT = null;
                 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;
+                String string = (String)(parser_stack.get(parser_top-0)).value;
 
         /*
         * If the string appears to have the syntax of a QName, store
@@ -1751,7 +1751,7 @@
               Expression RESULT = null;
                 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;
+                Expression ex = (Expression)(parser_stack.get(parser_top-1)).value;
                  RESULT = ex;
               parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1763,7 +1763,7 @@
               Expression RESULT = null;
                 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;
+                Expression vr = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = vr;
               parser_result = new Symbol(17/*PrimaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1775,11 +1775,11 @@
               Expression RESULT = null;
                 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;
+                Expression primary = (Expression)(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;
+                List<Expression> pp = (ArrayList<Expression>)(parser_stack.get(parser_top-0)).value;
                  RESULT = new FilterExpr(primary, pp);
               parser_result = new Symbol(6/*FilterExpr*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1791,7 +1791,7 @@
               Expression RESULT = null;
                 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;
+                Expression primary = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = primary;
               parser_result = new Symbol(6/*FilterExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1947,7 +1947,7 @@
               Integer RESULT = null;
                 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;
+                Integer an = (Integer)(parser_stack.get(parser_top-1)).value;
                  RESULT = an;
               parser_result = new Symbol(41/*AxisSpecifier*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1959,7 +1959,7 @@
               Expression RESULT = null;
                 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;
+                Expression abbrev = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = abbrev;
               parser_result = new Symbol(7/*Step*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -1971,10 +1971,10 @@
               Expression RESULT = null;
                 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;
+                Integer axis = (Integer)(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;
+                Object ntest = parser_stack.get(parser_top-0).value;
                  RESULT = new Step(axis.intValue(),
                              parser.findNodeType(axis.intValue(), ntest),
                              null);
@@ -1989,14 +1989,14 @@
               Expression RESULT = null;
                 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;
+                Integer axis = (Integer)(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;
+                Object ntest = 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;
+                List<Predicate> pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
                  RESULT = new Step(axis.intValue(),
                              parser.findNodeType(axis.intValue(), ntest),
                              pp);
@@ -2011,11 +2011,11 @@
               Expression RESULT = null;
                 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;
+                Object ntest = 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;
+                List<Predicate> pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
 
             if (ntest instanceof Step) {
                 Step step = (Step)ntest;
@@ -2037,7 +2037,7 @@
               Expression RESULT = null;
                 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;
+                Object ntest = parser_stack.get(parser_top-0).value;
 
             if (ntest instanceof Step) {
                 RESULT = (Step)ntest;
@@ -2058,7 +2058,7 @@
               Expression RESULT = null;
                 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;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-0)).value;
 
            //
            // Expand '//' into '/descendant-or-self::node()/' or
@@ -2084,10 +2084,10 @@
               Expression RESULT = null;
                 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;
+                Expression rlp = (Expression)(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;
+                Expression step = (Expression)(parser_stack.get(parser_top-0)).value;
 
            final Step right  = (Step)step;
            final int  axis   = right.getAxis();
@@ -2151,7 +2151,7 @@
               Expression RESULT = null;
                 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;
+                Expression aalp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = aalp;
               parser_result = new Symbol(23/*AbsoluteLocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2163,7 +2163,7 @@
               Expression RESULT = null;
                 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;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AbsoluteLocationPath(rlp);
               parser_result = new Symbol(23/*AbsoluteLocationPath*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2184,7 +2184,7 @@
               Expression RESULT = null;
                 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;
+                Expression arlp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = arlp;
               parser_result = new Symbol(21/*RelativeLocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2196,10 +2196,10 @@
               Expression RESULT = null;
                 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;
+                Expression rlp = (Expression)(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;
+                Expression step = (Expression)(parser_stack.get(parser_top-0)).value;
 
         if (rlp instanceof Step && ((Step) rlp).isAbbreviatedDot()) {
               RESULT = step;       // Remove './' from the middle
@@ -2222,7 +2222,7 @@
               Expression RESULT = null;
                 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;
+                Expression step = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = step;
               parser_result = new Symbol(21/*RelativeLocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2234,7 +2234,7 @@
               Expression RESULT = null;
                 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;
+                Expression alp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = alp;
               parser_result = new Symbol(4/*LocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2246,7 +2246,7 @@
               Expression RESULT = null;
                 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;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = rlp;
               parser_result = new Symbol(4/*LocationPath*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2258,10 +2258,10 @@
               Expression RESULT = null;
                 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;
+                Expression fexp = (Expression)(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;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-0)).value;
 
            //
            // Expand '//' into '/descendant-or-self::node()/' or
@@ -2291,10 +2291,10 @@
               Expression RESULT = null;
                 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;
+                Expression fexp = (Expression)(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;
+                Expression rlp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new FilterParentPath(fexp, rlp);
               parser_result = new Symbol(19/*PathExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2306,7 +2306,7 @@
               Expression RESULT = null;
                 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;
+                Expression fexp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = fexp;
               parser_result = new Symbol(19/*PathExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2318,7 +2318,7 @@
               Expression RESULT = null;
                 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;
+                Expression lp = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = lp;
               parser_result = new Symbol(19/*PathExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2330,10 +2330,10 @@
               Expression RESULT = null;
                 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;
+                Expression pe = (Expression)(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;
+                Expression rest = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new UnionPathExpr(pe, rest);
               parser_result = new Symbol(18/*UnionExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2345,7 +2345,7 @@
               Expression RESULT = null;
                 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;
+                Expression pe = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = pe;
               parser_result = new Symbol(18/*UnionExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2357,7 +2357,7 @@
               Expression RESULT = null;
                 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;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new UnaryOpExpr(ue);
               parser_result = new Symbol(14/*UnaryExpr*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2369,7 +2369,7 @@
               Expression RESULT = null;
                 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;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ue;
               parser_result = new Symbol(14/*UnaryExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2381,10 +2381,10 @@
               Expression RESULT = null;
                 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;
+                Expression me = (Expression)(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;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.MOD, me, ue);
               parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2396,10 +2396,10 @@
               Expression RESULT = null;
                 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;
+                Expression me = (Expression)(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;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.DIV, me, ue);
               parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2411,10 +2411,10 @@
               Expression RESULT = null;
                 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;
+                Expression me = (Expression)(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;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.TIMES, me, ue);
               parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2426,7 +2426,7 @@
               Expression RESULT = null;
                 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;
+                Expression ue = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ue;
               parser_result = new Symbol(13/*MultiplicativeExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2438,10 +2438,10 @@
               Expression RESULT = null;
                 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;
+                Expression ae = (Expression)(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;
+                Expression me = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.MINUS, ae, me);
               parser_result = new Symbol(12/*AdditiveExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2453,10 +2453,10 @@
               Expression RESULT = null;
                 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;
+                Expression ae = (Expression)(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;
+                Expression me = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new BinOpExpr(BinOpExpr.PLUS, ae, me);
               parser_result = new Symbol(12/*AdditiveExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2468,7 +2468,7 @@
               Expression RESULT = null;
                 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;
+                Expression me = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = me;
               parser_result = new Symbol(12/*AdditiveExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2480,10 +2480,10 @@
               Expression RESULT = null;
                 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;
+                Expression re = (Expression)(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;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.GE, re, ae);
               parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2495,10 +2495,10 @@
               Expression RESULT = null;
                 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;
+                Expression re = (Expression)(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;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.LE, re, ae);
               parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2510,10 +2510,10 @@
               Expression RESULT = null;
                 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;
+                Expression re = (Expression)(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;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.GT, re, ae);
               parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2525,10 +2525,10 @@
               Expression RESULT = null;
                 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;
+                Expression re = (Expression)(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;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new RelationalExpr(Operators.LT, re, ae);
               parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2540,7 +2540,7 @@
               Expression RESULT = null;
                 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;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ae;
               parser_result = new Symbol(11/*RelationalExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2552,10 +2552,10 @@
               Expression RESULT = null;
                 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;
+                Expression ee = (Expression)(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;
+                Expression re = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new EqualityExpr(Operators.NE, ee, re);
               parser_result = new Symbol(10/*EqualityExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2567,10 +2567,10 @@
               Expression RESULT = null;
                 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;
+                Expression ee = (Expression)(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;
+                Expression re = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new EqualityExpr(Operators.EQ, ee, re);
               parser_result = new Symbol(10/*EqualityExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2582,7 +2582,7 @@
               Expression RESULT = null;
                 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;
+                Expression re = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = re;
               parser_result = new Symbol(10/*EqualityExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2594,10 +2594,10 @@
               Expression RESULT = null;
                 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;
+                Expression ae = (Expression)(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;
+                Expression ee = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new LogicalExpr(LogicalExpr.AND, ae, ee);
               parser_result = new Symbol(9/*AndExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2609,7 +2609,7 @@
               Expression RESULT = null;
                 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;
+                Expression e = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = e;
               parser_result = new Symbol(9/*AndExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2621,10 +2621,10 @@
               Expression RESULT = null;
                 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;
+                Expression oe = (Expression)(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;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = new LogicalExpr(LogicalExpr.OR, oe, ae);
               parser_result = new Symbol(8/*OrExpr*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2636,7 +2636,7 @@
               Expression RESULT = null;
                 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;
+                Expression ae = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ae;
               parser_result = new Symbol(8/*OrExpr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2648,7 +2648,7 @@
               Expression RESULT = null;
                 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;
+                Expression ex = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = ex;
               parser_result = new Symbol(2/*Expr*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2660,7 +2660,7 @@
               Expression RESULT = null;
                 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;
+                Expression e = (Expression)(parser_stack.get(parser_top-1)).value;
 
                 RESULT = new Predicate(e);
 
@@ -2674,11 +2674,11 @@
                 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;
+                Expression p = (Expression)(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;
+                List<Expression> pp = (ArrayList<Expression>)(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);
             }
@@ -2690,7 +2690,7 @@
                 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;
+                Expression p = (Expression)(parser_stack.get(parser_top-0)).value;
 
                 List<Expression> temp = new ArrayList<>();
                 temp.add(p);
@@ -2733,7 +2733,7 @@
               Object RESULT = null;
                 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;
+                QName qn = (QName)(parser_stack.get(parser_top-0)).value;
                  RESULT = qn;
               parser_result = new Symbol(34/*NameTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2790,7 +2790,7 @@
               Object RESULT = null;
                 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;
+                Object nt = parser_stack.get(parser_top-0).value;
                  RESULT = nt;
               parser_result = new Symbol(33/*NodeTestPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2802,14 +2802,14 @@
               StepPattern RESULT = null;
                 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;
+                Integer axis = (Integer)(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;
+                StepPattern pip = (StepPattern)(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;
+                List<Predicate> pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
 
                // TODO: report error if axis is attribute
                RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp);
@@ -2824,10 +2824,10 @@
               StepPattern RESULT = null;
                 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;
+                Integer axis = (Integer)(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;
+                StepPattern pip = (StepPattern)(parser_stack.get(parser_top-0)).value;
 
                RESULT = pip;    // TODO: report error if axis is attribute
 
@@ -2841,14 +2841,14 @@
               StepPattern RESULT = null;
                 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;
+                Integer axis = (Integer)(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;
+                Object nt = 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;
+               List<Predicate>pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
 
                RESULT = parser.createStepPattern(axis.intValue(), nt, pp);
 
@@ -2862,10 +2862,10 @@
               StepPattern RESULT = null;
                 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;
+                Integer axis = (Integer)(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;
+                Object nt = parser_stack.get(parser_top-0).value;
 
                RESULT = parser.createStepPattern(axis.intValue(), nt, null);
 
@@ -2879,11 +2879,11 @@
               StepPattern RESULT = null;
                 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;
+                StepPattern pip = (StepPattern)(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;
+                List<Predicate> pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
                  RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp);
               parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2895,7 +2895,7 @@
               StepPattern RESULT = null;
                 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;
+                StepPattern pip = (StepPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = pip;
               parser_result = new Symbol(32/*StepPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2907,11 +2907,11 @@
               StepPattern RESULT = null;
                 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;
+                Object nt = 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;
+                List<Predicate> pp = (ArrayList<Predicate>)(parser_stack.get(parser_top-0)).value;
 
                 RESULT = parser.createStepPattern(Axis.CHILD, nt, pp);
 
@@ -2925,7 +2925,7 @@
               StepPattern RESULT = null;
                 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;
+                Object nt = parser_stack.get(parser_top-0).value;
 
                 RESULT = parser.createStepPattern(Axis.CHILD, nt, null);
 
@@ -2939,10 +2939,10 @@
               RelativePathPattern RESULT = null;
                 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;
+                StepPattern sp = (StepPattern)(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;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AncestorPattern(sp, rpp);
               parser_result = new Symbol(31/*RelativePathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2954,10 +2954,10 @@
               RelativePathPattern RESULT = null;
                 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;
+                StepPattern sp = (StepPattern)(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;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new ParentPattern(sp, rpp);
               parser_result = new Symbol(31/*RelativePathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2969,7 +2969,7 @@
               RelativePathPattern RESULT = null;
                 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;
+                StepPattern sp = (StepPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = sp;
               parser_result = new Symbol(31/*RelativePathPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2981,7 +2981,7 @@
               StepPattern RESULT = null;
                 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;
+                String l = (String)(parser_stack.get(parser_top-1)).value;
                  RESULT = new ProcessingInstructionPattern(l);
               parser_result = new Symbol(30/*ProcessingInstructionPattern*/, (parser_stack.get(parser_top-3)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -2993,10 +2993,10 @@
               IdKeyPattern RESULT = null;
                 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;
+                String l1 = (String)(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;
+                String l2 = (String)(parser_stack.get(parser_top-1)).value;
                  RESULT = new KeyPattern(l1, l2);
               parser_result = new Symbol(27/*IdKeyPattern*/, (parser_stack.get(parser_top-5)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3008,7 +3008,7 @@
               IdKeyPattern RESULT = null;
                 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;
+                String l = (String)(parser_stack.get(parser_top-1)).value;
                  RESULT = new IdPattern(l);
                parser.setHasIdCall(true);
 
@@ -3022,7 +3022,7 @@
               Pattern RESULT = null;
                 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;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = rpp;
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3034,7 +3034,7 @@
               Pattern RESULT = null;
                 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;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AncestorPattern(rpp);
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3046,10 +3046,10 @@
               Pattern RESULT = null;
                 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;
+                IdKeyPattern ikp = (IdKeyPattern)(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;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AncestorPattern(ikp, rpp);
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3061,10 +3061,10 @@
               Pattern RESULT = null;
                 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;
+                IdKeyPattern ikp = (IdKeyPattern)(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;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new ParentPattern(ikp, rpp);
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3076,7 +3076,7 @@
               Pattern RESULT = null;
                 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;
+                IdKeyPattern ikp = (IdKeyPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = ikp;
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3088,7 +3088,7 @@
               Pattern RESULT = null;
                 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;
+                RelativePathPattern rpp = (RelativePathPattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AbsolutePathPattern(rpp);
               parser_result = new Symbol(29/*LocationPathPattern*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3109,10 +3109,10 @@
               Pattern RESULT = null;
                 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;
+                Pattern lpp = (Pattern)(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;
+                Pattern p = (Pattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = new AlternativePattern(lpp, p);
               parser_result = new Symbol(28/*Pattern*/, (parser_stack.get(parser_top-2)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3124,7 +3124,7 @@
               Pattern RESULT = null;
                 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;
+                Pattern lpp = (Pattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = lpp;
               parser_result = new Symbol(28/*Pattern*/, (parser_stack.get(parser_top-0)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3136,7 +3136,7 @@
               SyntaxTreeNode RESULT = null;
                 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;
+                Expression expr = (Expression)(parser_stack.get(parser_top-0)).value;
                  RESULT = expr;
               parser_result = new Symbol(1/*TopLevel*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3148,7 +3148,7 @@
               SyntaxTreeNode RESULT = null;
                 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;
+                Pattern pattern = (Pattern)(parser_stack.get(parser_top-0)).value;
                  RESULT = pattern;
               parser_result = new Symbol(1/*TopLevel*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
@@ -3160,7 +3160,7 @@
               Object RESULT = null;
                 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;
+                SyntaxTreeNode start_val = (SyntaxTreeNode)(parser_stack.get(parser_top-1)).value;
                 RESULT = start_val;
               parser_result = new Symbol(0/*$START*/, (parser_stack.get(parser_top-1)).left, (parser_stack.get(parser_top-0)).right, RESULT);
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -864,7 +864,7 @@
             // iteration after it reaches the end of the InstructionList, with
             // currentHandle set to null.
             currentHandle = instructions.hasNext()
-                                    ? (InstructionHandle) instructions.next()
+                                    ? instructions.next()
                                     : null;
             Instruction inst =
                     (currentHandle != null) ? currentHandle.getInstruction()
@@ -904,14 +904,13 @@
                 // are better candidates for outlining than the current chunk.
                 if (!openChunkAtCurrLevel) {
                     nestedSubChunks = currLevelChunks;
-                    currLevelChunks = (List<InstructionHandle>)subChunkStack.pop();
+                    currLevelChunks = subChunkStack.pop();
                 }
 
                 // Get the handle for the start of this chunk (the last entry
                 // in currLevelChunks)
                 InstructionHandle chunkStart =
-                        (InstructionHandle) currLevelChunks.get(
-                                                      currLevelChunks.size()-1);
+                        currLevelChunks.get(currLevelChunks.size()-1);
 
                 int chunkEndPosition =
                         (currentHandle != null) ? currentHandle.getPosition()
@@ -940,12 +939,8 @@
 
                             // Gather all the child chunks of the current chunk
                             for (int i = 0; i < childChunkCount; i++) {
-                                InstructionHandle start =
-                                    (InstructionHandle) nestedSubChunks
-                                                            .get(i*2);
-                                InstructionHandle end =
-                                    (InstructionHandle) nestedSubChunks
-                                                            .get(i*2+1);
+                                InstructionHandle start = nestedSubChunks.get(i*2);
+                                InstructionHandle end = nestedSubChunks.get(i*2+1);
 
                                 childChunks[i] = new Chunk(start, end);
                             }
@@ -1168,7 +1163,7 @@
             for (int i = candidateChunks.size()-1;
                  i >= 0 && currentMethodSize > TARGET_METHOD_SIZE;
                  i--) {
-                Chunk chunkToOutline = (Chunk)candidateChunks.get(i);
+                Chunk chunkToOutline = candidateChunks.get(i);
 
                 methodsOutlined.add(outline(chunkToOutline.getChunkStart(),
                                             chunkToOutline.getChunkEnd(),
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -151,7 +151,7 @@
             needToSetDocumentInfo = false;
         }
 
-        final Element tmp = (Element)_document.createElementNS(namespace, qName);
+        final Element tmp = _document.createElementNS(namespace, qName);
 
         // Add namespace declarations first
         if (_namespaceDecls != null) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,5 @@
 /*
  * 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
@@ -337,8 +336,8 @@
         if (namespaces != null) {
             final int nDecls = namespaces.size();
             for (int i = 0; i < nDecls; i++) {
-                final String prefix = (String) namespaces.get(i++);
-                String uri = (String) namespaces.get(i);
+                final String prefix = namespaces.get(i++);
+                String uri = namespaces.get(i);
                 Namespace ns = createNamespace(prefix, uri);
                 if (nsMap == null) {
                     nsMap = new HashMap<>();
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -613,7 +613,7 @@
      * Return the thread local copy of the stylesheet DOM.
      */
     public DOM getStylesheetDOM() {
-        return (DOM)_sdom.get();
+        return _sdom.get();
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1518,7 +1518,7 @@
         if ( count > 0) {
             final byte[][] result = new byte[count][1];
             for (int i = 0; i < count; i++) {
-                result[i] = (byte[])bytecodes.get(i);
+                result[i] = bytecodes.get(i);
             }
 
             return result;
@@ -1612,7 +1612,7 @@
         if (count > 0) {
             final byte[][] result = new byte[count][1];
             for (int i = 0; i < count; i++) {
-                result[i] = (byte[])bytecodes.get(i);
+                result[i] = bytecodes.get(i);
             }
 
             return result;
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -407,7 +407,7 @@
         _method = (String) _properties.get(OutputKeys.METHOD);
 
         // Get encoding using getProperty() to use defaults
-        _encoding = (String) _properties.getProperty(OutputKeys.ENCODING);
+        _encoding = _properties.getProperty(OutputKeys.ENCODING);
 
         _tohFactory = TransletOutputHandlerFactory.newInstance(_useServicesMechanism);
         _tohFactory.setEncoding(_encoding);
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -94,7 +94,7 @@
     protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet)
         throws SAXException
     {
-        SAXImpl idom = (SAXImpl)_dom.get();
+        SAXImpl idom = _dom.get();
 
         if (idom != null) {
             if (dtmManager != null) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Sep 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1476,7 +1476,7 @@
             num = --nodeCounter;
             nodeTable.put(node, num);
         } else {
-            Integer n = (Integer) nodeTable.get(node);
+            Integer n = nodeTable.get(node);
             if (n == null) {
                 num = --nodeCounter;
                 nodeTable.put(node, num);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1647,7 +1647,7 @@
         }
 
         public Augmentations getAugmentations (int attributeIndex){
-            return(Augmentations)fAugmentations.elementAt(attributeIndex);
+            return fAugmentations.elementAt(attributeIndex);
         }
 
         public Augmentations getAugmentations (String uri, String localPart){
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -59,7 +59,7 @@
     public String item(int index) {
         final int length = getLength();
         if (index >= 0 && index < length) {
-            return (String) fStrings.get(index);
+            return fStrings.get(index);
         }
         return null;
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -773,7 +773,7 @@
                 // call listeners in the order in which they got registered
                 int nlsize = nl.size();
                 for (int i = 0; i < nlsize; i++) {
-                    LEntry le = (LEntry) nl.get(i);
+                    LEntry le = nl.get(i);
                     if (!le.useCapture && le.type.equals(evt.type) &&
                         nodeListeners.contains(le)) {
                         try {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -333,7 +333,7 @@
         //xxx:stax getText() is supposed to return only DTD internal subset
         //shouldn't we record position here before we go ahead ??
 
-        fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner();
+        fEntityScanner = fEntityManager.getEntityScanner();
         fEntityManager.setEntityHandler(this);
         fStandalone = standalone;
         //System.out.println("state"+fScannerState);
@@ -443,7 +443,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -452,7 +452,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java	Tue Nov 07 16:19:55 2017 -0800
@@ -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: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -442,7 +443,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -514,7 +515,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -216,7 +216,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -244,7 +244,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -389,7 +389,7 @@
 
         fEntityManager = (XMLEntityManager)propertyManager.getProperty(ENTITY_MANAGER);
         fEntityStore = fEntityManager.getEntityStore() ;
-        fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner() ;
+        fEntityScanner = fEntityManager.getEntityScanner() ;
         fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER);
 
         //fEntityManager.reset();
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -195,7 +195,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(LOADER_RECOGNIZED_FEATURES.clone());
+        return LOADER_RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -244,7 +244,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(LOADER_RECOGNIZED_PROPERTIES.clone());
+        return LOADER_RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -365,7 +365,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -393,7 +393,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -480,7 +480,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -508,7 +508,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -80,8 +80,8 @@
 
         for (int i = 52,  j = 0; i<=61; i++, j++)
             lookUpBase64Alphabet[i] = (char)('0' + j);
-        lookUpBase64Alphabet[62] = (char)'+';
-        lookUpBase64Alphabet[63] = (char)'/';
+        lookUpBase64Alphabet[62] = '+';
+        lookUpBase64Alphabet[63] = '/';
 
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -69,7 +69,7 @@
      * @return      a hashtable which contains all built-in simple types
      */
     public SymbolHash getBuiltInTypes() {
-        return (SymbolHash)fBaseTypes.makeClone();
+        return fBaseTypes.makeClone();
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -80,6 +80,6 @@
      * @return      a hashtable which contains all built-in simple types
      */
     public SymbolHash getBuiltInTypes() {
-        return (SymbolHash)fBuiltInTypes.makeClone();
+        return fBuiltInTypes.makeClone();
     }
 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -67,7 +67,7 @@
      * @return      a hashtable which contains all built-in simple types
      */
     public SymbolHash getBuiltInTypes() {
-        return (SymbolHash)fFullTypes.makeClone();
+        return fFullTypes.makeClone();
     }
 
     // create all built-in types
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -71,7 +71,7 @@
      * @return      a hashtable which contains all built-in simple types
      */
     public SymbolHash getBuiltInTypes() {
-        return (SymbolHash)fBuiltInTypes.makeClone();
+        return fBuiltInTypes.makeClone();
     }
 
 }//SchemaDVFactoryImpl
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -235,7 +235,7 @@
     };
 
     protected static TypeValidator[] getGDVs() {
-        return (TypeValidator[])gDVs.clone();
+        return gDVs.clone();
     }
     private TypeValidator[] fDVs = gDVs;
     protected void setDVs(TypeValidator[] dvs) {
@@ -434,7 +434,7 @@
         fAnnotations = annotations;
 
         fVariety = VARIETY_LIST;
-        fItemType = (XSSimpleTypeDecl)itemType;
+        fItemType = itemType;
         fValidationDV = DV_LIST;
         fFacetsDefined = FACET_WHITESPACE;
         fFixedFacet = FACET_WHITESPACE;
@@ -544,7 +544,7 @@
         fAnnotations = annotations;
 
         fVariety = VARIETY_LIST;
-        fItemType = (XSSimpleTypeDecl)itemType;
+        fItemType = itemType;
         fValidationDV = DV_LIST;
         fFacetsDefined = FACET_WHITESPACE;
         fFixedFacet = FACET_WHITESPACE;
@@ -883,9 +883,9 @@
                 fEnumerationSize = 0;
                 for (int i = 0; i < size; i++) {
                     if (enumNSDecls != null)
-                        ctx.setNSContext((NamespaceContext)enumNSDecls.get(i));
+                        ctx.setNSContext(enumNSDecls.get(i));
                     try {
-                        ValidatedInfo info = getActualEnumValue((String)enumVals.get(i), ctx, null);
+                        ValidatedInfo info = getActualEnumValue(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) {
@@ -2604,7 +2604,7 @@
                 ((ancestorNS == null && type.getNamespace() == null) ||
                         (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) &&   // compare with ancestor
                         type != fAnySimpleType) {  // reached anySimpleType
-            type = (XSTypeDefinition)type.getBaseType();
+            type = type.getBaseType();
         }
 
         return type != fAnySimpleType;
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -81,8 +82,7 @@
         fValidity = attrPSVI.getValidity();
         if (attrPSVI instanceof AttributePSVImpl) {
             final AttributePSVImpl attrPSVIImpl = (AttributePSVImpl) attrPSVI;
-            fErrors = (attrPSVIImpl.fErrors != null) ?
-                    (String[]) attrPSVIImpl.fErrors.clone() : null;
+            fErrors = (attrPSVIImpl.fErrors != null) ? attrPSVIImpl.fErrors.clone() : null;
         }
         else {
             final StringList errorCodes = attrPSVI.getErrorCodes();
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -105,8 +106,7 @@
         fValidationContext = elementPSVI.getValidationContext();
         if (elementPSVI instanceof ElementPSVImpl) {
             final ElementPSVImpl elementPSVIImpl = (ElementPSVImpl) elementPSVI;
-            fErrors = (elementPSVIImpl.fErrors != null) ?
-                    (String[]) elementPSVIImpl.fErrors.clone() : null;
+            fErrors = (elementPSVIImpl.fErrors != null) ? elementPSVIImpl.fErrors.clone() : null;
             elementPSVIImpl.copySchemaInformationTo(this);
         }
         else {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -284,7 +284,7 @@
         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.get(i);
+            XSElementDecl sub = group.get(i);
             if (!getDBMethods(sub.fType, element.fType, methods))
                 continue;
             // Remember derivation methods and blocks from the types
@@ -307,7 +307,7 @@
         // Convert to an array
         OneSubGroup[] ret = new OneSubGroup[newGroup.size()];
         for (int i = newGroup.size()-1; i >= 0; i--) {
-            ret[i] = (OneSubGroup)newGroup.get(i);
+            ret[i] = 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 Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -572,7 +572,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedFeatures() {
-        return (String[]) (RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -599,7 +599,7 @@
      * are recognized by this component.
      */
     public String[] getRecognizedProperties() {
-        return (String[]) (RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
@@ -3037,7 +3037,7 @@
                     // 5 Let [Definition:]  the wild IDs be the set of all attribute information item to which clause 3.2 applied and whose validation resulted in a context-determined declaration of mustFind or no context-determined declaration at all, and whose [local name] and [namespace name] resolve (as defined by QName resolution (Instance) (3.15.4)) to an attribute declaration whose {type definition} is or is derived from ID. Then all of the following must be true:
                     // 5.1 There must be no more than one item in wild IDs.
                     if (currDecl.fType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE
-                        && ((XSSimpleType) currDecl.fType).isIDType()) {
+                        && (currDecl.fType).isIDType()) {
                         if (wildcardIDName != null) {
                             reportSchemaError(
                                 "cvc-complex-type.5.1",
@@ -4120,7 +4120,7 @@
 
         private ShortList getItemValueTypeAt(int index) {
             if (fUseItemValueTypeVector) {
-                return (ShortList) fItemValueTypes.get(index);
+                return fItemValueTypes.get(index);
             }
             return fItemValueType;
         }
@@ -4245,8 +4245,7 @@
 
             // verify references
             // get the key store corresponding (if it exists):
-            fKeyValueStore =
-                (ValueStoreBase) fValueStoreCache.fGlobalIDConstraintMap.get(
+            fKeyValueStore = fValueStoreCache.fGlobalIDConstraintMap.get(
                     ((KeyRef) fIdentityConstraint).getKey());
 
             if (fKeyValueStore == null) {
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -260,7 +260,7 @@
                   (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) &&   // compare with ancestor
                type != SchemaGrammar.fAnySimpleType &&  // reached anySimpleType
                type != SchemaGrammar.fAnyType) {        // reached anyType
-            type = (XSTypeDefinition)type.getBaseType();
+            type = type.getBaseType();
         }
 
         return type != SchemaGrammar.fAnySimpleType &&
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -165,8 +165,7 @@
             else
                 return false;
         }
-        return checkSimpleDerivation((XSSimpleType)derived,
-                (XSSimpleType)base, block);
+        return checkSimpleDerivation(derived, (XSSimpleType)base, block);
     }
 
     /**
@@ -177,7 +176,7 @@
         // if derived is anyType, then it's valid only if base is anyType too
         if (derived == SchemaGrammar.fAnyType)
             return derived == base;
-        return checkComplexDerivation((XSComplexTypeDecl)derived, base, block);
+        return checkComplexDerivation(derived, base, block);
     }
 
     /**
@@ -1237,7 +1236,7 @@
         int count = children.size();
         try {
             for (int i = 0; i < count; i++) {
-                XSParticleDecl particle1 = (XSParticleDecl)children.get(i);
+                XSParticleDecl particle1 = children.get(i);
                 particleValidRestriction(particle1, dSGHandler, wildcard, null, false);
 
             }
@@ -1271,9 +1270,9 @@
         int current = 0;
         label: for (int i = 0; i<count1; i++) {
 
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+            XSParticleDecl particle1 = dChildren.get(i);
             for (int j = current; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+                XSParticleDecl particle2 = bChildren.get(j);
                 current +=1;
                 try {
                     particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
@@ -1289,7 +1288,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.get(j);
+            XSParticleDecl particle2 = bChildren.get(j);
             if (!particle2.emptiable()) {
                 throw new XMLSchemaException("rcase-Recurse.2", null);
             }
@@ -1319,10 +1318,10 @@
         boolean foundIt[] = new boolean[count2];
 
         label: for (int i = 0; i<count1; i++) {
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+            XSParticleDecl particle1 = dChildren.get(i);
 
             for (int j = 0; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+                XSParticleDecl particle2 = bChildren.get(j);
                 try {
                     particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
                     if (foundIt[j])
@@ -1341,7 +1340,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.get(j);
+            XSParticleDecl particle2 = bChildren.get(j);
             if (!foundIt[j] && !particle2.emptiable()) {
                 throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
             }
@@ -1370,9 +1369,9 @@
         int current = 0;
         label: for (int i = 0; i<count1; i++) {
 
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+            XSParticleDecl particle1 = dChildren.get(i);
             for (int j = current; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+                XSParticleDecl particle2 = bChildren.get(j);
                 current +=1;
                 try {
                     // IHR: go back one element on b list because the next element may match
@@ -1425,9 +1424,9 @@
 
         label: for (int i = 0; i<count1; i++) {
 
-            XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+            XSParticleDecl particle1 = dChildren.get(i);
             for (int j = 0; j<count2; j++) {
-                XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+                XSParticleDecl particle2 = 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 Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -52,7 +52,7 @@
     public SchemaGrammar getGrammar(String namespace) {
         if (namespace == null)
             return fNoNSGrammar;
-        return (SchemaGrammar)fGrammarRegistry.get(namespace);
+        return fGrammarRegistry.get(namespace);
     }
 
     /**
@@ -191,7 +191,7 @@
                 // we add them to the vector
                 if(gs == null) continue;
                 for (int j = gs.size() - 1; j >= 0; j--) {
-                    sg2 = (SchemaGrammar)gs.get(j);
+                    sg2 = gs.get(j);
                     if (!grammars.contains(sg2))
                         grammars.add(sg2);
                 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java	Tue Nov 07 16:19:55 2017 -0800
@@ -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: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -457,7 +458,7 @@
             XSModelGroupImpl group = (XSModelGroupImpl) particle.fValue;
             if (minOccurs != 1 || maxOccurs != 1) {
                 if (group.fParticleCount == 1) {
-                    XSParticleDecl particle2 = (XSParticleDecl) group.fParticles[0];
+                    XSParticleDecl particle2 = group.fParticles[0];
                     short type2 = particle2.fType;
                     return ((type2 == XSParticleDecl.PARTICLE_ELEMENT ||
                             type2 == XSParticleDecl.PARTICLE_WILDCARD) &&
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1607,7 +1607,7 @@
             // for each of the values
             int count = values.size();
             for (int i = 1; i < count; i += 2) {
-                elName = (String)values.get(i);
+                elName = values.get(i);
                 try {
                     // and validate it using the XSSimpleType
                     // REVISIT: what would be the proper validation context?
@@ -1824,7 +1824,7 @@
         values[pos++] = value;
     }
     OneAttr get(String key) {
-        OneAttr ret = (OneAttr)items.get(key);
+        OneAttr ret = items.get(key);
         return ret;
     }
 }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -2581,7 +2581,7 @@
         List<SchemaGrammar> gs;
         for (int i = 0; i < currGrammars.size(); i++) {
             // get the grammar
-            sg1 = (SchemaGrammar)currGrammars.get(i);
+            sg1 = 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
@@ -2591,7 +2591,7 @@
             }
 
             for (int j = gs.size() - 1; j >= 0; j--) {
-                sg2 = (SchemaGrammar)gs.get(j);
+                sg2 = gs.get(j);
                 if (!currGrammars.contains(sg2)) {
                     currGrammars.add(sg2);
                 }
@@ -2606,7 +2606,7 @@
         final XSDDescription desc = new XSDDescription();
 
         for (int i=0; i < length; i++) {
-            final SchemaGrammar sg1 = (SchemaGrammar)grammars.get(i);
+            final SchemaGrammar sg1 = grammars.get(i);
             desc.setNamespace(sg1.getTargetNamespace());
 
             final SchemaGrammar sg2 = findGrammar(desc, false);
@@ -2622,7 +2622,7 @@
         final int size = components.size();
         final XSDDescription desc = new XSDDescription();
         for (int i=0; i<size; i++) {
-            XSObject component = (XSObject) components.get(i);
+            XSObject component = components.get(i);
             if (!canAddComponent(component, desc)) {
                 return false;
             }
@@ -2763,7 +2763,7 @@
         final int size = importedSrc.size();
 
         for (int i=0; i<size; i++) {
-            final SchemaGrammar sg = (SchemaGrammar) importedSrc.get(i);
+            final SchemaGrammar sg =  importedSrc.get(i);
             if (!containedImportedGrammar(importedDst, sg)) {
                 importedDst.add(sg);
             }
@@ -3361,7 +3361,7 @@
         SchemaGrammar sg;
 
         for (int i=0; i<size; i++) {
-            sg = (SchemaGrammar) importedGrammar.get(i);
+            sg =  importedGrammar.get(i);
             if (null2EmptyString(sg.getTargetNamespace()).equals(null2EmptyString(grammar.getTargetNamespace()))) {
                 return true;
             }
@@ -3766,7 +3766,7 @@
         }
         else {
             Element collidingElem = (Element)objElem;
-            XSDocumentInfo collidingElemSchema = (XSDocumentInfo)registry_sub.get(qName);
+            XSDocumentInfo collidingElemSchema = registry_sub.get(qName);
             if (collidingElem == currComp) return;
             Element elemParent = null;
             XSDocumentInfo redefinedSchema = null;
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -296,7 +296,7 @@
             // for each qname in the list
             for (int i = 0; i < size; i++) {
                 // get the type decl
-                dv = findDTValidator(child, name, (QName)memberTypes.get(i),
+                dv = findDTValidator(child, name, memberTypes.get(i),
                         XSConstants.DERIVATION_UNION, schemaDoc);
                 if (dv != null) {
                     // if it's a union, expand it
@@ -389,7 +389,7 @@
                     annotations == null? null : new XSObjectListImpl(annotations, annotations.length));
         }
         else if (union) {
-            XSSimpleType[] memberDecls = (XSSimpleType[]) dTValidators.toArray(new XSSimpleType[dTValidators.size()]);
+            XSSimpleType[] memberDecls = dTValidators.toArray(new XSSimpleType[dTValidators.size()]);
             newDecl = fSchemaHandler.fDVFactory.createTypeUnion(name, schemaDoc.fTargetNamespace, (short)finalProperty, memberDecls,
                     annotations == null? null : new XSObjectListImpl(annotations, annotations.length));
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -61,7 +61,7 @@
             return;
         }
 
-        UniqueOrKey uniqueOrKey = null;
+        UniqueOrKey uniqueOrKey;
         if(DOMUtil.getLocalName(uElem).equals(SchemaSymbols.ELT_UNIQUE)) {
             uniqueOrKey = new UniqueOrKey(schemaDoc.fTargetNamespace, uName, element.fName, IdentityConstraint.IC_UNIQUE);
         } else {
@@ -89,7 +89,7 @@
             if (fSchemaHandler.fTolerateDuplicates) {
                 if (idc != null) {
                     if (idc instanceof UniqueOrKey) {
-                        uniqueOrKey = (UniqueOrKey) uniqueOrKey;
+                        uniqueOrKey = (UniqueOrKey)idc;
                     }
                 }
                 fSchemaHandler.addIDConstraintDecl(uniqueOrKey);
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -64,7 +64,7 @@
         if (size == 0) {
             return toXSModel(new SchemaGrammar[0], schemaVersion);
         }
-        SchemaGrammar[] gs = (SchemaGrammar[])list.toArray(new SchemaGrammar[size]);
+        SchemaGrammar[] gs = list.toArray(new SchemaGrammar[size]);
         return toXSModel(gs, schemaVersion);
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SimpleXMLSchema.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SimpleXMLSchema.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -52,7 +52,7 @@
 
     public Grammar[] retrieveInitialGrammarSet(String grammarType) {
         return XMLGrammarDescription.XML_SCHEMA.equals(grammarType) ?
-                (Grammar[]) fGrammars.clone() : ZERO_LENGTH_GRAMMAR_ARRAY;
+                fGrammars.clone() : ZERO_LENGTH_GRAMMAR_ARRAY;
     }
 
     public void cacheGrammars(String grammarType, Grammar[] grammars) {}
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -191,7 +191,7 @@
             int hash = hashCode(desc);
             int index = (hash & 0x7FFFFFFF) % fGrammars.length;
             for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
-                Grammar tempGrammar = (Grammar) entry.grammar.get();
+                Grammar tempGrammar = entry.grammar.get();
                 /** If the soft reference has been cleared, remove this entry from the pool. */
                 if (tempGrammar == null) {
                     removeEntry(entry);
@@ -241,7 +241,7 @@
             int hash = hashCode(desc);
             int index = (hash & 0x7FFFFFFF) % fGrammars.length;
             for (Entry entry = fGrammars[index]; entry != null ; entry = entry.next) {
-                Grammar tempGrammar = (Grammar) entry.grammar.get();
+                Grammar tempGrammar = entry.grammar.get();
                 /** If the soft reference has been cleared, remove this entry from the pool. */
                 if (tempGrammar == null) {
                     removeEntry(entry);
@@ -363,7 +363,7 @@
         }
         --fGrammarCount;
         entry.grammar.entry = null;
-        return (Grammar) entry.grammar.get();
+        return entry.grammar.get();
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1931,7 +1931,7 @@
         if (DEBUG_EVENTS) {
             System.out.println ("==>internalEntityDecl: "+name);
             if (DEBUG_BASEURI) {
-                System.out.println ("   baseURI:"+ (String)fBaseURIStack.peek ());
+                System.out.println ("   baseURI:"+ fBaseURIStack.peek ());
             }
         }
         // internal subset string
@@ -1966,7 +1966,7 @@
             EntityImpl entity = (EntityImpl)entities.getNamedItem (name);
             if (entity == null) {
                 entity = (EntityImpl)fDocumentImpl.createEntity (name);
-                entity.setBaseURI ((String)fBaseURIStack.peek ());
+                entity.setBaseURI (fBaseURIStack.peek ());
                 entities.setNamedItem (entity);
             }
         }
@@ -1988,7 +1988,7 @@
             }
             if (!found) {
                 int entityIndex =
-                fDeferredDocumentImpl.createDeferredEntity (name, null, null, null, (String)fBaseURIStack.peek ());
+                fDeferredDocumentImpl.createDeferredEntity (name, null, null, null, fBaseURIStack.peek ());
                 fDeferredDocumentImpl.appendChild (fDocumentTypeIndex, entityIndex);
             }
         }
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -142,7 +142,7 @@
                     xmlInputSource.setCharacterStream(charStream);
                 }
                 else if (byteStream != null) {
-                    xmlInputSource.setByteStream((InputStream) byteStream);
+                    xmlInputSource.setByteStream(byteStream);
                 }
                 else if (data != null && data.length() != 0) {
                     xmlInputSource.setCharacterStream(new StringReader(data));
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/SymbolHash.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/SymbolHash.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -191,7 +191,7 @@
     public SymbolHash makeClone() {
         SymbolHash newTable = new SymbolHash(fTableSize);
         newTable.fNum = fNum;
-        newTable.fHashMultipliers = fHashMultipliers != null ? (int[]) fHashMultipliers.clone() : null;
+        newTable.fHashMultipliers = fHashMultipliers != null ? fHashMultipliers.clone() : null;
         for (int i = 0; i < fTableSize; i++) {
             if (fBuckets[i] != null) {
                 newTable.fBuckets[i] = fBuckets[i].makeClone();
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,8 +1,6 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
- * @modifiedBy: Oracle Inc.
- * @modifiedOn: Nov 2015, Sept 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -621,7 +619,7 @@
      */
     @Override
     public String[] getRecognizedFeatures() {
-        return (String[])(RECOGNIZED_FEATURES.clone());
+        return RECOGNIZED_FEATURES.clone();
     } // getRecognizedFeatures():String[]
 
     /**
@@ -658,7 +656,7 @@
      */
     @Override
     public String[] getRecognizedProperties() {
-        return (String[])(RECOGNIZED_PROPERTIES.clone());
+        return RECOGNIZED_PROPERTIES.clone();
     } // getRecognizedProperties():String[]
 
     /**
@@ -1772,7 +1770,7 @@
 
                 // Parse the XPointer expression
                 try {
-                    ((XPointerProcessor)fXPtrProcessor).parseXPointer(xpointer);
+                    fXPtrProcessor.parseXPointer(xpointer);
 
                 } catch (XNIException ex) {
                     // report the XPointer error as a resource error
@@ -1803,7 +1801,7 @@
                 // If the xpointer attribute is present
                 if (xpointer != null ) {
                         // and it was not resolved
-                        if (!((XPointerProcessor)fXPtrProcessor).isXPointerResolved()) {
+                        if (!fXPtrProcessor.isXPointerResolved()) {
                         Locale locale = (fErrorReporter != null) ? fErrorReporter.getLocale() : null;
                         String reason = fXIncludeMessageFormatter.formatMessage(locale, "XPointerResolutionUnsuccessful", null);
                         reportResourceError("XMLResourceError", new Object[] {href, reason});
@@ -2841,9 +2839,9 @@
         fLiteralSystemID.pop();
         fExpandedSystemID.pop();
         fBaseURIScope.pop();
-        fCurrentBaseURI.setBaseSystemId((String)fBaseURI.peek());
-        fCurrentBaseURI.setLiteralSystemId((String)fLiteralSystemID.peek());
-        fCurrentBaseURI.setExpandedSystemId((String)fExpandedSystemID.peek());
+        fCurrentBaseURI.setBaseSystemId(fBaseURI.peek());
+        fCurrentBaseURI.setLiteralSystemId(fLiteralSystemID.peek());
+        fCurrentBaseURI.setExpandedSystemId(fExpandedSystemID.peek());
     }
 
     // The following methods are used for language processing
@@ -2864,7 +2862,7 @@
     public String restoreLanguage() {
         fLanguageStack.pop();
         fLanguageScope.pop();
-        return (String) fLanguageStack.peek();
+        return fLanguageStack.peek();
     }
 
     /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMManagerDefault.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMManagerDefault.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -571,7 +571,7 @@
                                 handle=dtm.getAttributeNode(handle,node.getNamespaceURI(),node.getLocalName());
       }
       else
-                                handle = ((DOM2DTM)dtm).getHandleOfNode(node);
+                                handle = dtm.getHandleOfNode(node);
 
       if(DTM.NULL == handle)
         throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_RESOLVE_NODE, null)); //"Could not resolve the node to a handle!");
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeList.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeList.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -74,7 +74,7 @@
         if (dtmIterator != null) {
             int pos = dtmIterator.getCurrentPos();
             try {
-                m_iter=(DTMIterator)dtmIterator.cloneWithReset();
+                m_iter = dtmIterator.cloneWithReset();
             } catch(CloneNotSupportedException cnse) {
                 m_iter = dtmIterator;
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -335,7 +335,7 @@
   @Override
   public final short getNodeType()
   {
-    return (short) dtm.getNodeType(node);
+    return dtm.getNodeType(node);
   }
 
   /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1902,7 +1902,7 @@
         }
         for ( int i = _elementStateCount ; i > 0 ; --i ) {
             if ( _elementStates[ i ].prefixes != null ) {
-                prefix = (String) _elementStates[ i ].prefixes.get( namespaceURI );
+                prefix = _elementStates[ i ].prefixes.get( namespaceURI );
                 if ( prefix != null )
                     return prefix;
             }
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -250,7 +250,7 @@
         {
             if (m_nodeStack.isEmpty())
                 return;
-            MappingRecord map = (MappingRecord)(m_nodeStack.peek());
+            MappingRecord map = m_nodeStack.peek();
             int depth = map.m_declarationDepth;
             if (depth < elemDepth)
                 return;
@@ -258,7 +258,7 @@
              * so get rid of it
              */
 
-            map = (MappingRecord) m_nodeStack.pop();
+            map = m_nodeStack.pop();
             final String prefix = map.m_prefix;
             popNamespace(prefix);
             if (saxHandler != null)
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -1667,7 +1667,7 @@
             startClean =
                 accumDefaultEscape(
                     m_writer,
-                    (char)ch,
+                    ch,
                     i,
                     chars,
                     end,
@@ -2739,9 +2739,8 @@
                     // whitspace separated "{uri1}local1 {uri2}local2 ..."
                     if (i != 0)
                         sb.append(' ');
-                    final String uri = (String) URI_and_localNames.get(i);
-                    final String localName =
-                        (String) URI_and_localNames.get(i + 1);
+                    final String uri = URI_and_localNames.get(i);
+                    final String localName = URI_and_localNames.get(i + 1);
                     if (uri != null) {
                         // If there is no URI don't put this in, just the localName then.
                         sb.append('{');
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/NodeSet.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/NodeSet.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -350,7 +350,7 @@
 
     runTo(index);
 
-    return (Node) this.elementAt(index);
+    return this.elementAt(index);
   }
 
   /**
@@ -582,7 +582,7 @@
 
     for (i = end; i >= start; i--)
     {
-      Node child = (Node) elementAt(i);
+      Node child = elementAt(i);
 
       if (child == node)
       {
@@ -648,7 +648,7 @@
 
       for (i = size - 1; i >= 0; i--)
       {
-        Node child = (Node) elementAt(i);
+        Node child = elementAt(i);
 
         if (child == node)
         {
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/VariableStack.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/VariableStack.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -63,8 +63,8 @@
     VariableStack vs = (VariableStack) super.clone();
 
     // I *think* I can get away with a shallow clone here?
-    vs._stackFrames = (XObject[]) _stackFrames.clone();
-    vs._links = (int[]) _links.clone();
+    vs._stackFrames = _stackFrames.clone();
+    vs._links = _links.clone();
 
     return vs;
   }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -294,7 +294,7 @@
   public int asNode(XPathContext xctxt)
     throws javax.xml.transform.TransformerException
   {
-    DTMIterator iter = (DTMIterator)m_clones.getInstance();
+    DTMIterator iter = m_clones.getInstance();
 
     int current = xctxt.getCurrentNode();
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -470,7 +470,7 @@
 
     try
     {
-      Integer itok = (Integer) Keywords.getKeyWord(key);
+      Integer itok = Keywords.getKeyWord(key);
 
       tok = (null != itok) ? itok.intValue() : 0;
     }
@@ -587,8 +587,7 @@
       try
       {
         if (prefix.length() > 0)
-          uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix(
-            prefix);
+          uName = m_namespaceContext.getNamespaceForPrefix(prefix);
         else
         {
 
@@ -608,9 +607,7 @@
           }
           else
           {
-            uName =
-              ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix(
-                prefix);
+            uName = m_namespaceContext.getNamespaceForPrefix(prefix);
           }
         }
       }
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/OpMap.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/OpMap.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -446,7 +446,7 @@
     // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5]
     //                                  : ((argLenOfStep == 1) ? -3 : -2);
     if (index >= 0)
-      return (String) m_tokenQueue.elementAt(index).toString();
+      return m_tokenQueue.elementAt(index).toString();
     else if (OpCodes.ELEMWILDCARD == index)
       return NodeTest.WILD;
     else
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -137,7 +137,7 @@
                 if ( argument instanceof XNodeSet ) {
                     argList.add ( i, ((XNodeSet)argument).nodelist() );
                 } else if ( argument instanceof XObject ) {
-                    Object passedArgument = ((XObject)argument).object();
+                    Object passedArgument = argument.object();
                     argList.add ( i, passedArgument );
                 } else {
                     argList.add ( i, argument );
@@ -188,7 +188,7 @@
                 if ( argument instanceof XNodeSet ) {
                     argList.add ( i, ((XNodeSet)argument).nodelist() );
                 } else if ( argument instanceof XObject ) {
-                    Object passedArgument = ((XObject)argument).object();
+                    Object passedArgument = argument.object();
                     argList.add ( i, passedArgument );
                 } else {
                     argList.add ( i, argument );
--- a/src/java.xml/share/classes/javax/xml/xpath/XPathException.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/javax/xml/xpath/XPathException.java	Tue Nov 07 16:19:55 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, 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
@@ -110,7 +110,7 @@
             throws IOException
     {
         ObjectOutputStream.PutField fields = out.putFields();
-        fields.put("cause", (Throwable) super.getCause());
+        fields.put("cause", super.getCause());
         out.writeFields();
     }
 
--- a/src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/org/w3c/dom/bootstrap/DOMImplementationRegistry.java	Tue Nov 07 16:19:55 2017 -0800
@@ -213,8 +213,7 @@
         int size = sources.size();
         String name = null;
         for (int i = 0; i < size; i++) {
-            DOMImplementationSource source =
-                (DOMImplementationSource) sources.get(i);
+            DOMImplementationSource source = sources.get(i);
             DOMImplementation impl = source.getDOMImplementation(features);
             if (impl != null) {
                 return impl;
@@ -238,8 +237,7 @@
         final List<DOMImplementation> implementations = new ArrayList<>();
         int size = sources.size();
         for (int i = 0; i < size; i++) {
-            DOMImplementationSource source =
-                (DOMImplementationSource) sources.get(i);
+            DOMImplementationSource source = sources.get(i);
             DOMImplementationList impls =
                 source.getDOMImplementationList(features);
             for (int j = 0; j < impls.getLength(); j++) {
@@ -251,8 +249,7 @@
                 public DOMImplementation item(final int index) {
                     if (index >= 0 && index < implementations.size()) {
                         try {
-                            return (DOMImplementation)
-                                implementations.get(index);
+                            return implementations.get(index);
                         } catch (IndexOutOfBoundsException e) {
                             return null;
                         }
--- a/src/java.xml/share/classes/org/xml/sax/helpers/NamespaceSupport.java	Tue Nov 07 10:35:58 2017 -0800
+++ b/src/java.xml/share/classes/org/xml/sax/helpers/NamespaceSupport.java	Tue Nov 07 16:19:55 2017 -0800
@@ -666,7 +666,7 @@
             // Start by looking in the cache, and
             // return immediately if the name
             // is already known in this content
-            name = (String[])table.get(qName);
+            name = table.get(qName);
             if (name != null) {
                 return name;
             }
@@ -703,7 +703,7 @@
                 if ("".equals(prefix)) {
                     uri = defaultNS;
                 } else {
-                    uri = (String)prefixTable.get(prefix);
+                    uri = prefixTable.get(prefix);
                 }
                 if (uri == null
                         || (!isAttribute && "xmlns".equals (prefix))) {
@@ -735,7 +735,7 @@
             } else if (prefixTable == null) {
                 return null;
             } else {
-                return (String)prefixTable.get(prefix);
+                return prefixTable.get(prefix);
             }
         }
 
@@ -755,7 +755,7 @@
             if (uriTable == null) {
                 return null;
             } else {
-                return (String)uriTable.get(uri);
+                return uriTable.get(uri);
             }
         }