Due to my laziness and lameness my previous post wasn't as convincing as it should have been, so I'm going to try again.
Take this code:
class A { public static void main(String[] args) { A obj = new B(); obj.finalize(); obj = null; System.gc(); System.runFinalization(); } protected void finalize() { System.out.println("A.finalize"); }}class B extends A { private void fin_lize() { System.out.println("B.finalize"); }}
Compile this and patch B.class to replace fin_lize with finalize.
fin_lize
finalize
What is the expected output of this program? In my opinion it is:
A.finalizeA.finalize
This is also the output that both JDK 1.1 and IKVM.NET give. However, on JDK 1.5 and up the output is:
A.finalizeB.finalize
This did not change in the 7u45 update.
To me the above is already enough to obviously demonstrate the problem, but since I'm apparently somewhat atypical I'm going to try to explain a bit more carefully.
I hope I've done a better job now of making clear way the 7u45 update is bogus, the JVMS spec change is wrong and that finalization still needs to be fixed.
Powered by: newtelligence dasBlog 2.3.12105.0
© Copyright 2021, Jeroen Frijters
E-mail