[Libreoffice-commits] core.git: stoc/source
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Thu Feb 6 10:17:14 UTC 2020
stoc/source/javavm/javavm.cxx | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 75c21f5a9298b8fa6ea6e8b6ae9f6bd59c442b36
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Feb 5 17:34:10 2020 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Feb 6 11:16:42 2020 +0100
Be more verbose about JNI errors at least with --enable-dbgutil
("The Java Native Interface" by Sheng Liang, Addison-Wesley 1999, states on
page 211: "This function [ExceptionDescribe] has the side effect of clearing
the pending exception." And since Java 10, the documentation of
ExceptionDescription at <https://docs.oracle.com/javase/10/docs/specs/jni/
functions.html#exceptiondescribe> states that "[t]he pending exception is
cleared as a side-effect of calling this function", even though for Java 8
<https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#
ExceptionDescribe> does not mention that. So assume that calling
ExceptionDescribe always makes calling ExceptionClear superfluous.)
Change-Id: I4f89eb44768d436a224d7027afb5e7a93f092f29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88050
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 84120eaa3c85..7df1fed46c57 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -1582,7 +1582,11 @@ void JavaVirtualMachine::setUpUnoVirtualMachine(JNIEnv * environment) {
}
void JavaVirtualMachine::handleJniException(JNIEnv * environment) {
+#if defined DBG_UTIL
+ environment->ExceptionDescribe();
+#else
environment->ExceptionClear();
+#endif
throw css::uno::RuntimeException(
"JNI exception occurred",
static_cast< cppu::OWeakObject * >(this));
More information about the Libreoffice-commits
mailing list