From 762c14fde587f2ff4f9b9cdaa6b2232a481edde4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sun, 5 Aug 2018 11:12:39 -0500 Subject: Improve error handling of exceptions --- java/src/jni/exceptionImp.c | 5 +++ java/src/jni/h5aImp.c | 12 ++++--- java/src/jni/h5eImp.c | 8 +++-- java/src/jni/h5lImp.c | 8 +++-- java/src/jni/h5oImp.c | 87 +++++++++++++++++++++++++++------------------ 5 files changed, 77 insertions(+), 43 deletions(-) diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c index afad5d5..ded632d 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, "", "(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: Creation failed\n"); \ + return JNI_FALSE; \ + } \ if (ENVPTR->Throw(ENVPAR (jthrowable)ex) < 0) { \ printf("FATAL ERROR: %s: Throw failed\n", (className)); \ return JNI_FALSE; \ diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index 13f5207..437f25f 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -966,7 +966,7 @@ Java_hdf_hdf5lib_H5_H5Aget_1info_1by_1idx UNPIN_JAVA_STRING(obj_name, aName); if (status < 0) { - h5libraryError(env); + h5libraryError(env); } /* end if */ else { args[0].z = ainfo.corder_valid; @@ -1002,7 +1002,7 @@ Java_hdf_hdf5lib_H5_H5Aget_1info_1by_1name UNPIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName); if (status < 0) { - h5libraryError(env); + h5libraryError(env); } /* end if */ else { args[0].z = ainfo.corder_valid; @@ -1166,8 +1166,12 @@ H5A_iterate_cb constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "", "(ZJIJ)V"); if (constructor != 0) { cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); - - status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data); + if (cb_info_t == NULL) { + printf("FATAL ERROR: Creation failed\n"); + } + else { + status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data); + } } /* end if (constructor != 0) */ } /* end if (cls != 0) */ } /* end if (mid != 0) */ diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c index 24ddcbc..df7e35f 100644 --- a/java/src/jni/h5eImp.c +++ b/java/src/jni/h5eImp.c @@ -508,8 +508,12 @@ H5E_walk_cb constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "", "(JJJILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); if (constructor != 0) { cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); - - status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, nindx, cb_info_t, op_data); + if (cb_info_t == NULL) { + printf("FATAL ERROR: Creation failed\n"); + } + else { + status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, nindx, cb_info_t, op_data); + } } /* end if (constructor != 0) */ } /* end if(cls != 0) */ } /* end if (mid != 0) */ diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c index ac71845..7391490 100644 --- a/java/src/jni/h5lImp.c +++ b/java/src/jni/h5lImp.c @@ -574,8 +574,12 @@ H5L_iterate_cb constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "", "(IZJIJ)V"); if (constructor != 0) { cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); - - status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data); + if (cb_info_t == NULL) { + printf("FATAL ERROR: Creation failed\n"); + } + else { + status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data); + } } /* end if */ } /* end if */ } /* end if */ diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c index 7665c70..b7bcdb6 100644 --- a/java/src/jni/h5oImp.c +++ b/java/src/jni/h5oImp.c @@ -372,41 +372,58 @@ H5O_iterate_cb constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "", "(IIIIJJJJJJ)V"); if (constructor != 0) { hdrinfobuf = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); - - args[0].j = (jlong)info->meta_size.obj.index_size; - args[1].j = (jlong)info->meta_size.obj.heap_size; - // get a reference to the H5_ih_info_t class - cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5_ih_info_t"); - if (cls != 0) { - // get a reference to the constructor; the name is - constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "", "(JJ)V"); - if (constructor != 0) { - ihinfobuf1 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); - args[0].j = (jlong)info->meta_size.attr.index_size; - args[1].j = (jlong)info->meta_size.attr.heap_size; - ihinfobuf2 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); - - args[0].j = (jlong)info->fileno; - args[1].j = (jlong)info->addr; - args[2].i = info->type; - args[3].i = (jint)info->rc; - args[4].j = (jlong)info->num_attrs; - args[5].j = info->atime; - args[6].j = info->mtime; - args[7].j = info->ctime; - args[8].j = info->btime; - args[9].l = hdrinfobuf; - args[10].l = ihinfobuf1; - args[11].l = ihinfobuf2; - // get a reference to the H5O_info_t class - cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5O_info_t"); - if (cls != 0) { - // get a reference to the constructor; the name is - constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V"); - if (constructor != 0) { - cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); - - status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data); + if (ihinfobuf2 == NULL) { + printf("FATAL ERROR: Creation failed\n"); + } + else { + args[0].j = (jlong)info->meta_size.obj.index_size; + args[1].j = (jlong)info->meta_size.obj.heap_size; + // get a reference to the H5_ih_info_t class + cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5_ih_info_t"); + if (cls != 0) { + // get a reference to the constructor; the name is + constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "", "(JJ)V"); + if (constructor != 0) { + ihinfobuf1 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); + if (ihinfobuf1 == NULL) { + printf("FATAL ERROR: Creation failed\n"); + } + else { + args[0].j = (jlong)info->meta_size.attr.index_size; + args[1].j = (jlong)info->meta_size.attr.heap_size; + ihinfobuf2 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); + if (ihinfobuf2 == NULL) { + printf("FATAL ERROR: Creation failed\n"); + } + else { + args[0].j = (jlong)info->fileno; + args[1].j = (jlong)info->addr; + args[2].i = info->type; + args[3].i = (jint)info->rc; + args[4].j = (jlong)info->num_attrs; + args[5].j = info->atime; + args[6].j = info->mtime; + args[7].j = info->ctime; + args[8].j = info->btime; + args[9].l = hdrinfobuf; + args[10].l = ihinfobuf1; + args[11].l = ihinfobuf2; + // get a reference to the H5O_info_t class + cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5O_info_t"); + if (cls != 0) { + // get a reference to the constructor; the name is + constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V"); + if (constructor != 0) { + cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); + if (cb_info_t == NULL) { + printf("FATAL ERROR: Creation failed\n"); + } + else { + status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data); + } + } + } + } } } } -- cgit v0.12 From ca7d4f85a5054fc406e62ccb009169e139f0105c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Aug 2018 09:15:08 -0500 Subject: HDFFV-10544 exception variable as local class --- .../hdf5lib/exceptions/HDF5LibraryException.java | 23 +++++++++++++++++----- java/src/jni/exceptionImp.c | 12 +++++------ java/src/jni/exceptionImp.h | 8 ++++---- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java index 5ae977d..ad5c2ab 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java @@ -30,6 +30,9 @@ import hdf.hdf5lib.HDF5Constants; @SuppressWarnings("serial") public class HDF5LibraryException extends HDF5Exception { + private final long majorErrorNumber; + private final long minorErrorNumber; + /** * Constructs an HDF5LibraryException with no specified detail * message. @@ -44,9 +47,10 @@ public class HDF5LibraryException extends HDF5Exception { } catch (Exception e) { } - ; - detailMessage = getMinorError(getMinorErrorNumber()); + this.majorErrorNumber = _getMajorErrorNumber(); + this.minorErrorNumber = _getMinorErrorNumber(); + detailMessage = getMinorError(minorErrorNumber()); } /** @@ -65,7 +69,8 @@ public class HDF5LibraryException extends HDF5Exception { } catch (Exception e) { } - ; + this.majorErrorNumber = _getMajorErrorNumber(); + this.minorErrorNumber = _getMinorErrorNumber(); } /** @@ -74,7 +79,11 @@ public class HDF5LibraryException extends HDF5Exception { * * @return the major error number */ - public native long getMajorErrorNumber(); + public native long getMajorErrorNumber() + { + return majorErrorNumber; + } + private native long _getMajorErrorNumber(); /** * Get the minor error number of the first error on the HDF5 library error @@ -82,7 +91,11 @@ public class HDF5LibraryException extends HDF5Exception { * * @return the minor error number */ - public native long getMinorErrorNumber(); + public native long getMinorErrorNumber() + { + return minorErrorNumber; + } + private native long _getMinorErrorNumber(); /** * Return a error message for the minor error number. diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c index ded632d..e122eb2 100644 --- a/java/src/jni/exceptionImp.c +++ b/java/src/jni/exceptionImp.c @@ -179,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; @@ -195,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; @@ -215,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 diff --git a/java/src/jni/exceptionImp.h b/java/src/jni/exceptionImp.h index 423e537..5873202 100644 --- a/java/src/jni/exceptionImp.h +++ b/java/src/jni/exceptionImp.h @@ -55,20 +55,20 @@ Java_hdf_hdf5lib_exceptions_HDF5LibraryException_printStackTrace0 /* * Class: hdf_hdf5lib_exceptions_HDFLibraryException - * Method: getMajorErrorNumber + * Method: _getMajorErrorNumber * Signature: ()J */ JNIEXPORT jlong JNICALL -Java_hdf_hdf5lib_exceptions_HDF5LibraryException_getMajorErrorNumber +Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMajorErrorNumber (JNIEnv *env, jobject obj); /* * Class: hdf_hdf5lib_exceptions_HDFLibraryException - * Method: getMinorErrorNumber + * Method: _getMinorErrorNumber * Signature: ()J */ JNIEXPORT jlong JNICALL -Java_hdf_hdf5lib_exceptions_HDF5LibraryException_getMinorErrorNumber +Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMinorErrorNumber (JNIEnv *env, jobject obj); #ifdef __cplusplus -- cgit v0.12 From 2f4832fe09e85d8ef083c50caa9b50913cdb5400 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Aug 2018 09:23:21 -0500 Subject: HDFFV-10544 add class name to error text --- java/src/jni/exceptionImp.c | 2 +- java/src/jni/h5aImp.c | 2 +- java/src/jni/h5eImp.c | 2 +- java/src/jni/h5lImp.c | 2 +- java/src/jni/h5oImp.c | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c index e122eb2..69f8dde 100644 --- a/java/src/jni/exceptionImp.c +++ b/java/src/jni/exceptionImp.c @@ -88,7 +88,7 @@ typedef struct H5E_num_t { } \ ex = ENVPTR->NewObjectA (ENVPAR jc, jm, (jvalue*)(args)); \ if (ex == NULL) { \ - printf("FATAL ERROR: Creation failed\n"); \ + printf("FATAL ERROR: %s: Creation failed\n", (className)); \ return JNI_FALSE; \ } \ if (ENVPTR->Throw(ENVPAR (jthrowable)ex) < 0) { \ diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index 437f25f..c0dc182 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -1167,7 +1167,7 @@ H5A_iterate_cb if (constructor != 0) { cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); if (cb_info_t == NULL) { - printf("FATAL ERROR: Creation failed\n"); + printf("FATAL ERROR: hdf/hdf5lib/structs/H5A_info_t: Creation failed\n"); } else { status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data); diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c index df7e35f..10a02b0 100644 --- a/java/src/jni/h5eImp.c +++ b/java/src/jni/h5eImp.c @@ -509,7 +509,7 @@ H5E_walk_cb if (constructor != 0) { cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); if (cb_info_t == NULL) { - printf("FATAL ERROR: Creation failed\n"); + printf("FATAL ERROR: hdf/hdf5lib/structs/H5E_error2_t: Creation failed\n"); } else { status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, nindx, cb_info_t, op_data); diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c index 7391490..f1734fd 100644 --- a/java/src/jni/h5lImp.c +++ b/java/src/jni/h5lImp.c @@ -575,7 +575,7 @@ H5L_iterate_cb if (constructor != 0) { cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); if (cb_info_t == NULL) { - printf("FATAL ERROR: Creation failed\n"); + printf("FATAL ERROR: hdf/hdf5lib/structs/H5L_info_t: Creation failed\n"); } else { status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data); diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c index b7bcdb6..3b4c068 100644 --- a/java/src/jni/h5oImp.c +++ b/java/src/jni/h5oImp.c @@ -373,7 +373,7 @@ H5O_iterate_cb if (constructor != 0) { hdrinfobuf = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); if (ihinfobuf2 == NULL) { - printf("FATAL ERROR: Creation failed\n"); + printf("FATAL ERROR: hdf/hdf5lib/structs/H5O_hdr_info_t: Creation failed\n"); } else { args[0].j = (jlong)info->meta_size.obj.index_size; @@ -386,14 +386,14 @@ H5O_iterate_cb if (constructor != 0) { ihinfobuf1 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); if (ihinfobuf1 == NULL) { - printf("FATAL ERROR: Creation failed\n"); + printf("FATAL ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n"); } else { args[0].j = (jlong)info->meta_size.attr.index_size; args[1].j = (jlong)info->meta_size.attr.heap_size; ihinfobuf2 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); if (ihinfobuf2 == NULL) { - printf("FATAL ERROR: Creation failed\n"); + printf("FATAL ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n"); } else { args[0].j = (jlong)info->fileno; @@ -416,7 +416,7 @@ H5O_iterate_cb if (constructor != 0) { cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); if (cb_info_t == NULL) { - printf("FATAL ERROR: Creation failed\n"); + printf("FATAL ERROR: hdf/hdf5lib/structs/H5O_info_t: Creation failed\n"); } else { status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data); -- cgit v0.12 From 565ee9e7f927b95cdfcd3a157eaeeb1f609bc70b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Aug 2018 09:39:44 -0500 Subject: HDFFV-10544 add release note --- release_docs/RELEASE.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b40f8ed..531b60c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -163,6 +163,20 @@ Bug Fixes since HDF5-1.10.2 release Library ------- + - Java HDF5LibraryException class + + The error minor and major values would be lost after the + constructor executed. + + Created two local class variables to hold the values obtained during + execution of the constructor. Refactored the class functions to retrieve + the class values rather then calling the native functions. + The native functions were renamed and called only during execution + of the constructor. + Added error checking to calling class constructors in JNI classes. + + (ADB - 2018/08/06, HDFFV-10544) + - H5Adelete H5Adelete failed when deleting the last "large" attribute that -- cgit v0.12 From 9efb9b7426cbee4a2554f8f183fe8d790b5543b5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Aug 2018 09:44:41 -0500 Subject: HDFFV-10544 correct typo --- java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java index ad5c2ab..22bfe91 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java @@ -50,7 +50,7 @@ public class HDF5LibraryException extends HDF5Exception { this.majorErrorNumber = _getMajorErrorNumber(); this.minorErrorNumber = _getMinorErrorNumber(); - detailMessage = getMinorError(minorErrorNumber()); + detailMessage = getMinorError(minorErrorNumber); } /** -- cgit v0.12 From 4d5255106cc35f1bb171ee6a67c2da6123163d32 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Aug 2018 09:56:01 -0500 Subject: HDFFV-10544 remove native from class function --- java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java index 22bfe91..3a1361a 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java @@ -79,7 +79,7 @@ public class HDF5LibraryException extends HDF5Exception { * * @return the major error number */ - public native long getMajorErrorNumber() + public long getMajorErrorNumber() { return majorErrorNumber; } @@ -91,7 +91,7 @@ public class HDF5LibraryException extends HDF5Exception { * * @return the minor error number */ - public native long getMinorErrorNumber() + public long getMinorErrorNumber() { return minorErrorNumber; } -- cgit v0.12 From 6e4c036d5dc476396428f4b044e23043a80e8df7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Aug 2018 11:00:28 -0500 Subject: HDFFV-10544 Correct var name --- java/src/jni/h5oImp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c index 3b4c068..6093e46 100644 --- a/java/src/jni/h5oImp.c +++ b/java/src/jni/h5oImp.c @@ -372,8 +372,8 @@ H5O_iterate_cb constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "", "(IIIIJJJJJJ)V"); if (constructor != 0) { hdrinfobuf = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); - if (ihinfobuf2 == NULL) { - printf("FATAL ERROR: hdf/hdf5lib/structs/H5O_hdr_info_t: Creation failed\n"); + if (hdrinfobuf == NULL) { + printf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5O_hdr_info_t: Creation failed\n"); } else { args[0].j = (jlong)info->meta_size.obj.index_size; @@ -386,14 +386,14 @@ H5O_iterate_cb if (constructor != 0) { ihinfobuf1 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); if (ihinfobuf1 == NULL) { - printf("FATAL ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n"); + printf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n"); } else { args[0].j = (jlong)info->meta_size.attr.index_size; args[1].j = (jlong)info->meta_size.attr.heap_size; ihinfobuf2 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); if (ihinfobuf2 == NULL) { - printf("FATAL ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n"); + printf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n"); } else { args[0].j = (jlong)info->fileno; @@ -416,7 +416,7 @@ H5O_iterate_cb if (constructor != 0) { cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args); if (cb_info_t == NULL) { - printf("FATAL ERROR: hdf/hdf5lib/structs/H5O_info_t: Creation failed\n"); + printf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5O_info_t: Creation failed\n"); } else { status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data); -- cgit v0.12