8209304: Deprecate serialVersionUID fields in interfaces

Reviewed-by: lancea, mullan, rriggs, smarks
This commit is contained in:
Joe Darcy 2018-08-17 13:37:01 -07:00
parent 4dfa58d553
commit 07ed14c5cf
20 changed files with 106 additions and 23 deletions

View File

@ -108,8 +108,12 @@ public interface Key extends java.io.Serializable {
* The class fingerprint that is set to indicate * The class fingerprint that is set to indicate
* serialization compatibility with a previous * serialization compatibility with a previous
* version of the class. * 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; static final long serialVersionUID = 6603384152749567654L;
/** /**

View File

@ -63,7 +63,11 @@ public interface PrivateKey extends Key, javax.security.auth.Destroyable {
/** /**
* The class fingerprint that is set to indicate serialization * The class fingerprint that is set to indicate serialization
* compatibility with a previous version of the class. * 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 = 6034044314589513430L; static final long serialVersionUID = 6034044314589513430L;
} }

View File

@ -49,7 +49,11 @@ public interface PublicKey extends Key {
/** /**
* The class fingerprint that is set to indicate serialization * The class fingerprint that is set to indicate serialization
* compatibility with a previous version of the class. * 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; static final long serialVersionUID = 7187392471159151072L;
} }

View File

@ -47,8 +47,12 @@ public interface DSAPrivateKey extends DSAKey, java.security.PrivateKey {
* The class fingerprint that is set to indicate * The class fingerprint that is set to indicate
* serialization compatibility with a previous * serialization compatibility with a previous
* version of the class. * 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; static final long serialVersionUID = 7776497482533790279L;
/** /**

View File

@ -47,8 +47,12 @@ public interface DSAPublicKey extends DSAKey, java.security.PublicKey {
* The class fingerprint that is set to indicate * The class fingerprint that is set to indicate
* serialization compatibility with a previous * serialization compatibility with a previous
* version of the class. * 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; static final long serialVersionUID = 1234526332779022332L;
/** /**

View File

@ -42,8 +42,12 @@ public interface ECPrivateKey extends PrivateKey, ECKey {
/** /**
* The class fingerprint that is set to indicate * The class fingerprint that is set to indicate
* serialization compatibility. * 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; static final long serialVersionUID = -7896394956925609184L;
/** /**

View File

@ -44,8 +44,12 @@ public interface ECPublicKey extends PublicKey, ECKey {
/** /**
* The class fingerprint that is set to indicate * The class fingerprint that is set to indicate
* serialization compatibility. * 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; static final long serialVersionUID = -3314988629879632826L;
/** /**

View File

@ -50,8 +50,12 @@ public interface RSAMultiPrimePrivateCrtKey extends RSAPrivateKey {
* The type fingerprint that is set to indicate * The type fingerprint that is set to indicate
* serialization compatibility with a previous * serialization compatibility with a previous
* version of the type. * 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; static final long serialVersionUID = 618058533534628008L;
/** /**

View File

@ -45,8 +45,12 @@ public interface RSAPrivateCrtKey extends RSAPrivateKey {
* The type fingerprint that is set to indicate * The type fingerprint that is set to indicate
* serialization compatibility with a previous * serialization compatibility with a previous
* version of the type. * 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; static final long serialVersionUID = -5682214253527700368L;
/** /**

View File

@ -44,8 +44,12 @@ public interface RSAPrivateKey extends java.security.PrivateKey, RSAKey
* The type fingerprint that is set to indicate * The type fingerprint that is set to indicate
* serialization compatibility with a previous * serialization compatibility with a previous
* version of the type. * 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; static final long serialVersionUID = 5187144804936595022L;
/** /**

View File

@ -41,8 +41,12 @@ public interface RSAPublicKey extends java.security.PublicKey, RSAKey
* The type fingerprint that is set to indicate * The type fingerprint that is set to indicate
* serialization compatibility with a previous * serialization compatibility with a previous
* version of the type. * 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; static final long serialVersionUID = -8727434096241101194L;
/** /**

View File

@ -63,7 +63,11 @@ public interface SecretKey extends
/** /**
* The class fingerprint that is set to indicate serialization * The class fingerprint that is set to indicate serialization
* compatibility since J2SE 1.4. * 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; static final long serialVersionUID = -4795878709595146952L;
} }

View File

@ -41,8 +41,12 @@ public interface DHPrivateKey extends DHKey, java.security.PrivateKey {
/** /**
* The class fingerprint that is set to indicate serialization * The class fingerprint that is set to indicate serialization
* compatibility since J2SE 1.4. * 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; static final long serialVersionUID = 2211791113380396553L;
/** /**

View File

@ -41,8 +41,12 @@ public interface DHPublicKey extends DHKey, java.security.PublicKey {
/** /**
* The class fingerprint that is set to indicate serialization * The class fingerprint that is set to indicate serialization
* compatibility since J2SE 1.4. * 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; static final long serialVersionUID = -6628103563352519193L;
/** /**

View File

@ -41,8 +41,12 @@ public interface PBEKey extends javax.crypto.SecretKey {
/** /**
* The class fingerprint that is set to indicate serialization * The class fingerprint that is set to indicate serialization
* compatibility since J2SE 1.4. * 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; static final long serialVersionUID = -1430015993304333921L;
/** /**

View File

@ -44,7 +44,12 @@ import javax.crypto.SecretKey;
@Deprecated @Deprecated
public interface TlsMasterSecret extends SecretKey { 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; public static final long serialVersionUID = -461748105810469773L;
/** /**

View File

@ -63,8 +63,12 @@ public interface Name
* The class fingerprint that is set to indicate * The class fingerprint that is set to indicate
* serialization compatibility with a previous * serialization compatibility with a previous
* version of the class. * 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; static final long serialVersionUID = -3617482732056931635L;
/** /**

View File

@ -335,7 +335,11 @@ public interface Attribute extends Cloneable, java.io.Serializable {
/** /**
* Use serialVersionUID from JNDI 1.1.1 for interoperability. * 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; static final long serialVersionUID = 8707690322213556804L;
} }

View File

@ -38,8 +38,13 @@ import java.rmi.*;
*/ */
public interface RemoteRef extends java.io.Externalizable { public interface RemoteRef extends java.io.Externalizable {
/** indicate compatibility with JDK 1.1.x version of class. */ /** indicate compatibility with JDK 1.1.x version of 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 = 3632638527362204081L; static final long serialVersionUID = 3632638527362204081L;
/** /**

View File

@ -38,8 +38,13 @@ import java.rmi.*;
@Deprecated @Deprecated
public interface ServerRef extends RemoteRef { public interface ServerRef extends RemoteRef {
/** indicate compatibility with JDK 1.1.x version of class. */ /** indicate compatibility with JDK 1.1.x version of 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 = -4557750989390278438L; static final long serialVersionUID = -4557750989390278438L;
/** /**