瀏覽代碼

HPCC-22837 Java class names not translated

Also fix some spurious warnigns regarding unchecked calls when CHECK_JNI mode
set.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 5 年之前
父節點
當前提交
3d9303405c
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      plugins/javaembed/javaembed.cpp

+ 5 - 0
plugins/javaembed/javaembed.cpp

@@ -155,6 +155,7 @@ public:
             jobject frame = JNIEnv::GetObjectArrayElement(frames, i);
             checkUnexpectedException();
             msg = (jstring) JNIEnv::CallObjectMethod(frame, frame_toString);
+            checkUnexpectedException();
             text = JNIEnv::GetStringUTFChars(msg, 0);
             DBGLOG("javaembed: exception: stack: %s", text);
             JNIEnv::ReleaseStringUTFChars(msg, text);
@@ -163,6 +164,7 @@ public:
             JNIEnv::DeleteLocalRef(frame);
         }
         jthrowable cause = (jthrowable) JNIEnv::CallObjectMethod(exception, throwable_getCause);
+        checkUnexpectedException();
         if (cause && cause != exception)
         {
             DBGLOG("javaembed: exception: Caused by:");
@@ -4268,6 +4270,9 @@ protected:
 
     jclass loadClass(const char *className)
     {
+        StringBuffer uclassname(className);
+        uclassname.replace('/', '.');
+        className=uclassname.str();
         JNIenv->ExceptionClear();
         jmethodID loadClassMethod = JNIenv->GetMethodID(JNIenv->GetObjectClass(classLoader), "loadClass","(Ljava/lang/String;)Ljava/lang/Class;");
         jstring classNameString = JNIenv->NewStringUTF(className);