* Call empty constructor * @param env if supplied * @return jobject that is a global reference. */
| 83 | * @return jobject that is a global reference. |
| 84 | */ |
| 85 | JNIEXPORT |
| 86 | jobject newInstance(JNIEnv *env) { |
| 87 | std::string instanceName = "(L" + name_ + ";)V"; |
| 88 | JNIEnv *lenv = env; |
| 89 | |
| 90 | ThrowIf(lenv); |
| 91 | |
| 92 | auto rezobj = lenv->NewObject(class_ref_, cnstrctr); |
| 93 | |
| 94 | ThrowIf(lenv); |
| 95 | |
| 96 | return lenv->NewGlobalRef(rezobj); |
| 97 | } |
| 98 | |
| 99 | jmethodID getClassMethod(JNIEnv *env, const std::string &methodName, const std::string &type) { |
| 100 | jmethodID mid = env->GetMethodID(class_ref_, methodName.c_str(), type.c_str()); |
no test coverage detected