RFR: 8284490: Remove finalizer method in java.security.jgss [v8]
Weijun Wang
weijun at openjdk.java.net
Tue Apr 26 11:57:52 UTC 2022
On Tue, 26 Apr 2022 05:02:51 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:
>> 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?
>
> Did you mean pName? The dispose() method will reset it to zero. 'pName" is used a lot in native implementation. It may be doable to make it final, but it may be more complicated than I could expect. I would like to leave it as it is in this PR.
IMO, there's no need to reset it to zero in `dispose()`. As for the usage in native implementation, if there is really a case that it gets updated, then the cleanable you registered at the beginning will be useless. Isn't that a real problem?
-------------
PR: https://git.openjdk.java.net/jdk/pull/8136
More information about the security-dev
mailing list