1) StreamingXXHash32JNI and StreamingXXHash64JNI should not override finalize(), it's bad for GC. Instead, they should use Cleaner.
2) They should support close() for explicit resource release.
3) The close() method should be synchronized to avoid racy free, this is a workaround in the absence of Reference.reachabilityFence().
1)
StreamingXXHash32JNI
andStreamingXXHash64JNI
should not overridefinalize()
, it's bad for GC. Instead, they should use Cleaner. 2) They should support close() for explicit resource release. 3) The close() method should be synchronized to avoid racy free, this is a workaround in the absence ofReference.reachabilityFence()
.