summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-06-07 19:04:20 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-06-07 19:04:20 (GMT)
commitaee288c19dbd0d2e76dd63a3edfadd5ad4f2bd1c (patch)
treefb2603b5987b5a1b252430c29e034047f8f8c918
parentd124a1fe47c03d850ccbb1a93b3c8f2262ecc918 (diff)
downloadhdf5-aee288c19dbd0d2e76dd63a3edfadd5ad4f2bd1c.zip
hdf5-aee288c19dbd0d2e76dd63a3edfadd5ad4f2bd1c.tar.gz
hdf5-aee288c19dbd0d2e76dd63a3edfadd5ad4f2bd1c.tar.bz2
[svn-r30048] refactor duplicate release string calls
-rw-r--r--java/src/jni/h5tImp.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c
index 3ebdbfd..dc052bc 100644
--- a/java/src/jni/h5tImp.c
+++ b/java/src/jni/h5tImp.c
@@ -1033,19 +1033,17 @@ Java_hdf_hdf5lib_H5_H5Tenum_1insert_1int
intP = ENVPTR->GetIntArrayElements(ENVPAR value, &isCopy2);
if (intP == NULL) {
- UNPIN_JAVA_STRING(name, nameP);
h5JNIFatalError(env, "H5Tenum_insert: value not pinned");
- return -1;
} /* end if */
else {
status = H5Tenum_insert((hid_t)type_id, nameP, intP);
- UNPIN_JAVA_STRING(name, nameP);
ENVPTR->ReleaseIntArrayElements(ENVPAR value, intP, JNI_ABORT);
if (status < 0)
h5libraryError(env);
} /* end else */
+ UNPIN_JAVA_STRING(name, nameP);
} /* end else */
return (jint)status;
@@ -1073,18 +1071,17 @@ Java_hdf_hdf5lib_H5_H5Tenum_1insert
byteP = ENVPTR->GetByteArrayElements(ENVPAR value, &isCopy2);
if (byteP == NULL) {
- UNPIN_JAVA_STRING(name, nameP);
h5JNIFatalError(env, "H5Tenum_insert: value not pinned");
} /* end if */
else {
status = H5Tenum_insert((hid_t)type_id, nameP, byteP);
- UNPIN_JAVA_STRING(name, nameP);
ENVPTR->ReleaseByteArrayElements(ENVPAR value, byteP, JNI_ABORT);
if (status < 0)
h5libraryError(env);
} /* end else */
+ UNPIN_JAVA_STRING(name, nameP);
} /* end else */
} /* end Java_hdf_hdf5lib_H5_H5Tenum_1insert */
@@ -1225,14 +1222,11 @@ Java_hdf_hdf5lib_H5_H5Tenum_1valueof_1int
intP = ENVPTR->GetIntArrayElements(ENVPAR value, &isCopy2);
if (intP == NULL) {
- UNPIN_JAVA_STRING(name, nameP);
h5JNIFatalError(env, "H5Tenum_valueof: value not pinned");
} /* end if */
else {
status = H5Tenum_valueof((hid_t)type_id, nameP, intP);
- UNPIN_JAVA_STRING(name, nameP);
-
if (status < 0) {
ENVPTR->ReleaseIntArrayElements(ENVPAR value, intP, JNI_ABORT);
h5libraryError(env);
@@ -1240,6 +1234,7 @@ Java_hdf_hdf5lib_H5_H5Tenum_1valueof_1int
else
ENVPTR->ReleaseIntArrayElements(ENVPAR value, intP, 0);
} /* end else */
+ UNPIN_JAVA_STRING(name, nameP);
} /* end else */
return (jint)status;
@@ -1267,14 +1262,11 @@ Java_hdf_hdf5lib_H5_H5Tenum_1valueof
byteP = ENVPTR->GetByteArrayElements(ENVPAR value, &isCopy2);
if (byteP == NULL) {
- UNPIN_JAVA_STRING(name,nameP);
h5JNIFatalError(env, "H5Tenum_valueof: value not pinned");
} /* end if */
else {
status = H5Tenum_valueof((hid_t)type_id, nameP, byteP);
- UNPIN_JAVA_STRING(name, nameP);
-
if (status < 0) {
ENVPTR->ReleaseByteArrayElements(ENVPAR value, byteP, JNI_ABORT);
h5libraryError(env);
@@ -1282,6 +1274,7 @@ Java_hdf_hdf5lib_H5_H5Tenum_1valueof
else
ENVPTR->ReleaseByteArrayElements(ENVPAR value, byteP, 0);
} /* end else */
+ UNPIN_JAVA_STRING(name, nameP);
} /* end else */
} /* end Java_hdf_hdf5lib_H5_H5Tenum_1valueof */