Closed rleigh-codelibre closed 4 years ago
This PR commented out the use of System.runFinalizersOnExit(true);
in order to remove three deprecation warnings. However, this is likely inappropriate given that it's required for the DO_TIMING
logic in the finalisers.
Removing the use of System.runFinalizersOnExit(true);
would be desirable though. Is there any alternative way the profiling could report back the information. For example, would reporting each result separately to the logger, which could be aggregated once the profiling was complete, be an acceptable alternative?
Maybe just before exit can make sure no references to these objects still exist (set to null
or whatever) then,
System.gc();
System.runFinalization();
which is little less horrifying but not actually yet deprecated.
As DO_TIMING = false
the finalize requirement is only needed in the case that one is enabled in source code for manual profiling.
So perhaps just leave equivalently the runFinalizersOnExit line commented out (with a comment to turn on with DO_TIMING) right below inside a static{ }
block?
I'm not doing work on this going forward. If anyone wants to pick this up, please feel free to do so.
From https://github.com/rleigh-codelibre/jai-tidy/commit/207963ba0ab525259ac0e31dd8b21f86bd4fcb2coriginating with https://github.com/openmicroscopy/bioformats/commit/297b1e61a0c27a88124fa3206cf27589936e9c99
/cc @melissalinkert @sbesson @jburel