Skip to content

Commit 1769596

Browse files
mcpowerswangweij
authored andcommittedJun 13, 2022
8285263: Minor cleanup could be done in java.security
Reviewed-by: weijun
1 parent b97a4f6 commit 1769596

File tree

94 files changed

+478
-599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+478
-599
lines changed
 

‎src/java.base/share/classes/java/security/AlgorithmConstraints.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -61,12 +61,12 @@ public interface AlgorithmConstraints {
6161
* parameters
6262
*
6363
* @return true if the algorithm is permitted and can be used for all
64-
* of the specified cryptographic primitives
64+
* the specified cryptographic primitives
6565
*
6666
* @throws IllegalArgumentException if primitives or algorithm is null
6767
* or empty
6868
*/
69-
public boolean permits(Set<CryptoPrimitive> primitives,
69+
boolean permits(Set<CryptoPrimitive> primitives,
7070
String algorithm, AlgorithmParameters parameters);
7171

7272
/**
@@ -78,13 +78,13 @@ public boolean permits(Set<CryptoPrimitive> primitives,
7878
* @param primitives a set of cryptographic primitives
7979
* @param key the key
8080
*
81-
* @return true if the key can be used for all of the specified
81+
* @return true if the key can be used for all the specified
8282
* cryptographic primitives
8383
*
8484
* @throws IllegalArgumentException if primitives is null or empty,
8585
* or the key is null
8686
*/
87-
public boolean permits(Set<CryptoPrimitive> primitives, Key key);
87+
boolean permits(Set<CryptoPrimitive> primitives, Key key);
8888

8989
/**
9090
* Determines whether an algorithm and the corresponding key are granted
@@ -96,13 +96,13 @@ public boolean permits(Set<CryptoPrimitive> primitives,
9696
* @param parameters the algorithm parameters, or null if no additional
9797
* parameters
9898
*
99-
* @return true if the key and the algorithm can be used for all of the
99+
* @return true if the key and the algorithm can be used for all the
100100
* specified cryptographic primitives
101101
*
102102
* @throws IllegalArgumentException if primitives or algorithm is null
103103
* or empty, or the key is null
104104
*/
105-
public boolean permits(Set<CryptoPrimitive> primitives,
105+
boolean permits(Set<CryptoPrimitive> primitives,
106106
String algorithm, Key key, AlgorithmParameters parameters);
107107

108108
}

‎src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -99,13 +99,13 @@
9999
public class AlgorithmParameterGenerator {
100100

101101
// The provider
102-
private Provider provider;
102+
private final Provider provider;
103103

104104
// The provider implementation (delegate)
105-
private AlgorithmParameterGeneratorSpi paramGenSpi;
105+
private final AlgorithmParameterGeneratorSpi paramGenSpi;
106106

107107
// The algorithm
108-
private String algorithm;
108+
private final String algorithm;
109109

110110
/**
111111
* Creates an AlgorithmParameterGenerator object.
@@ -150,7 +150,7 @@ public final String getAlgorithm() {
150150
* {@code jdk.security.provider.preferred}
151151
* {@link Security#getProperty(String) Security} property to determine
152152
* the preferred provider order for the specified algorithm. This
153-
* may be different than the order of providers returned by
153+
* may be different from the order of providers returned by
154154
* {@link Security#getProviders() Security.getProviders()}.
155155
*
156156
* @param algorithm the name of the algorithm this

0 commit comments

Comments
 (0)
Please sign in to comment.