summaryrefslogtreecommitdiffstats
path: root/java/src/jni/exceptionImp.c
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-03-04 22:06:47 (GMT)
committerGitHub <noreply@github.com>2021-03-04 22:06:47 (GMT)
commit583e9d5c323996ffdcf9534302e865d30f871da4 (patch)
tree9b1188a9b1784b488aa105748505aeba9f405177 /java/src/jni/exceptionImp.c
parent7b23ce1686cf3383bb8666f133cf5fa4f6282096 (diff)
downloadhdf5-583e9d5c323996ffdcf9534302e865d30f871da4.zip
hdf5-583e9d5c323996ffdcf9534302e865d30f871da4.tar.gz
hdf5-583e9d5c323996ffdcf9534302e865d30f871da4.tar.bz2
1 10 Merges from develop (#424)
* HDFFV-10865 - merge from dev, HDFArray perf fix. * Remove duplicate setting * Whitespace changes after clang format * Undo version 11 clang format changes * Merge CMake changes from develop * test testing script merge from develop * Update supported platforms * PR#3 merge from develop * Merge gcc 10 diagnostics option from develop * Merge #318 OSX changes from develop * Merge small changes from develop * Minor non-space formatting changes * #386 copyright corrections for java folder * Merges from develop #358 patches from vtk #361 fix header guard spelling * Merge updates #358 patches from vtk #361 fix header guard spelling * format fix * Fix missing underscore and make H5public.h closer to dev * Merges from develop #340 clang -Wformat-security warnings #360 Fixed uninitialized warnings header guard underscore cleanup JNI cleanup * format alignment * Add missing test ref file
Diffstat (limited to 'java/src/jni/exceptionImp.c')
-rw-r--r--java/src/jni/exceptionImp.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c
index e62caee..12ef0a1 100644
--- a/java/src/jni/exceptionImp.c
+++ b/java/src/jni/exceptionImp.c
@@ -262,12 +262,25 @@ done:
* exception.
*/
jboolean
-h5outOfMemory(JNIEnv *env, const char *functName)
+h5outOfMemory(JNIEnv *env, const char *message)
{
- return H5JNIErrorClass(env, functName, "java/lang/OutOfMemoryError");
+ return H5JNIErrorClass(env, message, "java/lang/OutOfMemoryError");
} /* end h5outOfMemory() */
/*
+ * Create and throw an 'AssertionError'
+ *
+ * Note: This routine never returns from the 'throw',
+ * and the Java native method immediately raises the
+ * exception.
+ */
+jboolean
+h5assertion(JNIEnv *env, const char *message)
+{
+ return H5JNIErrorClass(env, message, "java/lang/AssertionError");
+} /* end h5assertion() */
+
+/*
* A fatal error in a JNI call
* Create and throw an 'InternalError'
*
@@ -276,9 +289,9 @@ h5outOfMemory(JNIEnv *env, const char *functName)
* exception.
*/
jboolean
-h5JNIFatalError(JNIEnv *env, const char *functName)
+h5JNIFatalError(JNIEnv *env, const char *message)
{
- return H5JNIErrorClass(env, functName, "java/lang/InternalError");
+ return H5JNIErrorClass(env, message, "java/lang/InternalError");
} /* end h5JNIFatalError() */
/*
@@ -290,9 +303,9 @@ h5JNIFatalError(JNIEnv *env, const char *functName)
* exception.
*/
jboolean
-h5nullArgument(JNIEnv *env, const char *functName)
+h5nullArgument(JNIEnv *env, const char *message)
{
- return H5JNIErrorClass(env, functName, "java/lang/NullPointerException");
+ return H5JNIErrorClass(env, message, "java/lang/NullPointerException");
} /* end h5nullArgument() */
/*
@@ -304,9 +317,9 @@ h5nullArgument(JNIEnv *env, const char *functName)
* exception.
*/
jboolean
-h5badArgument(JNIEnv *env, const char *functName)
+h5badArgument(JNIEnv *env, const char *message)
{
- return H5JNIErrorClass(env, functName, "java/lang/IllegalArgumentException");
+ return H5JNIErrorClass(env, message, "java/lang/IllegalArgumentException");
} /* end h5badArgument() */
/*
@@ -318,9 +331,9 @@ h5badArgument(JNIEnv *env, const char *functName)
* exception.
*/
jboolean
-h5unimplemented(JNIEnv *env, const char *functName)
+h5unimplemented(JNIEnv *env, const char *message)
{
- return H5JNIErrorClass(env, functName, "java/lang/UnsupportedOperationException");
+ return H5JNIErrorClass(env, message, "java/lang/UnsupportedOperationException");
} /* end h5unimplemented() */
/* h5raiseException(). This routine is called to generate