diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-08-02 15:29:43 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-08-02 15:29:43 (GMT) |
commit | f72d425d9c22ea4aaa8c2c33394d98d05f01b83b (patch) | |
tree | 897cdc896a12074f0c087804125ba37e9000f9bd /java/test | |
parent | 7e49cb802afb1f1ea2513b3908a787ad48fcce1c (diff) | |
download | hdf5-f72d425d9c22ea4aaa8c2c33394d98d05f01b83b.zip hdf5-f72d425d9c22ea4aaa8c2c33394d98d05f01b83b.tar.gz hdf5-f72d425d9c22ea4aaa8c2c33394d98d05f01b83b.tar.bz2 |
[svn-r30250] Correct position of finally block for test
Diffstat (limited to 'java/test')
-rw-r--r-- | java/test/TestH5PL.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/java/test/TestH5PL.java b/java/test/TestH5PL.java index 6a3324a..225ecd6 100644 --- a/java/test/TestH5PL.java +++ b/java/test/TestH5PL.java @@ -70,12 +70,12 @@ public class TestH5PL { @Test public void TestH5PLdlopen() { + long file_id = -1; + long filespace_id = -1; + long dataset_id = -1; + long fapl_id = -1; + long dcpl_id = -1; try { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long fapl_id = -1; - long dcpl_id = -1; int[] cd_values = {9, 0, 0, 0}; int[] libversion = {0, 0, 0}; long[] dims = { DIM_X, DIM_Y }; @@ -163,21 +163,21 @@ public class TestH5PL { e.printStackTrace(); fail("TestH5PLdlopen H5Dwrite:" + e); } - finally { - // End access to the dataset and release resources used by it. - if (dcpl_id >= 0) - try {H5.H5Pclose_class(dcpl_id);} catch (Throwable err) {} - if (dataset_id >= 0) - try {H5.H5Dclose(dataset_id);} catch (Throwable err) {} - if (filespace_id >= 0) - try {H5.H5Sclose(filespace_id);} catch (Throwable err) {} - if (file_id >= 0) - try {H5.H5Fclose(file_id);} catch (Throwable err) {} - } } catch (Throwable err) { err.printStackTrace(); fail("TestH5PLdlopen " + err); } + finally { + // End access to the dataset and release resources used by it. + if (dcpl_id >= 0) + try {H5.H5Pclose_class(dcpl_id);} catch (Throwable err) {} + if (dataset_id >= 0) + try {H5.H5Dclose(dataset_id);} catch (Throwable err) {} + if (filespace_id >= 0) + try {H5.H5Sclose(filespace_id);} catch (Throwable err) {} + if (file_id >= 0) + try {H5.H5Fclose(file_id);} catch (Throwable err) {} + } } } |