8189993: Improve document portability
Reviewed-by: rriggs, lancea, dfuchs, skoivu
--- 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);
}
}