RFR: 8374808: Add an Instance in place of Date for KeyStore and KeyStoreSpi [v2]

Sean Mullan mullan at openjdk.org
Wed Jan 14 21:57:05 UTC 2026


On Wed, 14 Jan 2026 17:19:36 GMT, Mikhail Yankelevich <myankelevich at openjdk.org> wrote:

>> Hi!
>> 
>> This is my proposal to transfer `KeyStore` and `KeyStoreSpi` with internal implementations to use `Instance`s instead of `Date`s. 
>> I would be very grateful for your comments and suggestions.
>> 
>> Thanks!
>> 
>> P.S. this is related to [JDK-8350953](https://bugs.openjdk.org/browse/JDK-8350953)
>
> Mikhail Yankelevich has updated the pull request incrementally with one additional commit since the last revision:
> 
>   DKS tests enhanced

src/java.base/share/classes/java/security/KeyStore.java line 1187:

> 1185:      * Returns the creation date of the entry identified by the given alias.
> 1186:      * <p>
> 1187:      * This method returns a Date, which is mutable and more error-prone.

I think this could be misinterpreted to mean that the KeyStore's internal Date is mutable, when implementations typically should be returning new objects or clones. Suggest something simpler like "It is recommended to use the {@link #getCreationInstant(String)} method instead."

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29140#discussion_r2692193133


More information about the security-dev mailing list