mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8229999: Apply java.io.Serial annotations to security types in java.base
Reviewed-by: rriggs, mullan
This commit is contained in:
parent
470d32df73
commit
6d4ef5aaf3
158 changed files with 377 additions and 141 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2019, 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
|
||||
|
@ -34,6 +34,7 @@ package javax.crypto;
|
|||
*/
|
||||
public class AEADBadTagException extends BadPaddingException {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -488059093241685509L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2019, 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
|
||||
|
@ -37,6 +37,7 @@ import java.security.GeneralSecurityException;
|
|||
|
||||
public class BadPaddingException extends GeneralSecurityException {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -5315033893984728443L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2019, 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 @@ import java.util.Vector;
|
|||
|
||||
final class CryptoAllPermission extends CryptoPermission {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -5066513634293192112L;
|
||||
|
||||
// This class is similar to java.security.AllPermission.
|
||||
|
@ -116,6 +117,7 @@ final class CryptoAllPermissionCollection extends PermissionCollection
|
|||
implements java.io.Serializable
|
||||
{
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 7450076868380144072L;
|
||||
|
||||
// true if a CryptoAllPermission has been added
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2019, 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
|
||||
|
@ -49,6 +49,7 @@ import javax.crypto.spec.*;
|
|||
*/
|
||||
class CryptoPermission extends java.security.Permission {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 8987399626114087514L;
|
||||
|
||||
private String alg;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2019, 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
|
||||
|
@ -63,11 +63,13 @@ import java.io.IOException;
|
|||
final class CryptoPermissions extends PermissionCollection
|
||||
implements Serializable {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 4946547168093391015L;
|
||||
|
||||
/**
|
||||
* @serialField perms java.util.Hashtable
|
||||
*/
|
||||
@java.io.Serial
|
||||
private static final ObjectStreamField[] serialPersistentFields = {
|
||||
new ObjectStreamField("perms", Hashtable.class),
|
||||
};
|
||||
|
@ -436,6 +438,7 @@ implements Serializable {
|
|||
return pc;
|
||||
}
|
||||
|
||||
@java.io.Serial
|
||||
private void readObject(ObjectInputStream s)
|
||||
throws IOException, ClassNotFoundException {
|
||||
ObjectInputStream.GetField fields = s.readFields();
|
||||
|
@ -450,6 +453,7 @@ implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
@java.io.Serial
|
||||
private void writeObject(ObjectOutputStream s) throws IOException {
|
||||
Hashtable<String,PermissionCollection> permTable =
|
||||
new Hashtable<>(perms);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2019, 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
|
||||
|
@ -684,6 +684,7 @@ final class CryptoPolicyParser {
|
|||
|
||||
static final class ParsingException extends GeneralSecurityException {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 7147241245566588374L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2019, 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
|
||||
|
@ -35,6 +35,7 @@ import java.security.GeneralSecurityException;
|
|||
|
||||
public class ExemptionMechanismException extends GeneralSecurityException {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 1572699429277957109L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2019, 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
|
||||
|
@ -37,6 +37,7 @@ package javax.crypto;
|
|||
public class IllegalBlockSizeException
|
||||
extends java.security.GeneralSecurityException {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -1965144811953540392L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2019, 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
|
||||
|
@ -38,6 +38,7 @@ import java.security.GeneralSecurityException;
|
|||
|
||||
public class NoSuchPaddingException extends GeneralSecurityException {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -4572885201200175466L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2019, 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
|
||||
|
@ -93,6 +93,7 @@ import java.security.NoSuchProviderException;
|
|||
|
||||
public class SealedObject implements Serializable {
|
||||
|
||||
@java.io.Serial
|
||||
static final long serialVersionUID = 4482838265551344752L;
|
||||
|
||||
/**
|
||||
|
@ -423,6 +424,7 @@ public class SealedObject implements Serializable {
|
|||
* @param s the object input stream.
|
||||
* @exception NullPointerException if s is null.
|
||||
*/
|
||||
@java.io.Serial
|
||||
private void readObject(java.io.ObjectInputStream s)
|
||||
throws java.io.IOException, ClassNotFoundException
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2019, 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
|
||||
|
@ -38,6 +38,7 @@ import java.security.GeneralSecurityException;
|
|||
|
||||
public class ShortBufferException extends GeneralSecurityException {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 8427718640832943747L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2019, 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
|
||||
|
@ -47,6 +47,7 @@ public interface DHPrivateKey extends DHKey, java.security.PrivateKey {
|
|||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
@java.io.Serial
|
||||
static final long serialVersionUID = 2211791113380396553L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2019, 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
|
||||
|
@ -47,6 +47,7 @@ public interface DHPublicKey extends DHKey, java.security.PublicKey {
|
|||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
@java.io.Serial
|
||||
static final long serialVersionUID = -6628103563352519193L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2019, 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
|
||||
|
@ -47,6 +47,7 @@ public interface PBEKey extends javax.crypto.SecretKey {
|
|||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
@java.io.Serial
|
||||
static final long serialVersionUID = -1430015993304333921L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2019, 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
|
||||
|
@ -49,6 +49,7 @@ import javax.crypto.SecretKey;
|
|||
*/
|
||||
public class SecretKeySpec implements KeySpec, SecretKey {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 6577238317307289933L;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue