On Sat, 27 Jun 2026 11:28:34 GMT, Mikhail Yankelevich 
<[email protected]> wrote:

>> Introducing Instant returning methods in the public api to similar to 
>> X509Certificate:
>> * X509CRL: getThisUpdate, getNextUpdate
>> * X509CRLEntry: getRevocationDate
>> 
>> Please note, this pr only changes public api with internals changed as a 
>> separate pr due to overlap with other implementations in the queue for a 
>> `Date` to `Instant` change
>> 
>> ---------
>> - [X] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Mikhail Yankelevich has refreshed the contents of this pull request, and 
> previous commits have been removed. The incremental views will show 
> differences compared to the previous content of the PR. The pull request 
> contains one new commit since the last revision:
> 
>   JDK-8377980: Add methods returning Instant instead of Date to X509CRL and 
> X509CRLEntry

src/java.base/share/classes/java/security/cert/X509CRL.java line 352:

> 350: 
> 351:     /**
> 352:      * Gets the {@code thisUpdate} instant from the CRL.

Reword as: "Gets the {@code thisUpdate} date as an {@code Instant} from the CRL.

This makes the wording more consistent with the new `X509Certificate` methods.

src/java.base/share/classes/java/security/cert/X509CRL.java line 361:

> 359:      * @implSpec
> 360:      * The default implementation calls {@code getThisUpdate()}
> 361:      * and returns the output as an {@code Instant} value.

s/output/date/
remove "value" (not needed).

src/java.base/share/classes/java/security/cert/X509CRL.java line 363:

> 361:      * and returns the output as an {@code Instant} value.
> 362:      *
> 363:      * @return the {@code thisUpdate} instant from the CRL.

s/instant/date/

(to be consistent with RFC 5280 which calls this a date).

src/java.base/share/classes/java/security/cert/X509CRL.java line 367:

> 365:     public Instant getThisUpdateInstant() {
> 366:         final Date date = getThisUpdate();
> 367:         return date == null ? null : date.toInstant();

This should never return null. Just return `date.toInstant()`. If NPE is 
thrown, it is a bug in the implementation.

src/java.base/share/classes/java/security/cert/X509CRL.java line 379:

> 377: 
> 378:     /**
> 379:      * Gets the {@code nextUpdate} instant from the CRL.

Reword as: "Gets the {@code nextUpdate} date as an {@code Instant} from the CRL.

This makes the wording more consistent with the new X509Certificate methods.

src/java.base/share/classes/java/security/cert/X509CRL.java line 386:

> 384:      * @implSpec
> 385:      * The default implementation calls {@code getNextUpdate()}
> 386:      * and returns the output as an {@code Instant} value.

s/output/date/
remove "value" (not needed).

src/java.base/share/classes/java/security/cert/X509CRL.java line 388:

> 386:      * and returns the output as an {@code Instant} value.
> 387:      *
> 388:      * @return the {@code nextUpdate} instant from the CRL, or null if

s/instant/date/ 

(to be consistent with RFC 5280 which calls this a date).

src/java.base/share/classes/java/security/cert/X509CRLEntry.java line 161:

> 159: 
> 160:     /**
> 161:      * Gets the revocation instant from this X509CRLEntry,

Reword as: "Gets the revocation date as an {@code Instant} from this 
X509CRLEntry.

src/java.base/share/classes/java/security/cert/X509CRLEntry.java line 169:

> 167:      * @implSpec
> 168:      * The default implementation calls {@code getRevocationDate()}
> 169:      * and returns the output as an {@code Instant} value.

s/output/date/
remove "value" (not needed).

src/java.base/share/classes/java/security/cert/X509CRLEntry.java line 171:

> 169:      * and returns the output as an {@code Instant} value.
> 170:      *
> 171:      * @return the revocation instant.

s/instant/date/

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31700#discussion_r3513710456
PR Review Comment: https://git.openjdk.org/jdk/pull/31700#discussion_r3513718431
PR Review Comment: https://git.openjdk.org/jdk/pull/31700#discussion_r3513776935
PR Review Comment: https://git.openjdk.org/jdk/pull/31700#discussion_r3513756028
PR Review Comment: https://git.openjdk.org/jdk/pull/31700#discussion_r3513766654
PR Review Comment: https://git.openjdk.org/jdk/pull/31700#discussion_r3513764289
PR Review Comment: https://git.openjdk.org/jdk/pull/31700#discussion_r3513775741
PR Review Comment: https://git.openjdk.org/jdk/pull/31700#discussion_r3513823422
PR Review Comment: https://git.openjdk.org/jdk/pull/31700#discussion_r3513827442
PR Review Comment: https://git.openjdk.org/jdk/pull/31700#discussion_r3513829629

Reply via email to