On Tue, 26 Apr 2022 13:38:04 GMT, Xue-Lei Andrew Fan <xue...@openjdk.org> wrote:
>> 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? > > The native code does not update pName. As dispose is public, if pName is set > to zero, I'm not sure if there is compatibility issues if more methods get > called after dispose(). If you are confident with that, I could set pName > to final and update the dispose() impl. I don't think anything is guaranteed after a name is disposed. I see no problem in doing this. ------------- PR: https://git.openjdk.java.net/jdk/pull/8136