[Libreoffice-commits] core.git: bridges/source bridges/test jurt/test odk/examples

Noel Grandin noel at peralex.com
Wed Nov 12 00:02:49 PST 2014


 bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java |    3 ++-
 bridges/test/java_remote/Bug108825_Test.java                                  |    3 ++-
 jurt/test/com/sun/star/uno/WeakReference_Test.java                            |    3 ++-
 odk/examples/DevelopersGuide/ProfUNO/Lifetime/MyUnoObject.java                |    2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit b95dcb97de986a1e7dd7f7fda258e559f8d60b1c
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Nov 11 15:35:08 2014 +0200

    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 at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java
index 1c2b691..e129f10 100644
--- a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java
+++ b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java
@@ -51,9 +51,10 @@ public final class JNI_info_holder
     private native void finalize( long jni_info_handle );
 
     @Override
-    protected void finalize()
+    protected void finalize() throws Throwable
     {
         finalize( s_jni_info_handle );
+        super.finalize();
     }
 }
 
diff --git a/bridges/test/java_remote/Bug108825_Test.java b/bridges/test/java_remote/Bug108825_Test.java
index e4343c5..182ae35 100644
--- a/bridges/test/java_remote/Bug108825_Test.java
+++ b/bridges/test/java_remote/Bug108825_Test.java
@@ -88,10 +88,11 @@ public final class Bug108825_Test extends ComplexTestCase {
 
         private final class Dummy implements XDummy {
             @Override
-            protected void finalize() {
+            protected void finalize() throws Throwable {
                 synchronized (lock) {
                     ++finalizedCount;
                 }
+                super.finalize();
             }
         }
 
diff --git a/jurt/test/com/sun/star/uno/WeakReference_Test.java b/jurt/test/com/sun/star/uno/WeakReference_Test.java
index a990f44..73a847d 100644
--- a/jurt/test/com/sun/star/uno/WeakReference_Test.java
+++ b/jurt/test/com/sun/star/uno/WeakReference_Test.java
@@ -44,8 +44,9 @@ public final class WeakReference_Test {
         }
 
         @Override
-        protected void finalize() {
+        protected void finalize() throws Throwable {
             adapter.dispose();
+            super.finalize();
         }
 
         private static final class Adapter implements XAdapter {
diff --git a/odk/examples/DevelopersGuide/ProfUNO/Lifetime/MyUnoObject.java b/odk/examples/DevelopersGuide/ProfUNO/Lifetime/MyUnoObject.java
index 1d73270..080504c 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/Lifetime/MyUnoObject.java
+++ b/odk/examples/DevelopersGuide/ProfUNO/Lifetime/MyUnoObject.java
@@ -37,8 +37,8 @@ class MyUnoObject implements com.sun.star.uno.XInterface
 
     @Override
     protected void finalize() throws Throwable {
-        super.finalize();
         System.out.println( "finalizer called" );
+        super.finalize();
     }
 
     public static void main( String args[] ) throws InterruptedException


More information about the Libreoffice-commits mailing list