From 5a1d2986699d4c8dbad7feec464d9e628973adaf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 28 Jun 2018 14:22:50 -0500 Subject: Region reference in compounds need class check --- java/src/hdf/hdf5lib/H5.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 4060ca9..987cc1d 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -1746,14 +1746,15 @@ public class H5 implements java.io.Serializable { status = H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (double[]) obj, isCriticalPinning); } - else if (H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) { + else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) && (is1D && (dataClass.getComponentType() == String.class))) || H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) { log.trace("H5Dread_reg_ref"); status = H5Dread_reg_ref(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (String[]) obj); } else if (is1D && (dataClass.getComponentType() == String.class)) { - log.trace("H5DreadVL type"); - status = H5DreadVL(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (Object[]) obj); + log.trace("H5Dread_string type"); + status = H5Dread_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, + (String[]) obj); } else { // Create a data buffer to hold the data into a Java Array -- cgit v0.12