8209304: Deprecate serialVersionUID fields in interfaces
authordarcy
Fri, 17 Aug 2018 13:37:01 -0700
changeset 51437 6221a199ec20
parent 51436 091c0d22e735
child 51438 6ca468ea3564
8209304: Deprecate serialVersionUID fields in interfaces Reviewed-by: lancea, mullan, rriggs, smarks
src/java.base/share/classes/java/security/Key.java
src/java.base/share/classes/java/security/PrivateKey.java
src/java.base/share/classes/java/security/PublicKey.java
src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java
src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java
src/java.base/share/classes/java/security/interfaces/ECPrivateKey.java
src/java.base/share/classes/java/security/interfaces/ECPublicKey.java
src/java.base/share/classes/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java
src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java
src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java
src/java.base/share/classes/javax/crypto/SecretKey.java
src/java.base/share/classes/javax/crypto/interfaces/DHPrivateKey.java
src/java.base/share/classes/javax/crypto/interfaces/DHPublicKey.java
src/java.base/share/classes/javax/crypto/interfaces/PBEKey.java
src/java.base/share/classes/sun/security/internal/interfaces/TlsMasterSecret.java
src/java.naming/share/classes/javax/naming/Name.java
src/java.naming/share/classes/javax/naming/directory/Attribute.java
src/java.rmi/share/classes/java/rmi/server/RemoteRef.java
src/java.rmi/share/classes/java/rmi/server/ServerRef.java
--- a/src/java.base/share/classes/java/security/Key.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/Key.java	Fri Aug 17 13:37:01 2018 -0700
@@ -108,8 +108,12 @@
     * The class fingerprint that is set to indicate
     * serialization compatibility with a previous
     * version of the class.
+    *
+    * @deprecated A {@code serialVersionUID} field in an interface is
+    * ineffectual. Do not use; no replacement.
     */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = 6603384152749567654L;
 
     /**
--- a/src/java.base/share/classes/java/security/PrivateKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/PrivateKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -63,7 +63,11 @@
     /**
      * The class fingerprint that is set to indicate serialization
      * compatibility with a previous version of the class.
-     */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
+      */
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = 6034044314589513430L;
 }
--- a/src/java.base/share/classes/java/security/PublicKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/PublicKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -49,7 +49,11 @@
     /**
      * The class fingerprint that is set to indicate serialization
      * compatibility with a previous version of the class.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
      */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = 7187392471159151072L;
 }
--- a/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -47,8 +47,12 @@
     * The class fingerprint that is set to indicate
     * serialization compatibility with a previous
     * version of the class.
+    *
+    * @deprecated A {@code serialVersionUID} field in an interface is
+    * ineffectual. Do not use; no replacement.
     */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = 7776497482533790279L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -47,8 +47,12 @@
     * The class fingerprint that is set to indicate
     * serialization compatibility with a previous
     * version of the class.
+    *
+    * @deprecated A {@code serialVersionUID} field in an interface is
+    * ineffectual. Do not use; no replacement.
     */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = 1234526332779022332L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/ECPrivateKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/ECPrivateKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -42,8 +42,12 @@
    /**
     * The class fingerprint that is set to indicate
     * serialization compatibility.
+    *
+    * @deprecated A {@code serialVersionUID} field in an interface is
+    * ineffectual. Do not use; no replacement.
     */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = -7896394956925609184L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/ECPublicKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/ECPublicKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -44,8 +44,12 @@
    /**
     * The class fingerprint that is set to indicate
     * serialization compatibility.
+    *
+    * @deprecated A {@code serialVersionUID} field in an interface is
+    * ineffectual. Do not use; no replacement.
     */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = -3314988629879632826L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -50,8 +50,12 @@
      * The type fingerprint that is set to indicate
      * serialization compatibility with a previous
      * version of the type.
