RFR: 8284490: Remove finalizer method in java.security.jgss [v4]
Daniel Fuchs
dfuchs at openjdk.java.net
Mon Apr 11 14:27:39 UTC 2022
On Sat, 9 Apr 2022 06:19:12 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:
>> Please review the update to remove finalizer method in the java.security.jgss module. It is one of the efforts to clean up the use of finalizer method in JDK.
>
> Xue-Lei Andrew Fan has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>
> - add test cases
> - Merge
> - Update copyright year
> - the object reference issue for Cleaner
> - 8284490: Remove finalizer method in java.security.jgss
src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java line 188:
> 186: printableType);
> 187:
> 188: cleanable = Krb5Util.cleaner.register(this, disposerFor(stub, pName));
I wonder if this line should be moved just after line 159?
src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java line 307:
> 305: }
> 306: };
> 307: }
There seem to be a potential optimization here, since you don't even need to create a Cleanable in the case where stub is null or pName is 0? Same for earlier duplication of the same code.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8136
More information about the security-dev
mailing list