Skip to content

Commit 39e03a0

Browse files
committed
8258804: Collection.toArray() should use empty array
Reviewed-by: mullan
1 parent 9e463d1 commit 39e03a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ private static List<ProtocolVersion> customizedProtocols(
851851
} else {
852852
// Use the customized TLS protocols.
853853
candidates =
854-
refactored.toArray(new ProtocolVersion[refactored.size()]);
854+
refactored.toArray(new ProtocolVersion[0]);
855855
}
856856

857857
return getAvailableProtocols(candidates);

src/java.base/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2020, 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
@@ -424,6 +424,6 @@ private static X500Principal[] convertPrincipals(Principal[] principals) {
424424
}
425425
}
426426
}
427-
return list.toArray(new X500Principal[list.size()]);
427+
return list.toArray(new X500Principal[0]);
428428
}
429429
}

0 commit comments

Comments
 (0)