From 407c52f3977df9aaf7a27a3343ea146c3f497a00 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:30:19 -0600 Subject: Merge various cleanup java test, test files, comments (#1364) Plus some spelling corrections --- java/examples/datasets/H5Ex_D_Sofloat.java | 13 ++++++---- java/examples/datasets/H5Ex_D_UnlimitedMod.java | 2 +- java/examples/groups/H5Ex_G_Corder.java | 2 +- .../testfiles/examples.datasets.H5Ex_D_Sofloat.txt | 8 +++---- java/src/hdf/hdf5lib/H5.java | 28 +++++++++++----------- .../hdf5lib/exceptions/HDF5LibraryException.java | 2 +- java/src/hdf/hdf5lib/package-info.java | 2 +- java/src/hdf/hdf5lib/structs/H5F_info2_t.java | 2 +- java/test/TestH5P.java | 4 ++-- java/test/TestH5Pfapl.java | 8 +++---- java/test/TestH5Plist.java | 10 ++++---- m4/aclocal_fc.f90 | 2 +- m4/aclocal_fc.m4 | 6 ++--- 13 files changed, 47 insertions(+), 42 deletions(-) diff --git a/java/examples/datasets/H5Ex_D_Sofloat.java b/java/examples/datasets/H5Ex_D_Sofloat.java index a42aba4..8edde09 100644 --- a/java/examples/datasets/H5Ex_D_Sofloat.java +++ b/java/examples/datasets/H5Ex_D_Sofloat.java @@ -21,6 +21,9 @@ ************************************************************/ package examples.datasets; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; import java.util.EnumSet; import java.util.HashMap; import java.util.Map; @@ -123,8 +126,9 @@ public class H5Ex_D_Sofloat { } // Print the maximum value. - System.out.println("Maximum value in write buffer is: " + max); - System.out.println("Minimum value in write buffer is: " + min); + DecimalFormat df = new DecimalFormat("#,##0.000000", new DecimalFormatSymbols(Locale.US)); + System.out.println("Maximum value in write buffer is: " + df.format(max)); + System.out.println("Minimum value in write buffer is: " + df.format(min)); // Create a new file using the default properties. try { @@ -308,8 +312,9 @@ public class H5Ex_D_Sofloat { } // Print the maximum value. - System.out.println("Maximum value in " + DATASETNAME + " is: " + max); - System.out.println("Minimum value in " + DATASETNAME + " is: " + min); + DecimalFormat df = new DecimalFormat("#,##0.000000", new DecimalFormatSymbols(Locale.US)); + System.out.println("Maximum value in " + DATASETNAME + " is: " + df.format(max)); + System.out.println("Minimum value in " + DATASETNAME + " is: " + df.format(min)); // End access to the dataset and release resources used by it. try { diff --git a/java/examples/datasets/H5Ex_D_UnlimitedMod.java b/java/examples/datasets/H5Ex_D_UnlimitedMod.java index 273ac3e..0708898 100644 --- a/java/examples/datasets/H5Ex_D_UnlimitedMod.java +++ b/java/examples/datasets/H5Ex_D_UnlimitedMod.java @@ -17,7 +17,7 @@ file. Next, it reopens the file, reads back the data, outputs it to the screen, extends the dataset, and writes new data to the entire extended dataset. Finally it - reopens the file again, reads back the data, and utputs it + reopens the file again, reads back the data, and outputs it to the screen. ************************************************************/ package examples.datasets; diff --git a/java/examples/groups/H5Ex_G_Corder.java b/java/examples/groups/H5Ex_G_Corder.java index 5df850e..4fa5aa2 100644 --- a/java/examples/groups/H5Ex_G_Corder.java +++ b/java/examples/groups/H5Ex_G_Corder.java @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ Creating a file with creation properties and traverse the - groups in alpabetical and creation order. + groups in alphabetical and creation order. ************************************************************/ package examples.groups; diff --git a/java/examples/testfiles/examples.datasets.H5Ex_D_Sofloat.txt b/java/examples/testfiles/examples.datasets.H5Ex_D_Sofloat.txt index 4d4b5d6..9025ce2 100644 --- a/java/examples/testfiles/examples.datasets.H5Ex_D_Sofloat.txt +++ b/java/examples/testfiles/examples.datasets.H5Ex_D_Sofloat.txt @@ -1,6 +1,6 @@ -Maximum value in write buffer is: 106.66666666666667 -Minimum value in write buffer is: 1.7692307692307692 +Maximum value in write buffer is: 106.666667 +Minimum value in write buffer is: 1.769231 Filter type is: H5Z_FILTER_SCALEOFFSET -Maximum value in DS1 is: 106.66169811320755 -Minimum value in DS1 is: 1.7692307692307692 +Maximum value in DS1 is: 106.661698 +Minimum value in DS1 is: 1.769231 diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 3c6dbc8..2537123 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -159,7 +159,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * disk (source) and in memory (destination). *

* For Java, this ``ANY'' is a problem, as the type of data must always be declared. Furthermore, multidimensional - * arrays are definitely not layed out contiguously in memory. It would be infeasible to declare a separate + * arrays are definitely not laid out contiguously in memory. It would be infeasible to declare a separate * routine for every combination of number type and dimensionality. For that reason, the * HDFArray class is used to discover the type, shape, and size of the * data array at run time, and to convert to and from a contiguous array of bytes in synchronized static native C order. @@ -440,7 +440,7 @@ public class H5 implements java.io.Serializable { /** * Turn on error handling. By default, the C library prints the error stack of the HDF-5 C library on stdout. This - * behavior may be reenabled by calling H5error_on(). + * behavior may be re-enabled by calling H5error_on(). */ public synchronized static native void H5error_on(); @@ -2095,7 +2095,7 @@ public class H5 implements java.io.Serializable { * IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype. * @param idx_type * IN: The type of index specified by idx_type can be one of the following: - * H5_INDEX_NAME An alpha-numeric index by attribute name. + * H5_INDEX_NAME An alphanumeric index by attribute name. * H5_INDEX_CRT_ORDER An index by creation order. * @param order * IN: The order in which the index is to be traversed, as specified by order, can be one of the following: @@ -2135,7 +2135,7 @@ public class H5 implements java.io.Serializable { * IN: Name of object, relative to location. * @param idx_type * IN: The type of index specified by idx_type can be one of the following: - * H5_INDEX_NAME An alpha-numeric index by attribute name. + * H5_INDEX_NAME An alphanumeric index by attribute name. * H5_INDEX_CRT_ORDER An index by creation order. * @param order * IN: The order in which the index is to be traversed, as specified by order, can be one of the following: @@ -4539,7 +4539,7 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, NullPointerException; /** - * Given a mount point, H5Funmount dissassociates the mount point's file from the file mounted there. + * Given a mount point, H5Funmount disassociates the mount point's file from the file mounted there. * * @param loc_id * The identifier for the location at which the specified file is to be unmounted. @@ -5167,7 +5167,7 @@ public class H5 implements java.io.Serializable { */ /** * retrieves information of all objects (recurvisely) under the group (name) located in the file or group specified - * by loc_id upto maximum specified by objMax. + * by loc_id up to maximum specified by objMax. * * @param loc_id * IN: File or group identifier @@ -6980,7 +6980,7 @@ public class H5 implements java.io.Serializable { * @param size * IN: Size the property value. * @param def_value - * IN: Defaul value of the property + * IN: Default value of the property * * @exception HDF5LibraryException * - Error from the HDF-5 Library. @@ -7000,7 +7000,7 @@ public class H5 implements java.io.Serializable { * @param size * IN: Size the property value. * @param value - * IN: Defaul value of the property + * IN: Default value of the property * * @exception HDF5LibraryException * - Error from the HDF-5 Library. @@ -7043,7 +7043,7 @@ public class H5 implements java.io.Serializable { * @param ocpl_id * IN: : Object (dataset or group) creation property list identifier * @param attributes - * The maximun and minimum no. of attributes to be stored. + * The maximum and minimum no. of attributes to be stored. * *

      *      attributes[0] =  The maximum number of attributes to be stored in compact storage
@@ -7151,7 +7151,7 @@ public class H5 implements java.io.Serializable {
      *              transfer property list.  The FLAGS argument specifies certain
      *              general properties of the filter and is documented below.
      *              The CD_VALUES is an array of CD_NELMTS integers which are
-     *              auxiliary data for the filter.  The integer vlues will be
+     *              auxiliary data for the filter.  The integer values will be
      *              stored in the dataset object header as part of the filter
      *              information.
      *

@@ -7852,9 +7852,9 @@ public class H5 implements java.io.Serializable { * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - aligment array is null. + * - alignment array is null. * @exception IllegalArgumentException - * - aligment array is invalid. + * - alignment array is invalid. **/ public synchronized static native int H5Pget_alignment(long plist, long[] alignment) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; @@ -8000,7 +8000,7 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException; /** - * H5Pget_gc_references Returns the current setting for the garbage collection refernces property from a file access + * H5Pget_gc_references Returns the current setting for the garbage collection references property from a file access * property list. * * @param fapl_id @@ -9047,7 +9047,7 @@ public class H5 implements java.io.Serializable { * the raw data chunk cache on a per-datset basis. * * @param dapl_id - * IN: Identifier of the datset access property list. + * IN: Identifier of the dataset access property list. * @param rdcc_nslots * IN: Number of elements (objects) in the raw data chunk cache. * @param rdcc_nbytes diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java index ee2ca38..cd6877a 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java @@ -114,7 +114,7 @@ public class HDF5LibraryException extends HDF5Exception { return "special zero no error"; } else if (err_code == HDF5Constants.H5E_UNINITIALIZED) { - return "information is unitialized"; + return "information is uninitialized"; } else if (err_code == HDF5Constants.H5E_UNSUPPORTED) { return "feature is unsupported"; diff --git a/java/src/hdf/hdf5lib/package-info.java b/java/src/hdf/hdf5lib/package-info.java index 838a266..7edfcb2 100644 --- a/java/src/hdf/hdf5lib/package-info.java +++ b/java/src/hdf/hdf5lib/package-info.java @@ -114,7 +114,7 @@ * disk (source) and in memory (destination). *

* For Java, this ``ANY'' is a problem, as the type of data must always be declared. Furthermore, multidimensional - * arrays are definitely not layed out contiguously in memory. It would be infeasible to declare a separate + * arrays are definitely not laid out contiguously in memory. It would be infeasible to declare a separate * routine for every combination of number type and dimensionality. For that reason, the * HDFArray class is used to discover the type, shape, and size of the * data array at run time, and to convert to and from a contiguous array of bytes in synchronized static native C order. diff --git a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java index f951bb4..78e6d6c 100644 --- a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java +++ b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java @@ -40,7 +40,7 @@ public class H5F_info2_t implements Serializable{ public H5_ih_info_t sohm_msgs_info; /** - * Constructor fot current "global" information about file + * Constructor for current "global" information about file * @param super_version: Superblock version number * @param super_size: Superblock size * @param super_ext_size: Superblock extension size diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index 3879128..6ae93d9 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -1173,12 +1173,12 @@ public class TestH5P { strategy = H5.H5Pget_file_space_strategy(fcpl_id, persist, threshold); assertTrue("strategy(default): "+strategy, strategy == HDF5Constants.H5F_FSPACE_STRATEGY_FSM_AGGR); assertTrue("persist(default): "+persist[0], persist[0] == false); - assertTrue("theshold(default): "+threshold[0], threshold[0] == 1); + assertTrue("threshold(default): "+threshold[0], threshold[0] == 1); H5.H5Pset_file_space_strategy(fcpl_id, HDF5Constants.H5F_FSPACE_STRATEGY_PAGE, true, 1); strategy = H5.H5Pget_file_space_strategy(fcpl_id, persist, threshold); assertTrue("strategy: "+strategy, strategy == HDF5Constants.H5F_FSPACE_STRATEGY_PAGE); assertTrue("persist: "+persist[0], persist[0] == true); - assertTrue("theshold: "+threshold[0], threshold[0] == 1); + assertTrue("threshold: "+threshold[0], threshold[0] == 1); } catch (Throwable err) { err.printStackTrace(); diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index a65b52e..f6be24f 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -892,7 +892,7 @@ public class TestH5Pfapl { try { H5.H5Pset_fapl_multi(fapl_id, member_map, member_fapl, member_name, member_addr, true); long driver_type = H5.H5Pget_driver(fapl_id); - assertTrue("H5Pget_driver: muti = "+ driver_type, HDF5Constants.H5FD_MULTI==driver_type); + assertTrue("H5Pget_driver: multi = "+ driver_type, HDF5Constants.H5FD_MULTI==driver_type); } catch (Throwable err) { err.printStackTrace(); @@ -932,7 +932,7 @@ public class TestH5Pfapl { try { H5.H5Pset_fapl_multi(fapl_id, member_map, member_fapl, member_name, member_addr, true); long driver_type = H5.H5Pget_driver(fapl_id); - assertTrue("H5Pget_driver: muti = "+ driver_type, HDF5Constants.H5FD_MULTI==driver_type); + assertTrue("H5Pget_driver: multi = "+ driver_type, HDF5Constants.H5FD_MULTI==driver_type); } catch (Throwable err) { err.printStackTrace(); @@ -1001,7 +1001,7 @@ public class TestH5Pfapl { try { H5.H5Pset_fapl_multi(fapl_id, member_map, member_fapl, member_name, member_addr, true); long driver_type = H5.H5Pget_driver(fapl_id); - assertTrue("H5Pget_driver: muti = "+ driver_type, HDF5Constants.H5FD_MULTI==driver_type); + assertTrue("H5Pget_driver: multi = "+ driver_type, HDF5Constants.H5FD_MULTI==driver_type); } catch (Throwable err) { err.printStackTrace(); @@ -1223,7 +1223,7 @@ public class TestH5Pfapl { try { H5.H5Pset_fapl_multi(fapl_id, member_map, member_fapl, member_name, member_addr, true); long driver_type = H5.H5Pget_driver(fapl_id); - assertTrue("H5Pget_driver: muti = "+ driver_type, HDF5Constants.H5FD_MULTI==driver_type); + assertTrue("H5Pget_driver: multi = "+ driver_type, HDF5Constants.H5FD_MULTI==driver_type); } catch (Throwable err) { err.printStackTrace(); diff --git a/java/test/TestH5Plist.java b/java/test/TestH5Plist.java index 0d53071..03e1c8f 100644 --- a/java/test/TestH5Plist.java +++ b/java/test/TestH5Plist.java @@ -148,7 +148,7 @@ public class TestH5Plist { } assertTrue("H5Pequal cid2", status >= 0); - // Make certain false postives aren't being returned + // Make certain false positives aren't being returned try { status = H5.H5Pequal(cid2, HDF5Constants.H5P_FILE_CREATE); } @@ -295,7 +295,7 @@ public class TestH5Plist { } assertTrue("H5Pget_nprops: "+nprops, nprops==0); - // Check the existance of the first property (should fail) + // Check the existence of the first property (should fail) try { status = H5.H5Pexist(plist_class_id, PROP1_NAME); } @@ -326,7 +326,7 @@ public class TestH5Plist { catch (Throwable err) { } - // Check the existance of the first property + // Check the existence of the first property try { status = H5.H5Pexist(plist_class_id, PROP1_NAME); } @@ -377,7 +377,7 @@ public class TestH5Plist { catch (Throwable err) { } - // Check the existance of the second property + // Check the existence of the second property try { status = H5.H5Pexist(plist_class_id, PROP2_NAME); } @@ -418,7 +418,7 @@ public class TestH5Plist { fail("H5Pregister2 plist_class_id: "+PROP3_NAME + err); } - // Check the existance of the third property + // Check the existence of the third property try { status = H5.H5Pexist(plist_class_id, PROP3_NAME); } diff --git a/m4/aclocal_fc.f90 b/m4/aclocal_fc.f90 index 240a768..bcefab5 100644 --- a/m4/aclocal_fc.f90 +++ b/m4/aclocal_fc.f90 @@ -120,7 +120,7 @@ PROGRAM FC_AVAIL_KINDS k = SELECTED_REAL_KIND(ik,jk) IF(k.LT.0) EXIT exp IF(k.NE.prev_rkind)THEN - ! Check if we aleady have that kind + ! Check if we already have that kind new_kind = .TRUE. DO kk = 1, num_rkinds IF(k.EQ.list_rkinds(kk))THEN diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index 49ff485..9d01f47 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -20,7 +20,7 @@ dnl Contains Macros for HDF5 Fortran dnl ********************************* dnl dnl Special characteristics that have no autoconf counterpart but that -dnl we need as part of the C++ support. To distinquish these, they +dnl we need as part of the C++ support. To distinguish these, they dnl have a [PAC] prefix. dnl dnl ------------------------------------------------------------------------- @@ -260,8 +260,8 @@ TEST_SRC="`sed -n '/PROGRAM FC_AVAIL_KINDS/,/END PROGRAM FC_AVAIL_KINDS/p' $srcd AC_RUN_IFELSE([$TEST_SRC], [ dnl The output from the above program will be: - dnl -- LINE 1 -- valid integer kinds (comma seperated list) - dnl -- LINE 2 -- valid real kinds (comma seperated list) + dnl -- LINE 1 -- valid integer kinds (comma separated list) + dnl -- LINE 2 -- valid real kinds (comma separated list) dnl -- LINE 3 -- max decimal precision for reals dnl -- LINE 4 -- number of valid integer kinds dnl -- LINE 5 -- number of valid real kinds -- cgit v0.12