8231368: Suppress warnings on non-serializable non-transient instance fields in java.security.jgss
authordarcy
Tue, 08 Oct 2019 15:27:13 -0700
changeset 58510 23a06a5eeddd
parent 58509 7b41c88f8432
child 58511 eb68d459ba6a
8231368: Suppress warnings on non-serializable non-transient instance fields in java.security.jgss Reviewed-by: mullan, coffeys
src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java
src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java
src/java.security.jgss/share/classes/sun/security/krb5/internal/KRBError.java
--- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java	Tue Oct 08 17:30:48 2019 -0400
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java	Tue Oct 08 15:27:13 2019 -0700
@@ -1391,6 +1391,7 @@
     static class KerberosSessionKey implements Key {
         private static final long serialVersionUID = 699307378954123869L;
 
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private final EncryptionKey key;
 
         KerberosSessionKey(EncryptionKey key) {
--- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java	Tue Oct 08 17:30:48 2019 -0400
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java	Tue Oct 08 15:27:13 2019 -0700
@@ -53,7 +53,9 @@
 
     private static final long serialVersionUID = 7723415700837898232L;
 
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Krb5NameElement name;
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Credentials krb5Credentials;
 
     private Krb5InitCredential(Krb5NameElement name,
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/KRBError.java	Tue Oct 08 17:30:48 2019 -0400
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/KRBError.java	Tue Oct 08 15:27:13 2019 -0700
@@ -79,7 +79,9 @@
  * <a href="http://www.ietf.org/rfc/rfc4120.txt">
  * http://www.ietf.org/rfc/rfc4120.txt</a>.
  */
-
+// The instance fields not statically typed as Serializable are ASN.1
+// encoded and written by the writeObject method.
+@SuppressWarnings("serial")
 public class KRBError implements java.io.Serializable {
     static final long serialVersionUID = 3643809337475284503L;