stoc/source/javavm/javavm.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 75c21f5a9298b8fa6ea6e8b6ae9f6bd59c442b36
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Wed Feb 5 17:34:10 2020 +0100
Commit:     Stephan Bergmann <sberg...@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 <sberg...@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));
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to