Changeset 33934


Ignore:
Timestamp:
2020-02-16T17:34:29+13:00 (4 years ago)
Author:
davidb
Message:

Removal of static code block calling ancient/deprecated static runFinalizers method; See comment in file for more details. Leaving it's use of finalize(), however this is also considered questionable practice. If needed, a clearer solution might be to be things on addShutdownHook() A could of useful pages on this are: https://stackoverflow.com/questions/20829228/shutdown-hook-vs-finalizer-method https://stackoverflow.com/questions/26271464/implementation-of-addshutdownhook

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmFile.java

    r30401 r33934  
    158158     * XXX: Unfortunately, anybody else can turn this off again: it
    159159     * would be nice if there was a way to avoid this. */
     160
     161     // ****
     162     // Greenstone modifiction: runFinalizersOnExit() has been deprecated
     163     // since Java 1.2, and was finally removed in Java 1.9
     164     // The method was always "inherently unsafe" (Sun developers)
     165     // "Calling this method may result in finalizers being called on live objects
     166     //  while other threads are concurrently manipulating those objects,
     167     //  resulting in erratic behavior or deadlock.
     168     //
     169     // => Decision made to remove the static code block that calls this
     170
     171     /*
    160172    static {
    161173    System.runFinalizersOnExit(true);
    162174    }
    163 
     175    */
    164176
    165177
Note: See TracChangeset for help on using the changeset viewer.