On Mon, 13 Apr 2026 09:17:27 GMT, Viktor Klang <[email protected]> wrote:

>> Brent Christian has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   add missed clean() calls, update comments
>
> src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java 
> line 312:
> 
>> 310:             if (context.state != State.OK) { // Should this also 
>> de-register cleaner?
>> 311:                 return;
>> 312:             }
> 
> Everything which transitions the status to non-OK should've already done 
> that, right?

Good point. 
The cleaner should be deregistered in places where `state` is ***set*** != OK, 
but not when we're just checking the state, like here.

I've added a couple that I missed, and have standardized the comment.

Note that we're assuming that once a `CardImpl` instance's `state` becomes != 
OK, it will never be set back to OK.
This seems like a safe assumption.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30683#discussion_r3089969078

Reply via email to