From 345b214c37d1f645dd0e6e084358f8ca81d9ed66 Mon Sep 17 00:00:00 2001 From: Hossein Date: Thu, 31 Aug 2023 11:02:09 +0200 Subject: tdf#149069 Revert "ridljar: check UnoClassLoader used for NativeLibraryLoader" This reverts commit 97b61ea3297e04e64aab1e1a4ec50202e9f86fff. It checked that the NativeLibraryLoader is an instance of the class com.sun.star.lib.unoloader.UnoClassLoader. If this is not the case, a warning was displayed. This was for java_uno bridge to work. On the other hand, as the comment in the code implies, "not a problem if this is using Java remote bridge or (in a) unit test". But, in the code there was no check for that. As a result, this warning is displayed in many places like the simple examples that want to connect to the LibreOffice process via Java API. Change-Id: I056ed372ad071573051024a63e51afd6b4425ce5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156302 Reviewed-by: Michael Stahl Tested-by: Jenkins Reviewed-by: Hossein --- ridljar/com/sun/star/lib/util/NativeLibraryLoader.java | 9 --------- 1 file changed, 9 deletions(-) (limited to 'ridljar') diff --git a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java index d255a71ea5d1..eb5c6af34e90 100644 --- a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java +++ b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java @@ -21,7 +21,6 @@ package com.sun.star.lib.util; import java.io.File; import java.net.URL; import java.net.URLClassLoader; -import com.sun.star.lib.unoloader.UnoClassLoader; /** * Helper functions to locate and load native files. @@ -36,14 +35,6 @@ import com.sun.star.lib.unoloader.UnoClassLoader; * algorithm.

*/ public final class NativeLibraryLoader { - static { - // if it's some other class loader, then resolving the symbol - // Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call in - // java_uno will not work and result in UnsatisfiedLinkError - if (!(NativeLibraryLoader.class.getClassLoader() instanceof com.sun.star.lib.unoloader.UnoClassLoader)) { - System.err.println("warning: com.sun.star.lib.util.NativeLibraryLoader must be loaded by com.sun.star.lib.unoloader.UnoClassLoader for java_uno bridge to work (not a problem if this is using Java remote bridge or unit test)"); - } - } /** * Load a system library, using a given class loader to locate the library. * -- cgit