java: last statement in finalize() method should be call to super.finalize()

Change-Id: I1785c6cef1fe7c1990207a76c263cff388cbb7e1
Reviewed-on: https://gerrit.libreoffice.org/12375
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin 2014-11-11 15:35:08 +02:00 committed by Noel Grandin
parent 36ff1527c9
commit b95dcb97de
4 changed files with 7 additions and 4 deletions

View File

@ -51,9 +51,10 @@ public final class JNI_info_holder
private native void finalize( long jni_info_handle ); private native void finalize( long jni_info_handle );
@Override @Override
protected void finalize() protected void finalize() throws Throwable
{ {
finalize( s_jni_info_handle ); finalize( s_jni_info_handle );
super.finalize();
} }
} }

View File

@ -88,10 +88,11 @@ public final class Bug108825_Test extends ComplexTestCase {
private final class Dummy implements XDummy { private final class Dummy implements XDummy {
@Override @Override
protected void finalize() { protected void finalize() throws Throwable {
synchronized (lock) { synchronized (lock) {
++finalizedCount; ++finalizedCount;
} }
super.finalize();
} }
} }

View File

@ -44,8 +44,9 @@ public final class WeakReference_Test {
} }
@Override @Override
protected void finalize() { protected void finalize() throws Throwable {
adapter.dispose(); adapter.dispose();
super.finalize();
} }
private static final class Adapter implements XAdapter { private static final class Adapter implements XAdapter {

View File

@ -37,8 +37,8 @@ class MyUnoObject implements com.sun.star.uno.XInterface
@Override @Override
protected void finalize() throws Throwable { protected void finalize() throws Throwable {
super.finalize();
System.out.println( "finalizer called" ); System.out.println( "finalizer called" );
super.finalize();
} }
public static void main( String args[] ) throws InterruptedException public static void main( String args[] ) throws InterruptedException