RFR: 8284490: Remove finalizer method in java.security.jgss [v8]

Weijun Wang weijun at openjdk.java.net
Tue Apr 26 02:08:01 UTC 2022


On Mon, 25 Apr 2022 06:07:00 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 pull request now contains 10 commits:
> 
>  - Merge and resovle merge conflict
>  - change the calling order in dispose()
>  - More code cleanup
>  - re-org the code per feedback
>  - Update to set context method
>  - add test cases
>  - Merge
>  - Update copyright year
>  - the object reference issue for Cleaner
>  - 8284490: Remove finalizer method in java.security.jgss

The latest source change is OK, but I'll look more into it tomorrow.

The test needs some enhancement. Or I can consider contributing one. Sorry I'll be a little busy this week.

src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java line 54:

> 52:     private final Cleaner.Cleanable cleanable;
> 53: 
> 54:     long pName = 0; // Pointer to the gss_name_t structure

Can this be final?

test/jdk/sun/security/jgss/GssContextCleanup.java line 61:

> 59:         if (whm.size() > 0) {
> 60:             throw new RuntimeException("GSSContext object is not released");
> 61:         }

I think it's necessary to check the debug message to make sure "[GSSLibStub_deleteContext]" is seen. This test should have already succeeded before your latest update to `NativeGSSContext`.

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

PR: https://git.openjdk.java.net/jdk/pull/8136



More information about the security-dev mailing list