8189993: Improve document portability
authorjoehw
Wed, 17 Jan 2018 22:24:46 -0800
changeset 49785 1ea962cb6575
parent 49784 d28ec9f8d528
child 49786 7444101401b2
8189993: Improve document portability Reviewed-by: rriggs, lancea, dfuchs, skoivu
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java	Thu Jan 18 11:03:30 2018 +0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java	Wed Jan 17 22:24:46 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -56,7 +56,7 @@
  * @xerces.internal
  *
  * @since  PR-DOM-Level-1-19980818.
- * @LastModified: Oct 2017
+ * @LastModified: Jan 2018
  */
 public class NamedNodeMapImpl
     implements NamedNodeMap, Serializable {
@@ -595,12 +595,14 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream in)
         throws IOException, ClassNotFoundException {
         in.defaultReadObject();
         if (nodes != null) {
             // nodes are written as a Vector for compatibility.
-            nodes = new ArrayList<>(nodes);
+            // cast to Vector is required
+            nodes = new ArrayList<>((Vector<Node>)nodes);
         }
     }