From 22831e368bc952c4e1f1f29d733ad63ee825018c Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:44:02 +0000 Subject: [PATCH] Committing clang-format changes --- .../DataDisplayConverterFactory.java | 16 ++++--- .../view/TableView/DataProviderFactory.java | 44 +++++++++++-------- .../hdf/view/dialog/UserOptionsHDFPage.java | 4 +- .../hdf/object/Datatype.java | 5 +-- .../hdf/object/h5/H5Datatype.java | 12 ++--- .../hdf/object/h5/H5ScalarDS.java | 19 ++++---- 6 files changed, 52 insertions(+), 48 deletions(-) diff --git a/src/org.hdfgroup.hdfview/hdf/view/TableView/DataDisplayConverterFactory.java b/src/org.hdfgroup.hdfview/hdf/view/TableView/DataDisplayConverterFactory.java index 2a0b69b3..7fdac93c 100644 --- a/src/org.hdfgroup.hdfview/hdf/view/TableView/DataDisplayConverterFactory.java +++ b/src/org.hdfgroup.hdfview/hdf/view/TableView/DataDisplayConverterFactory.java @@ -970,9 +970,10 @@ private static class ComplexDataDisplayConverter extends HDFDisplayConverter { private static final Logger log = LoggerFactory.getLogger(ComplexDataDisplayConverter.class); private final HDFDisplayConverter baseTypeConverter; - private final StringBuilder buffer; + private final StringBuilder buffer; - ComplexDataDisplayConverter(final Datatype dtype) throws Exception { + ComplexDataDisplayConverter(final Datatype dtype) throws Exception + { super(dtype); if (!dtype.isComplex()) { @@ -1000,8 +1001,9 @@ private static class ComplexDataDisplayConverter extends HDFDisplayConverter { } catch (Exception ex) { log.debug("exit: couldn't get DataDisplayConverter for base datatype: ", ex); - throw new Exception("ComplexDataDisplayConverter: couldn't get DataDisplayConverter for base datatype: " - + ex.getMessage()); + throw new Exception( + "ComplexDataDisplayConverter: couldn't get DataDisplayConverter for base datatype: " + + ex.getMessage()); } buffer = new StringBuilder(); @@ -1031,8 +1033,8 @@ public Object canonicalToDisplayValue(Object value) buffer.setLength(0); // clear the old string /* - * Pass the cell's row and column index down in case there is a CompoundDataDisplayConverter at the bottom - * of the chain. + * Pass the cell's row and column index down in case there is a CompoundDataDisplayConverter at + * the bottom of the chain. */ baseTypeConverter.cellRowIdx = cellRowIdx; baseTypeConverter.cellColIdx = cellColIdx; @@ -1040,7 +1042,7 @@ public Object canonicalToDisplayValue(Object value) try { Object obj; Object convertedValue; - int arrLen = Array.getLength(value); + int arrLen = Array.getLength(value); log.trace("canonicalToDisplayValue({}): array length={}", value, arrLen); diff --git a/src/org.hdfgroup.hdfview/hdf/view/TableView/DataProviderFactory.java b/src/org.hdfgroup.hdfview/hdf/view/TableView/DataProviderFactory.java index 9e1f7071..f3dd3ed4 100644 --- a/src/org.hdfgroup.hdfview/hdf/view/TableView/DataProviderFactory.java +++ b/src/org.hdfgroup.hdfview/hdf/view/TableView/DataProviderFactory.java @@ -1963,7 +1963,9 @@ private static class ComplexDataProvider extends HDFDataProvider { private final long typeSize; - ComplexDataProvider(final Datatype dtype, final Object dataBuf, final boolean dataTransposed) throws Exception { + ComplexDataProvider(final Datatype dtype, final Object dataBuf, final boolean dataTransposed) + throws Exception + { super(dtype, dataBuf, dataTransposed); Datatype baseType = dtype.getDatatypeBase(); @@ -1984,7 +1986,7 @@ public Object getDataValue(int columnIndex, int rowIndex) try { int bufIndex = physicalLocationToBufIndex(rowIndex, columnIndex); - theValue = retrieveArrayOfAtomicElements(dataBuf, bufIndex * 2); + theValue = retrieveArrayOfAtomicElements(dataBuf, bufIndex * 2); log.trace("getDataValue(bufIndex={}, dataBuf={})=({})", bufIndex, dataBuf, theValue); } catch (Exception ex) { @@ -1992,7 +1994,8 @@ public Object getDataValue(int columnIndex, int rowIndex) theValue = DataFactoryUtils.errStr; } - log.trace("getDataValue(rowIndex={}, columnIndex={})=({}): finish", rowIndex, columnIndex, theValue); + log.trace("getDataValue(rowIndex={}, columnIndex={})=({}): finish", rowIndex, columnIndex, + theValue); return theValue; } @@ -2000,10 +2003,11 @@ public Object getDataValue(int columnIndex, int rowIndex) private Object[] retrieveArrayOfAtomicElements(Object objBuf, int rowStartIdx) { log.debug("retrieveArrayOfAtomicElements(): objBuf={}", objBuf); - Object[] tempArray = new Object[(int) 2]; - Object realElement = Array.get(objBuf, rowStartIdx); - Object imgElement = Array.get(objBuf, rowStartIdx + 1); - log.debug("retrieveArrayOfAtomicElements(): realElement={} imgElement={}", realElement, imgElement); + Object[] tempArray = new Object[(int)2]; + Object realElement = Array.get(objBuf, rowStartIdx); + Object imgElement = Array.get(objBuf, rowStartIdx + 1); + log.debug("retrieveArrayOfAtomicElements(): realElement={} imgElement={}", realElement, + imgElement); tempArray[0] = baseTypeDataProvider.getDataValue(objBuf, rowStartIdx); tempArray[1] = baseTypeDataProvider.getDataValue(objBuf, rowStartIdx + 1); @@ -2021,10 +2025,11 @@ public void setDataValue(int columnIndex, int rowIndex, Object newValue) updateArrayElements(dataBuf, newValue, columnIndex, rowIndex); } catch (Exception ex) { - log.debug("setDataValue(rowIndex={}, columnIndex={}, {}): cell value update failure: ", rowIndex, - columnIndex, newValue, ex); + log.debug("setDataValue(rowIndex={}, columnIndex={}, {}): cell value update failure: ", + rowIndex, columnIndex, newValue, ex); } - log.trace("setDataValue(rowIndex={}, columnIndex={})=({}): finish", rowIndex, columnIndex, newValue); + log.trace("setDataValue(rowIndex={}, columnIndex={})=({}): finish", rowIndex, columnIndex, + newValue); } @Override @@ -2034,11 +2039,12 @@ public void setDataValue(int columnIndex, int rowIndex, Object bufObject, Object updateArrayElements(bufObject, newValue, columnIndex, rowIndex); } catch (Exception ex) { - log.debug("setDataValue(rowIndex={}, columnIndex={}, bufObject={}, {}): cell value update failure: ", - rowIndex, columnIndex, bufObject, newValue, ex); + log.debug( + "setDataValue(rowIndex={}, columnIndex={}, bufObject={}, {}): cell value update failure: ", + rowIndex, columnIndex, bufObject, newValue, ex); } - log.trace("setDataValue(rowIndex={}, columnIndex={}, bufObject={})=({}): finish", rowIndex, columnIndex, - bufObject, newValue); + log.trace("setDataValue(rowIndex={}, columnIndex={}, bufObject={})=({}): finish", rowIndex, + columnIndex, bufObject, newValue); } private void updateArrayElements(Object curBuf, Object newValue, int columnIndex, int rowStartIndex) @@ -2048,11 +2054,11 @@ private void updateArrayElements(Object curBuf, Object newValue, int columnIndex private void updateArrayOfAtomicElements(Object newValue, Object curBuf, int rowStartIdx) { - ArrayList vlElements = ((ArrayList[]) curBuf)[rowStartIdx]; + ArrayList vlElements = ((ArrayList[])curBuf)[rowStartIdx]; - StringTokenizer st = new StringTokenizer((String) newValue, "+i"); - int newcnt = st.countTokens(); - Object[] buffer = new Double[newcnt]; + StringTokenizer st = new StringTokenizer((String)newValue, "+i"); + int newcnt = st.countTokens(); + Object[] buffer = new Double[newcnt]; for (int i = 0; i < newcnt; i++) { baseTypeDataProvider.setDataValue(i, buffer, st.nextToken().trim()); isValueChanged = isValueChanged || baseTypeDataProvider.getIsValueChanged(); @@ -2062,7 +2068,7 @@ private void updateArrayOfAtomicElements(Object newValue, Object curBuf, int row log.trace("updateArrayOfAtomicElements(): buffer cname={} of data cname={}", bname, cname); vlElements = new ArrayList<>(Arrays.asList(buffer)); log.debug("updateArrayOfAtomicElements(): new vlSize={}", vlElements.size()); - ((ArrayList[]) curBuf)[rowStartIdx] = vlElements; + ((ArrayList[])curBuf)[rowStartIdx] = vlElements; } } } diff --git a/src/org.hdfgroup.hdfview/hdf/view/dialog/UserOptionsHDFPage.java b/src/org.hdfgroup.hdfview/hdf/view/dialog/UserOptionsHDFPage.java index 20e298b5..c1f3cde8 100644 --- a/src/org.hdfgroup.hdfview/hdf/view/dialog/UserOptionsHDFPage.java +++ b/src/org.hdfgroup.hdfview/hdf/view/dialog/UserOptionsHDFPage.java @@ -55,9 +55,9 @@ public class UserOptionsHDFPage extends UserOptionsDefaultPage { private Button checkNativeOrder, checkDecOrder, checkIncOrder; private Button checkIndexName, checkIndexCreateOrder; private Button earlyLibVersion, early18LibVersion, early110LibVersion, early112LibVersion, - early114LibVersion, early200LibVersion, earlyLateLibVersion; + early114LibVersion, early200LibVersion, earlyLateLibVersion; private Button lateLibVersion, late18LibVersion, late110LibVersion, late112LibVersion, late114LibVersion, - late200LibVersion, lateLateLibVersion; + late200LibVersion, lateLateLibVersion; private Button pluginDirButton; /** Default early libversion for files */ diff --git a/src/org.hdfgroup.object/hdf/object/Datatype.java b/src/org.hdfgroup.object/hdf/object/Datatype.java index f5ad65ff..0849554b 100644 --- a/src/org.hdfgroup.object/hdf/object/Datatype.java +++ b/src/org.hdfgroup.object/hdf/object/Datatype.java @@ -1017,10 +1017,7 @@ public boolean isUnsigned() * * @return true if the datatype is complex; false otherwise */ - public boolean isComplex() - { - return (datatypeClass == Datatype.CLASS_COMPLEX); - } + public boolean isComplex() { return (datatypeClass == Datatype.CLASS_COMPLEX); } /* Implement interface MetaDataContainer */ diff --git a/src/org.hdfgroup.object/hdf/object/h5/H5Datatype.java b/src/org.hdfgroup.object/hdf/object/h5/H5Datatype.java index e2943c5d..279287c3 100644 --- a/src/org.hdfgroup.object/hdf/object/h5/H5Datatype.java +++ b/src/org.hdfgroup.object/hdf/object/h5/H5Datatype.java @@ -818,7 +818,7 @@ public void fromNative(long tid) tsize = H5.H5Tget_size(tid); isVariableStr = H5.H5Tis_variable_str(tid); isVLEN = false; - isComplex = false; + isComplex = false; log.trace("fromNative(): tclass={}, tsize={}, torder={}, isVLEN={}", nativeClass, tsize, torder, isVLEN); if (H5.H5Tcommitted(tid)) { @@ -1155,14 +1155,14 @@ else if (nativeClass == HDF5Constants.H5T_OPAQUE) { } else if (nativeClass == HDF5Constants.H5T_COMPLEX) { log.debug("fromNative(): datatypeClass is complex"); - long tmptid = HDF5Constants.H5I_INVALID_HID; + long tmptid = HDF5Constants.H5I_INVALID_HID; datatypeClass = CLASS_COMPLEX; - isComplex = true; + isComplex = true; try { log.trace("fromNative(): complex type"); - tmptid = H5.H5Tget_super(tid); + tmptid = H5.H5Tget_super(tid); int nativeBaseClass = H5.H5Tget_class(tmptid); - baseType = new H5Datatype(this.fileFormat, tmptid, this); + baseType = new H5Datatype(this.fileFormat, tmptid, this); if (baseType == null) { log.debug("fromNative(): Complex datatype has null base type"); throw new Exception("Datatype (Complex) has no base datatype"); @@ -1898,7 +1898,7 @@ else if (typeClass == CLASS_COMPLEX) { else { if (typeSize == NATIVE) typeSize = H5.H5Tget_size(HDF5Constants.H5T_NATIVE_FLOAT); - data = new byte[(int) (numPoints * 2 * typeSize)]; + data = new byte[(int)(numPoints * 2 * typeSize)]; } } else if ((typeClass == CLASS_OPAQUE) || (typeClass == CLASS_BITFIELD)) { diff --git a/src/org.hdfgroup.object/hdf/object/h5/H5ScalarDS.java b/src/org.hdfgroup.object/hdf/object/h5/H5ScalarDS.java index c10bbd83..2bd5c603 100644 --- a/src/org.hdfgroup.object/hdf/object/h5/H5ScalarDS.java +++ b/src/org.hdfgroup.object/hdf/object/h5/H5ScalarDS.java @@ -374,15 +374,14 @@ public void init() else datatype = new H5Datatype(getFileFormat(), tid); + log.trace("init(): tid={} is tclass={} has isText={} : isNamed={} : isUnsigned={} ", tid, + datatype.getDatatypeClass(), ((H5Datatype)datatype).isText(), + datatype.isNamed(), datatype.isUnsigned()); log.trace( - "init(): tid={} is tclass={} has isText={} : isNamed={} : isUnsigned={} ", - tid, datatype.getDatatypeClass(), ((H5Datatype)datatype).isText(), datatype.isNamed(), - datatype.isUnsigned()); - log.trace( - "init(): tid={} is tclass={} has isVLEN={} : isEnum={} : isStdRef={} : isRegRef={} : isComplex={}", - tid, datatype.getDatatypeClass(), datatype.isVLEN(), datatype.isEnum(), - ((H5Datatype) datatype).isStdRef(), ((H5Datatype) datatype).isRegRef(), - ((H5Datatype) datatype).isComplex()); + "init(): tid={} is tclass={} has isVLEN={} : isEnum={} : isStdRef={} : isRegRef={} : isComplex={}", + tid, datatype.getDatatypeClass(), datatype.isVLEN(), datatype.isEnum(), + ((H5Datatype)datatype).isStdRef(), ((H5Datatype)datatype).isRegRef(), + ((H5Datatype)datatype).isComplex()); } catch (Exception ex) { log.debug("init(): failed to create datatype for dataset: ", ex); @@ -2415,9 +2414,9 @@ else if (datatypeSize == 4) else if (datatypeSize == 8) data = HDFNativeData.doubleToByte(valDbl); else if (datatypeSize == 4) - data = HDFNativeData.floatToByte((float) valDbl); + data = HDFNativeData.floatToByte((float)valDbl); else - data = HDFNativeData.shortToByte((short) Float.floatToFloat16((float) valDbl)); + data = HDFNativeData.shortToByte((short)Float.floatToFloat16((float)valDbl)); break; } // (datatypeClass) }