Skip to content

Commit abc3ad4

Browse files
committed
SonarQube cleanup - bugs cleanup
1 parent 31d6f02 commit abc3ad4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • src/main/java/org/hdf5javalib/hdffile/infrastructure/fractalheap

src/main/java/org/hdf5javalib/hdffile/infrastructure/fractalheap/FractalHeap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ private static List<ChildInfo> parseChildInfos(ByteBuffer blockBuffer, FractalHe
395395
for (short r = 0; r < nrows; r++) {
396396
// --- Corrected Logic ---
397397
// Calculate the exponent: 0 for rows 0 and 1, then 1, 2, 3...
398-
long exponent = Math.max(0L, r - 1);
398+
long exponent = Math.max(0L, r - 1L);
399399
long rowBlockSize = startingBlockSize * (1L << exponent);
400400
// --- End Corrected Logic ---
401401

@@ -481,7 +481,7 @@ private static long getBlockSize(FractalHeapHeader header, long blockOffset) thr
481481
}
482482
double arg = ((double) blockOffset / (header.tableWidth * header.startingBlockSize.getInstance(Long.class))) + 1;
483483
int row = (int) Math.floor(Math.log(arg) / Math.log(2));
484-
long exponent = Math.max(0L, row - 1);
484+
long exponent = Math.max(0L, row - 1L);
485485
return startingBlockSize * (1L << exponent);
486486
}
487487

0 commit comments

Comments
 (0)