From 899c71710bf4e9a08f252d1a244f21ac48e51d5a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 7 Oct 2021 13:14:44 -0500 Subject: [PATCH 1/2] Merge Add missing dataset reference text #1081 --- java/src/jni/h5util.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 8021438cc86..931d640efe8 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -658,8 +658,6 @@ h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, void *ref_p) int ret_value = FAIL; - if (!h5str_append(out_str, " \"")) - H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); buf_size = H5Rget_file_name(ref_vp, NULL, 0); if (buf_size) { ref_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1); @@ -697,8 +695,6 @@ h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, void *ref_p) ref_name = NULL; } } - if (!h5str_append(out_str, "\"")) - H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); ret_value = SUCCEED; done: @@ -725,6 +721,9 @@ h5str_region_dataset(JNIEnv *env, h5str_t *out_str, H5R_ref_t *ref_vp, int expan if ((new_obj_sid = H5Ropen_region(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) < 0) H5_LIBRARY_ERROR(ENVONLY); + if (h5str_sprint_reference(ENVONLY, out_str, ref_vp) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + if ((region_type = H5Sget_select_type(new_obj_sid)) > H5S_SEL_ERROR) { if (H5S_SEL_POINTS == region_type) { if (h5str_dump_region_points(ENVONLY, out_str, new_obj_sid, new_obj_id, expand_data) < 0) From 0cc39e97ed98587e901e90c0a69c54ef03c47355 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 7 Oct 2021 14:31:25 -0500 Subject: [PATCH 2/2] Only print name if not printing data --- java/src/jni/h5util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 931d640efe8..9a93d5cb1cb 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -721,8 +721,9 @@ h5str_region_dataset(JNIEnv *env, h5str_t *out_str, H5R_ref_t *ref_vp, int expan if ((new_obj_sid = H5Ropen_region(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) < 0) H5_LIBRARY_ERROR(ENVONLY); - if (h5str_sprint_reference(ENVONLY, out_str, ref_vp) < 0) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + if (expand_data == 0) + if (h5str_sprint_reference(ENVONLY, out_str, ref_vp) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if ((region_type = H5Sget_select_type(new_obj_sid)) > H5S_SEL_ERROR) { if (H5S_SEL_POINTS == region_type) {