diff options
Diffstat (limited to 'src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp')
| -rw-r--r-- | src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp b/src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp index ed59d51..cef4bfe 100644 --- a/src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp +++ b/src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp @@ -51,4 +51,9 @@ void init_classes(JNIEnv *env, std::string lib_name) { jclass local_illegal_state_exception_class = env->FindClass("java/lang/IllegalStateException"); illegal_state_exception_class = (jclass) env->NewGlobalRef(local_illegal_state_exception_class); +} + +void throw_new(JNIEnv *env, const std::string& klass, const std::string& message) { + jclass clazz = env->FindClass(klass.c_str()); + env->ThrowNew(clazz, message.c_str()); }
\ No newline at end of file |
