8209024: Use SuppressWarnings on serialVersionUID fields in interfaces
authordarcy
Mon, 06 Aug 2018 14:29:22 -0700
changeset 51317 e122220d7d7e
parent 51316 c23f1e4910f3
child 51318 60f9b6b5ad86
8209024: Use SuppressWarnings on serialVersionUID fields in interfaces Reviewed-by: bpb, rriggs, mullan
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	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/Key.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -109,6 +109,7 @@
     * serialization compatibility with a previous
     * version of the class.
     */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = 6603384152749567654L;
 
     /**
--- a/src/java.base/share/classes/java/security/PrivateKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/PrivateKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,5 +64,6 @@
      * 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
     static final long serialVersionUID = 6034044314589513430L;
 }
--- a/src/java.base/share/classes/java/security/PublicKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/PublicKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,5 +50,6 @@
      * 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
     static final long serialVersionUID = 7187392471159151072L;
 }
--- a/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@
     * serialization compatibility with a previous
     * version of the class.
     */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = 7776497482533790279L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@
     * serialization compatibility with a previous
     * version of the class.
     */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = 1234526332779022332L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/ECPrivateKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/ECPrivateKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
     * The class fingerprint that is set to indicate
     * serialization compatibility.
     */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = -7896394956925609184L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/ECPublicKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/ECPublicKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
     * The class fingerprint that is set to indicate
     * serialization compatibility.
     */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = -3314988629879632826L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -51,6 +51,7 @@
      * serialization compatibility with a previous
      * version of the type.
      */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = 618058533534628008L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -46,6 +46,7 @@
      * serialization compatibility with a previous
      * version of the type.
      */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = -5682214253527700368L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
      * serialization compatibility with a previous
      * version of the type.
      */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = 5187144804936595022L;
 
     /**
--- a/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
      * serialization compatibility with a previous
      * version of the type.
      */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = -8727434096241101194L;
 
     /**
--- a/src/java.base/share/classes/javax/crypto/SecretKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/javax/crypto/SecretKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,5 +64,6 @@
      * The class fingerprint that is set to indicate serialization
      * compatibility since J2SE 1.4.
      */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = -4795878709595146952L;
 }
--- a/src/java.base/share/classes/javax/crypto/interfaces/DHPrivateKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/javax/crypto/interfaces/DHPrivateKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
      * The class fingerprint that is set to indicate serialization
      * compatibility since J2SE 1.4.
      */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = 2211791113380396553L;
 
     /**
--- a/src/java.base/share/classes/javax/crypto/interfaces/DHPublicKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/javax/crypto/interfaces/DHPublicKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
      * The class fingerprint that is set to indicate serialization
      * compatibility since J2SE 1.4.
      */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = -6628103563352519193L;
 
     /**
--- a/src/java.base/share/classes/javax/crypto/interfaces/PBEKey.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/javax/crypto/interfaces/PBEKey.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
      * The class fingerprint that is set to indicate serialization
      * compatibility since J2SE 1.4.
      */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = -1430015993304333921L;
 
     /**
--- a/src/java.base/share/classes/sun/security/internal/interfaces/TlsMasterSecret.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.base/share/classes/sun/security/internal/interfaces/TlsMasterSecret.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,7 @@
 @Deprecated
 public interface TlsMasterSecret extends SecretKey {
 
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     public static final long serialVersionUID = -461748105810469773L;
 
     /**
--- a/src/java.naming/share/classes/javax/naming/Name.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.naming/share/classes/javax/naming/Name.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,6 +64,7 @@
     * serialization compatibility with a previous
     * version of the class.
     */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = -3617482732056931635L;
 
     /**
--- a/src/java.naming/share/classes/javax/naming/directory/Attribute.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.naming/share/classes/javax/naming/directory/Attribute.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,5 +336,6 @@
     /**
      * Use serialVersionUID from JNDI 1.1.1 for interoperability.
      */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = 8707690322213556804L;
 }
--- a/src/java.rmi/share/classes/java/rmi/server/RemoteRef.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.rmi/share/classes/java/rmi/server/RemoteRef.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
 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
     static final long serialVersionUID = 3632638527362204081L;
 
     /**
--- a/src/java.rmi/share/classes/java/rmi/server/ServerRef.java	Mon Aug 06 13:53:49 2018 -0700
+++ b/src/java.rmi/share/classes/java/rmi/server/ServerRef.java	Mon Aug 06 14:29:22 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
 public interface ServerRef extends RemoteRef {
 
     /** indicate compatibility with JDK 1.1.x version of class. */
+    @SuppressWarnings("serial") // serialVersionUID in an interface is ineffectual
     static final long serialVersionUID = -4557750989390278438L;
 
     /**