changeset 59331:d1ad49003c3d

8244342: Compilation warnings about unexpected serialization related method signatures. Reviewed-by: lancea, naoto, rriggs
author joehw
date Mon, 18 May 2020 17:15:32 +0000
parents 0050836e5934
children b78256118358
files src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.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/axes/PredicatedNodeTest.java src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java
diffstat 5 files changed, 29 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java	Mon May 18 09:42:52 2020 -0700
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java	Mon May 18 17:15:32 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -68,7 +68,7 @@
  * @author G. Todd Millerj
  * @author Jochen Cordes <Jochen.Cordes@t-online.de>
  * @author Santiago Pericas-Geertsen
- * @LastModified: Nov 2017
+ * @LastModified: May 2020
  */
 public final class TemplatesImpl implements Templates, Serializable {
     static final long serialVersionUID = 673094361519270707L;
@@ -295,7 +295,7 @@
      *  then we want it to get serialized
      */
     private void writeObject(ObjectOutputStream os)
-        throws IOException, ClassNotFoundException {
+        throws IOException {
         if (_auxClasses != null) {
             //throw with the same message as when Hashtable was used for compatibility.
             throw new NotSerializableException(
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java	Mon May 18 09:42:52 2020 -0700
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java	Mon May 18 17:15:32 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -98,7 +98,7 @@
  * @author Kohsuke Kawaguchi
  * @author Joseph Fialli
  * @see XMLGregorianCalendar#add(Duration)
- * @LastModified: June 2018
+ * @LastModified: May 2020
  */
 class DurationImpl
         extends Duration
@@ -1857,7 +1857,7 @@
      *      An object that encapsulates the string
      *      returned by <code>this.toString()</code>.
      */
-    private Object writeReplace() throws IOException {
+    private Object writeReplace() {
         return new DurationStream(this.toString());
     }
 
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java	Mon May 18 09:42:52 2020 -0700
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java	Mon May 18 17:15:32 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -45,7 +45,7 @@
  * the case where the LocPathIterator is "owned" by a UnionPathIterator,
  * in which case the UnionPathIterator will cache the nodes.</p>
  * @xsl.usage advanced
- * @LastModified: Nov 2017
+ * @LastModified: May 2020
  */
 public abstract class LocPathIterator extends PredicatedNodeTest
         implements Cloneable, DTMIterator, java.io.Serializable, PathComponent
@@ -134,17 +134,10 @@
    * @throws javax.xml.transform.TransformerException
    */
   private void readObject(java.io.ObjectInputStream stream)
-          throws java.io.IOException, javax.xml.transform.TransformerException
+          throws java.io.IOException, ClassNotFoundException
   {
-    try
-    {
-      stream.defaultReadObject();
-      m_clones =  new IteratorPool(this);
-    }
-    catch (ClassNotFoundException cnfe)
-    {
-      throw new javax.xml.transform.TransformerException(cnfe);
-    }
+    stream.defaultReadObject();
+    m_clones =  new IteratorPool(this);
   }
 
   /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java	Mon May 18 09:42:52 2020 -0700
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java	Mon May 18 17:15:32 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -34,7 +34,7 @@
 import java.util.List;
 
 /**
- * @LastModified: Oct 2017
+ * @LastModified: May 2020
  */
 public abstract class PredicatedNodeTest extends NodeTest implements SubContextList
 {
@@ -67,26 +67,19 @@
    * @throws javax.xml.transform.TransformerException
    */
   private void readObject(java.io.ObjectInputStream stream)
-          throws java.io.IOException, javax.xml.transform.TransformerException
+          throws java.io.IOException, ClassNotFoundException
   {
-    try
-    {
-      stream.defaultReadObject();
-      m_predicateIndex = -1;
+    stream.defaultReadObject();
+    m_predicateIndex = -1;
 
-      /**
-       * Initialize to the declared value.
-       * As noted at declaration, this variable is used only for clones for getLastPos,
-       * it should have been excluded from serialization. For compatibility, we'll
-       * keep it as is but initializing to the declared value.
-       */
-      m_predCount = -1;
-      resetProximityPositions();
-    }
-    catch (ClassNotFoundException cnfe)
-    {
-      throw new javax.xml.transform.TransformerException(cnfe);
-    }
+    /**
+     * Initialize to the declared value.
+     * As noted at declaration, this variable is used only for clones for getLastPos,
+     * it should have been excluded from serialization. For compatibility, we'll
+     * keep it as is but initializing to the declared value.
+     */
+    m_predCount = -1;
+    resetProximityPositions();
   }
 
   /**
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java	Mon May 18 09:42:52 2020 -0700
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java	Mon May 18 17:15:32 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -39,7 +39,7 @@
  * As each node is iterated via nextNode(), the node is also stored
  * in the NodeVector, so that previousNode() can easily be done.
  * @xsl.usage advanced
- * @LastModified: Oct 2017
+ * @LastModified: May 2020
  */
 public class UnionPathIterator extends LocPathIterator
         implements Cloneable, DTMIterator, java.io.Serializable, PathComponent
@@ -258,17 +258,10 @@
    * @throws javax.xml.transform.TransformerException
    */
   private void readObject(java.io.ObjectInputStream stream)
-          throws java.io.IOException, javax.xml.transform.TransformerException
+          throws java.io.IOException, ClassNotFoundException
   {
-    try
-    {
-      stream.defaultReadObject();
-      m_clones =  new IteratorPool(this);
-    }
-    catch (ClassNotFoundException cnfe)
-    {
-      throw new javax.xml.transform.TransformerException(cnfe);
-    }
+    stream.defaultReadObject();
+    m_clones =  new IteratorPool(this);
   }
 
   /**