From 9fc47e6808831be4bbf01c5684f6a55037071834 Mon Sep 17 00:00:00 2001 From: xuelei Date: Thu, 1 Aug 2013 07:34:30 -0700 Subject: [PATCH] 7127524: P11TlsPrfGenerator has anonymous inner class with serialVersionUID Reviewed-by: vinnie --- .../sun/security/pkcs11/P11TlsPrfGenerator.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/share/classes/sun/security/pkcs11/P11TlsPrfGenerator.java b/src/share/classes/sun/security/pkcs11/P11TlsPrfGenerator.java index 8f75b1ec3..86bee16a7 100644 --- a/src/share/classes/sun/security/pkcs11/P11TlsPrfGenerator.java +++ b/src/share/classes/sun/security/pkcs11/P11TlsPrfGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, 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 @@ -96,10 +96,15 @@ final class P11TlsPrfGenerator extends KeyGeneratorSpi { } } - // SecretKeySpec does not allow zero length keys, so we define our own class. + // SecretKeySpec does not allow zero length keys, so we define our + // own class. + // + // As an anonymous class cannot make any guarantees about serialization + // compatibility, it is nonsensical for an anonymous class to define a + // serialVersionUID. Suppress warnings relative to missing serialVersionUID + // field in the anonymous subclass of serializable SecretKey. + @SuppressWarnings("serial") private static final SecretKey NULL_KEY = new SecretKey() { - private static final long serialVersionUID = -8090049519656411362L; - public byte[] getEncoded() { return new byte[0]; } -- GitLab