Skip to content

Commit e2a5c5c

Browse files
committed
Updates for v2 arch
1 parent eceaead commit e2a5c5c

File tree

3 files changed

+6
-49
lines changed

3 files changed

+6
-49
lines changed

src/main/java/org/hdf5javalib/examples/hdf5examples/HDF5Debug.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ private void run() {
4747
// List all .h5 files in HDF5Examples resources directory
4848
// ATL03_20250302235544_11742607_006_01
4949
// Path dirPath = Paths.get(Objects.requireNonNull(HDF5Debug.class.getClassLoader().getResource("HDF5Examples/h5ex_g_compact2.h5")).toURI());
50-
Path dirPath = Paths.get("c:/users/karnicho/Downloads/ATL03_20250302235544_11742607_007_01.h5");
51-
// Path dirPath = Paths.get("c:/users/karnicho/Downloads/ATL03_20250302235544_11742607_006_01.h5");
50+
Path dirPath = Paths.get("c:/users/karln/Downloads/ATL03_20250302235544_11742607_007_01.h5");
51+
// Path dirPath = Paths.get("c:/users/karln/Downloads/ATL03_20250302235544_11742607_006_01.h5");
5252
processFile(dirPath);
5353
} catch (Exception e) {
5454
throw new IllegalStateException(e);

src/main/java/org/hdf5javalib/hdfjava/HdfDataset.java

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ private static long computeFlattenedIndex(long[] indices, long[] dims) {
152152
* A private record to hold the context and pre-calculated values for a chunked data read.
153153
* This avoids passing numerous parameters to helper methods.
154154
*/
155+
@SuppressWarnings("java:S2157")
155156
private record ChunkedReadContext(
156157
int dimensions,
157158
long[] datasetDims,
@@ -161,31 +162,7 @@ private record ChunkedReadContext(
161162
long endElement,
162163
Optional<FilterPipelineMessage> filterPipeline,
163164
FillValueMessage fillValueMessage
164-
) {
165-
@Override
166-
public boolean equals(Object o) {
167-
if (o == null || getClass() != o.getClass()) return false;
168-
ChunkedReadContext that = (ChunkedReadContext) o;
169-
return dimensions == that.dimensions && endElement == that.endElement && elementSize == that.elementSize && startElement == that.startElement && Objects.deepEquals(chunkDims, that.chunkDims) && Objects.deepEquals(datasetDims, that.datasetDims);
170-
}
171-
172-
@Override
173-
public int hashCode() {
174-
return Objects.hash(dimensions, Arrays.hashCode(datasetDims), Arrays.hashCode(chunkDims), elementSize, startElement, endElement);
175-
}
176-
177-
@Override
178-
public String toString() {
179-
return "ChunkedReadContext{" +
180-
"dimensions=" + dimensions +
181-
", datasetDims=" + Arrays.toString(datasetDims) +
182-
", chunkDims=" + Arrays.toString(chunkDims) +
183-
", elementSize=" + elementSize +
184-
", startElement=" + startElement +
185-
", endElement=" + endElement +
186-
'}';
187-
}
188-
}
165+
) {}
189166

190167
// In the method:
191168
public synchronized ByteBuffer getDatasetData(SeekableByteChannel channel, long offset, long size) throws IOException, InvocationTargetException, InstantiationException, IllegalAccessException {

src/main/java/org/hdf5javalib/utils/FlattenedArrayUtils.java

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -266,28 +266,8 @@ public static <T> Object reduceAlongAxis(
266266
/**
267267
* Private record to hold calculated information about a slice operation.
268268
*/
269-
private record SliceInfo(int[] outShape, int[] sliceStarts, int outRank) {
270-
@Override
271-
public boolean equals(Object o) {
272-
if (o == null || getClass() != o.getClass()) return false;
273-
SliceInfo sliceInfo = (SliceInfo) o;
274-
return outRank == sliceInfo.outRank && Objects.deepEquals(outShape, sliceInfo.outShape) && Objects.deepEquals(sliceStarts, sliceInfo.sliceStarts);
275-
}
276-
277-
@Override
278-
public int hashCode() {
279-
return Objects.hash(Arrays.hashCode(outShape), Arrays.hashCode(sliceStarts), outRank);
280-
}
281-
282-
@Override
283-
public String toString() {
284-
return "SliceInfo{" +
285-
"outShape=" + Arrays.toString(outShape) +
286-
", sliceStarts=" + Arrays.toString(sliceStarts) +
287-
", outRank=" + outRank +
288-
'}';
289-
}
290-
}
269+
@SuppressWarnings("java:S2157")
270+
private record SliceInfo(int[] outShape, int[] sliceStarts, int outRank) { }
291271

292272
/**
293273
* Calculates the output shape, starting indices, and rank of a sliced array.

0 commit comments

Comments
 (0)