Skip to content

Commit 4b21fb9

Browse files
committed
8343467: Remove unnecessary @SuppressWarnings annotations (security)
Reviewed-by: mullan
1 parent e7fc0eb commit 4b21fb9

File tree

23 files changed

+13
-36
lines changed

23 files changed

+13
-36
lines changed

src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ protected void engineInit(AlgorithmParameterSpec paramSpec)
206206
this.cipherParam = ((PBEParameterSpec)paramSpec).getParameterSpec();
207207
}
208208

209-
@SuppressWarnings("deprecation")
210209
protected void engineInit(byte[] encoded)
211210
throws IOException
212211
{
@@ -239,7 +238,6 @@ protected void engineInit(byte[] encoded)
239238
this.pbes2AlgorithmName = "PBEWith" + kdfAlgo + "And" + cipherAlgo;
240239
}
241240

242-
@SuppressWarnings("deprecation")
243241
private String parseKDF(DerValue keyDerivationFunc) throws IOException {
244242

245243
if (!pkcs5PBKDF2_OID.equals(keyDerivationFunc.data.getOID())) {
@@ -299,7 +297,6 @@ private String parseKDF(DerValue keyDerivationFunc) throws IOException {
299297
return kdfAlgo;
300298
}
301299

302-
@SuppressWarnings("deprecation")
303300
private String parseES(DerValue encryptionScheme) throws IOException {
304301
String cipherAlgo;
305302

src/java.base/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ final Key getKey(Cipher c, int maxLength)
8181
.getExtObjectInputStream(this, c)) {
8282
ois.setObjectInputFilter(new DeserializationChecker(maxLength));
8383
try {
84-
@SuppressWarnings("unchecked")
8584
Key t = (Key) ois.readObject();
8685
return t;
8786
} catch (InvalidClassException ice) {

src/java.base/share/classes/java/security/Key.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ public interface Key extends java.io.Serializable {
115115
* ineffectual. Do not use; no replacement.
116116
*/
117117
@Deprecated
118-
@SuppressWarnings("serial")
119118
@java.io.Serial
120119
long serialVersionUID = 6603384152749567654L;
121120

src/java.base/share/classes/java/security/PrivateKey.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2024, 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
@@ -68,7 +68,6 @@ public interface PrivateKey extends AsymmetricKey, javax.security.auth.Destroyab
6868
* ineffectual. Do not use; no replacement.
6969
*/
7070
@Deprecated
71-
@SuppressWarnings("serial")
7271
@java.io.Serial
7372
long serialVersionUID = 6034044314589513430L;
7473
}

src/java.base/share/classes/java/security/Provider.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ private Object implReplace(Object key, Object value) {
827827
return o;
828828
}
829829

830-
@SuppressWarnings("unchecked") // Function must actually operate over strings
830+
// Function must actually operate over strings
831831
private void implReplaceAll(BiFunction<? super Object, ? super Object,
832832
? extends Object> function) {
833833

@@ -847,7 +847,7 @@ private void implReplaceAll(BiFunction<? super Object, ? super Object,
847847
}
848848
}
849849

850-
@SuppressWarnings("unchecked") // Function must actually operate over strings
850+
// Function must actually operate over strings
851851
private Object implMerge(Object key, Object value,
852852
BiFunction<? super Object, ? super Object, ? extends Object>
853853
remappingFunction) {
@@ -864,7 +864,7 @@ private Object implMerge(Object key, Object value,
864864
return o;
865865
}
866866

867-
@SuppressWarnings("unchecked") // Function must actually operate over strings
867+
// Function must actually operate over strings
868868
private Object implCompute(Object key, BiFunction<? super Object,
869869
? super Object, ? extends Object> remappingFunction) {
870870

@@ -881,7 +881,7 @@ private Object implCompute(Object key, BiFunction<? super Object,
881881
return o;
882882
}
883883

884-
@SuppressWarnings("unchecked") // Function must actually operate over strings
884+
// Function must actually operate over strings
885885
private Object implComputeIfAbsent(Object key, Function<? super Object,
886886
? extends Object> mappingFunction) {
887887
if (!checkLegacy(key)) return null;
@@ -893,7 +893,7 @@ private Object implComputeIfAbsent(Object key, Function<? super Object,
893893
return o;
894894
}
895895

896-
@SuppressWarnings("unchecked") // Function must actually operate over strings
896+
// Function must actually operate over strings
897897
private Object implComputeIfPresent(Object key, BiFunction<? super Object,
898898
? super Object, ? extends Object> remappingFunction) {
899899
if (!checkLegacy(key)) return null;

src/java.base/share/classes/java/security/PublicKey.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2024, 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
@@ -54,7 +54,6 @@ public interface PublicKey extends AsymmetricKey {
5454
* ineffectual. Do not use; no replacement.
5555
*/
5656
@Deprecated
57-
@SuppressWarnings("serial")
5857
@java.io.Serial
5958
long serialVersionUID = 7187392471159151072L;
6059
}

src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public interface DSAPrivateKey extends DSAKey, java.security.PrivateKey {
5252
* ineffectual. Do not use; no replacement.
5353
*/
5454
@Deprecated
55-
@SuppressWarnings("serial")
5655
@java.io.Serial
5756
long serialVersionUID = 7776497482533790279L;
5857

src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public interface DSAPublicKey extends DSAKey, java.security.PublicKey {
5252
* ineffectual. Do not use; no replacement.
5353
*/
5454
@Deprecated
55-
@SuppressWarnings("serial")
5655
@java.io.Serial
5756
long serialVersionUID = 1234526332779022332L;
5857

src/java.base/share/classes/java/security/interfaces/ECPrivateKey.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public interface ECPrivateKey extends PrivateKey, ECKey {
4848
* ineffectual. Do not use; no replacement.
4949
*/
5050
@Deprecated
51-
@SuppressWarnings("serial")
5251
@java.io.Serial
5352
long serialVersionUID = -7896394956925609184L;
5453

src/java.base/share/classes/java/security/interfaces/ECPublicKey.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public interface ECPublicKey extends PublicKey, ECKey {
5050
* ineffectual. Do not use; no replacement.
5151
*/
5252
@Deprecated
53-
@SuppressWarnings("serial")
5453
@java.io.Serial
5554
long serialVersionUID = -3314988629879632826L;
5655

0 commit comments

Comments
 (0)