Exemple

protected void finalize() throws Throwable {
System.out.println("Pas d'appel à super.finalize()"); //$NON-NLS-1$
}

public static void main(String[] args) {
SuperFinalize_Example sf = new SuperFinalize_Example();
sf = null;
Runtime.getRuntime().gc();
}

Solution
Insérez l'appel à super.finalize() comme dernière instruction de la méthode finalize().

protected void finalize() throws Throwable {
try {
System.out.println("Appel à super.finalize()"); //$NON-NLS-1$
} finally {
super .finalize();
}
}

public static void main(String[] args) {
SuperFinalize_Example sf = new SuperFinalize_Example();
sf = null;
Runtime.getRuntime().gc();
}