summaryrefslogtreecommitdiffstats
path: root/java/src/jni/exceptionImp.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-08-06 16:00:48 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-08-06 16:00:48 (GMT)
commitfe7aaff8cc4b9675fc64995481f9ee8a26ea09e4 (patch)
treeb18daae9c259e2c71b3dbeab3527e46319783d60 /java/src/jni/exceptionImp.c
parent51d31c5ff89f4cf9f1d29d994e5ab6594c3dbd1d (diff)
parent6e4c036d5dc476396428f4b044e23043a80e8df7 (diff)
downloadhdf5-fe7aaff8cc4b9675fc64995481f9ee8a26ea09e4.zip
hdf5-fe7aaff8cc4b9675fc64995481f9ee8a26ea09e4.tar.gz
hdf5-fe7aaff8cc4b9675fc64995481f9ee8a26ea09e4.tar.bz2
Merge pull request #1175 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '6e4c036d5dc476396428f4b044e23043a80e8df7': HDFFV-10544 Correct var name HDFFV-10544 remove native from class function HDFFV-10544 correct typo HDFFV-10544 add release note HDFFV-10544 add class name to error text HDFFV-10544 exception variable as local class Improve error handling of exceptions
Diffstat (limited to 'java/src/jni/exceptionImp.c')
-rw-r--r--java/src/jni/exceptionImp.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c
index afad5d5..69f8dde 100644
--- a/java/src/jni/exceptionImp.c
+++ b/java/src/jni/exceptionImp.c
@@ -83,9 +83,14 @@ typedef struct H5E_num_t {
} \
jm = ENVPTR->GetMethodID(ENVPAR jc, "<init>", "(Ljava/lang/String;)V"); \
if (jm == NULL) { \
+ printf("FATAL ERROR: GetMethodID failed\n"); \
return JNI_FALSE; \
} \
ex = ENVPTR->NewObjectA (ENVPAR jc, jm, (jvalue*)(args)); \
+ if (ex == NULL) { \
+ printf("FATAL ERROR: %s: Creation failed\n", (className)); \
+ return JNI_FALSE; \
+ } \
if (ENVPTR->Throw(ENVPAR (jthrowable)ex) < 0) { \
printf("FATAL ERROR: %s: Throw failed\n", (className)); \
return JNI_FALSE; \
@@ -174,13 +179,13 @@ Java_hdf_hdf5lib_exceptions_HDF5LibraryException_printStackTrace0
/*
* Class: hdf_hdf5lib_exceptions_HDFLibraryException
- * Method: getMajorErrorNumber
+ * Method: _getMajorErrorNumber
* Signature: ()J
*
* Extract the HDF-5 major error number from the HDF-5 error stack.
*/
JNIEXPORT jlong JNICALL
-Java_hdf_hdf5lib_exceptions_HDF5LibraryException_getMajorErrorNumber
+Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMajorErrorNumber
(JNIEnv *env, jobject obj)
{
H5E_num_t err_nums;
@@ -190,17 +195,17 @@ Java_hdf_hdf5lib_exceptions_HDF5LibraryException_getMajorErrorNumber
H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &err_nums);
return err_nums.maj_num;
-} /* end Java_hdf_hdf5lib_exceptions_HDF5LibraryException_getMajorErrorNumber() */
+} /* end Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMajorErrorNumber() */
/*
* Class: hdf_hdf5lib_exceptions_HDFLibraryException
- * Method: getMinorErrorNumber
+ * Method: _getMinorErrorNumber
* Signature: ()J
*
* Extract the HDF-5 minor error number from the HDF-5 error stack.
*/
JNIEXPORT jlong JNICALL
-Java_hdf_hdf5lib_exceptions_HDF5LibraryException_getMinorErrorNumber
+Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMinorErrorNumber
(JNIEnv *env, jobject obj)
{
H5E_num_t err_nums;
@@ -210,7 +215,7 @@ Java_hdf_hdf5lib_exceptions_HDF5LibraryException_getMinorErrorNumber
H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &err_nums);
return err_nums.min_num;
-} /* end Java_hdf_hdf5lib_exceptions_HDF5LibraryException_getMinorErrorNumber() */
+} /* end Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMinorErrorNumber() */
/*
* Routine to raise particular Java exceptions from C