Kaydet (Commit) b95dcb97 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

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

Change-Id: I1785c6cef1fe7c1990207a76c263cff388cbb7e1
Reviewed-on: https://gerrit.libreoffice.org/12375Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 36ff1527
...@@ -51,9 +51,10 @@ public final class JNI_info_holder ...@@ -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();
} }
} }
......
...@@ -88,10 +88,11 @@ public final class Bug108825_Test extends ComplexTestCase { ...@@ -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();
} }
} }
......
...@@ -44,8 +44,9 @@ public final class WeakReference_Test { ...@@ -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 {
......
...@@ -37,8 +37,8 @@ class MyUnoObject implements com.sun.star.uno.XInterface ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment