Skip to content

Commit 3212c1c

Browse files
committed
manual sonar fixes
1 parent fe6f132 commit 3212c1c

5 files changed

Lines changed: 11 additions & 12 deletions

File tree

csv/src/test/java/io/github/dfa1/vortex/csv/CsvExporterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ void rendersStructInStructAsNestedJsonObject(@TempDir Path tmp) throws Exception
425425

426426
@Test
427427
void rendersFixedSizeListColumnAsJsonArray(@TempDir Path tmp) throws Exception {
428-
// Given a FixedSizeList[F32, 3] column — the glove vector shape (issue #257);
428+
// Given a FixedSizeList of type F32 and size 3 column — the glove vector shape (issue #257);
429429
// each row is 3 consecutive floats from the flat elements array.
430430
Path vortex = tmp.resolve("fsl.vortex");
431431
DType.FixedSizeList vecDtype = new DType.FixedSizeList(DType.F32, 3, false);

integration/src/test/java/io/github/dfa1/vortex/integration/RaincloudConformanceIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private static void assertMatchesParquetOracle(Path vortex, Path parquet) throws
190190
private static void closeQuietly(Closeable closeable) {
191191
try {
192192
closeable.close();
193-
} catch (IOException ignored) {
193+
} catch (IOException _) {
194194
// best effort: only used to unblock a producer thread before join()
195195
}
196196
}

integration/src/test/java/io/github/dfa1/vortex/integration/RaincloudSizeComparisonIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import java.nio.file.Path;
1313
import java.util.stream.Stream;
1414

15-
import static org.junit.jupiter.api.Assumptions.assumeTrue;
15+
import static org.junit.jupiter.api.Assertions.assertTrue;
1616

1717
/// File-size comparison across the Raincloud corpus for three representations:
1818
/// Parquet (corpus oracle), vortex-jni (corpus file, written by Rust Vortex), and
@@ -33,7 +33,7 @@ class RaincloudSizeComparisonIntegrationTest {
3333
@Test
3434
void corpusIsHydrated() {
3535
// Given / When / Then — visible skip marker when the corpus is absent
36-
assumeTrue(Files.exists(manifestPath()),
36+
assertTrue(Files.exists(manifestPath()),
3737
"raincloud corpus not hydrated — run scripts/hydrate-raincloud-corpus.sh");
3838
}
3939

jdbc/src/test/java/io/github/dfa1/vortex/jdbc/JdbcImporterTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import static org.assertj.core.api.Assertions.assertThat;
2929

30+
@SuppressWarnings("SqlNoDataSourceInspection")
3031
class JdbcImporterTest {
3132

3233
private Connection conn;
@@ -177,10 +178,10 @@ void roundTripsNullableExtensionColumns(@TempDir Path tmp) throws Exception {
177178
try (VortexReader reader = VortexReader.open(vortex,
178179
io.github.dfa1.vortex.reader.ReadRegistry.loadAll())) {
179180
DType.Struct schema = (DType.Struct) reader.dtype();
180-
assertThat(((DType.Extension) schema.fieldTypes().get(1)).nullable()).isTrue();
181-
assertThat(((DType.Extension) schema.fieldTypes().get(2)).nullable()).isTrue();
182-
assertThat(((DType.Extension) schema.fieldTypes().get(3)).nullable()).isTrue();
183-
assertThat(((DType.Extension) schema.fieldTypes().get(4)).nullable()).isTrue();
181+
assertThat(schema.fieldTypes().get(1).nullable()).isTrue();
182+
assertThat(schema.fieldTypes().get(2).nullable()).isTrue();
183+
assertThat(schema.fieldTypes().get(3).nullable()).isTrue();
184+
assertThat(schema.fieldTypes().get(4).nullable()).isTrue();
184185

185186
try (ScanIterator iter = reader.scan(ScanOptions.all())) {
186187
assertThat(iter.hasNext()).isTrue();
@@ -389,7 +390,7 @@ void progressListenerIsInvokedPerChunk(@TempDir Path tmp) throws Exception {
389390
List<Long> checkpoints = new ArrayList<>();
390391
JdbcImportOptions options = JdbcImportOptions.defaults()
391392
.withChunkSize(3)
392-
.withProgressListener((done, total) -> checkpoints.add(done));
393+
.withProgressListener((done, _) -> checkpoints.add(done));
393394

394395
// When
395396
JdbcImporter.importQuery(conn, "SELECT * FROM progress_test", vortex, options);

reader/src/main/java/io/github/dfa1/vortex/reader/ScanIterator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
/// ```
7878
public final class ScanIterator implements Iterator<Chunk>, AutoCloseable {
7979

80-
8180
private final VortexHandle file;
8281
private final ScanOptions options;
8382

@@ -791,8 +790,7 @@ private static Array sliceArray(Array full, long offset, long length, DType dtyp
791790
// window's absolute position rather than shared unchanged.
792791
DType.FixedSizeList fd = (DType.FixedSizeList) dtype;
793792
int fixedSize = a.fixedSize();
794-
Array elementsSlice = sliceArray(a.elements(), offset * (long) fixedSize,
795-
length * (long) fixedSize, fd.elementType());
793+
Array elementsSlice = sliceArray(a.elements(), offset * fixedSize, length *fixedSize, fd.elementType());
796794
yield new FixedSizeListArray(fd, length, elementsSlice);
797795
}
798796
default -> throw new VortexException(

0 commit comments

Comments
 (0)