+    *
+    * @deprecated A {@code serialVersionUID} field in an interface is
+    * ineffectual. Do not use; no replacement.
      */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = 618058533534628008L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -45,8 +45,12 @@
      * The type fingerprint that is set to indicate
      * serialization compatibility with a previous
      * version of the type.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
      */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = -5682214253527700368L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -44,8 +44,12 @@
      * The type fingerprint that is set to indicate
      * serialization compatibility with a previous
      * version of the type.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
      */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = 5187144804936595022L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -41,8 +41,12 @@
      * The type fingerprint that is set to indicate
      * serialization compatibility with a previous
      * version of the type.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
      */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = -8727434096241101194L;
 
     /**
--- a/src/java.base/share/classes/javax/crypto/SecretKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/javax/crypto/SecretKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -63,7 +63,11 @@
     /**
      * The class fingerprint that is set to indicate serialization
      * compatibility since J2SE 1.4.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
      */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = -4795878709595146952L;
 }
--- a/src/java.base/share/classes/javax/crypto/interfaces/DHPrivateKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/javax/crypto/interfaces/DHPrivateKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -41,8 +41,12 @@
     /**
      * The class fingerprint that is set to indicate serialization
      * compatibility since J2SE 1.4.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
      */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = 2211791113380396553L;
 
     /**
--- a/src/java.base/share/classes/javax/crypto/interfaces/DHPublicKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/javax/crypto/interfaces/DHPublicKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -41,8 +41,12 @@
     /**
      * The class fingerprint that is set to indicate serialization
      * compatibility since J2SE 1.4.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
      */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = -6628103563352519193L;
 
     /**
--- a/src/java.base/share/classes/javax/crypto/interfaces/PBEKey.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/javax/crypto/interfaces/PBEKey.java	Fri Aug 17 13:37:01 2018 -0700
@@ -41,8 +41,12 @@
     /**
      * The class fingerprint that is set to indicate serialization
      * compatibility since J2SE 1.4.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
      */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = -1430015993304333921L;
 
     /**
--- a/src/java.base/share/classes/sun/security/internal/interfaces/TlsMasterSecret.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.base/share/classes/sun/security/internal/interfaces/TlsMasterSecret.java	Fri Aug 17 13:37:01 2018 -0700
@@ -44,7 +44,12 @@
 @Deprecated
 public interface TlsMasterSecret extends SecretKey {
 
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    /***
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
+     */
+    @Deprecated
+    @SuppressWarnings("serial")
     public static final long serialVersionUID = -461748105810469773L;
 
     /**
--- a/src/java.naming/share/classes/javax/naming/Name.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.naming/share/classes/javax/naming/Name.java	Fri Aug 17 13:37:01 2018 -0700
@@ -63,8 +63,12 @@
     * The class fingerprint that is set to indicate
     * serialization compatibility with a previous
     * version of the class.
+    *
+    * @deprecated A {@code serialVersionUID} field in an interface is
+    * ineffectual. Do not use; no replacement.
     */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = -3617482732056931635L;
 
     /**
--- a/src/java.naming/share/classes/javax/naming/directory/Attribute.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.naming/share/classes/javax/naming/directory/Attribute.java	Fri Aug 17 13:37:01 2018 -0700
@@ -335,7 +335,11 @@
 
     /**
      * Use serialVersionUID from JNDI 1.1.1 for interoperability.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
      */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = 8707690322213556804L;
 }
--- a/src/java.rmi/share/classes/java/rmi/server/RemoteRef.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.rmi/share/classes/java/rmi/server/RemoteRef.java	Fri Aug 17 13:37:01 2018 -0700
@@ -38,8 +38,13 @@
  */
 public interface RemoteRef extends java.io.Externalizable {
 
-    /** indicate compatibility with JDK 1.1.x version of class. */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    /** indicate compatibility with JDK 1.1.x version of class.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
+     */
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = 3632638527362204081L;
 
     /**
--- a/src/java.rmi/share/classes/java/rmi/server/ServerRef.java	Fri Aug 17 13:20:53 2018 -0700
+++ b/src/java.rmi/share/classes/java/rmi/server/ServerRef.java	Fri Aug 17 13:37:01 2018 -0700
@@ -38,8 +38,13 @@
 @Deprecated
 public interface ServerRef extends RemoteRef {
 
-    /** indicate compatibility with JDK 1.1.x version of class. */
-    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
+    /** indicate compatibility with JDK 1.1.x version of class.
+     *
+     * @deprecated A {@code serialVersionUID} field in an interface is
+     * ineffectual. Do not use; no replacement.
+     */
+    @Deprecated
+    @SuppressWarnings("serial")
     static final long serialVersionUID = -4557750989390278438L;
 
     /**