On Thu, 27 Aug 2026 05:23:19 GMT, Valerie Peng <[email protected]> wrote:

>> This PR removes the finalize() methods from the SASL modules and replace 
>> them with Cleaner. Also did some minor refactoring so the sensitive info is 
>> only kept wherever necessary.
>> 
>> I am still working on a regression test for the GssKrb5 classes, just want 
>> to get the source changes out while I work on it so there is more time for 
>> review.
>> 
>> Thanks in advance for the review~
>> 
>> ---------
>> - [X] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Valerie Peng has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   removed the post-disposal check as the Cleanable.clean() guarantees the 
> action runs at most once.

src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java
 line 58:

> 56:                 ()->{
> 57:                     try {
> 58:                         ctx.dispose();

FWIW, the finalizer would also set `ctx` to null. That's not strictly 
necessary, IMO, and I'm not sure it could be done with the current usage of a 
lambda as the cleaning action.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32551#discussion_r3899548914

Reply via email to