Skip to content

Commit e259261

Browse files
committed
test: drop IntelliJ warnings across integration tests
- Unused lambda parameters: c -> {} to _ -> {} - @SuppressWarnings("SameParameterValue") on private helpers always called with the same argument - List.get(0) -> List.getFirst() - Drop an unnecessary regex escape (]\\( -> ]\\() - Drop a redundant throws IOException (writeOracle fully catches it) - Delete InspectForTest: permanently @disabled, required manually downloading /tmp/for.vortex and /tmp/rle.vortex, never ran in CI
1 parent ccd4767 commit e259261

10 files changed

Lines changed: 15 additions & 42 deletions

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void strictMode_emptyRegistry_throwsVortexException(@TempDir Path tmp) throws IO
111111
assertThatThrownBy(() -> {
112112
try (VortexReader vf = VortexReader.open(file, ReadRegistry.empty());
113113
var iter = vf.scan(io.github.dfa1.vortex.reader.ScanOptions.all())) {
114-
iter.forEachRemaining(c -> {});
114+
iter.forEachRemaining(_ -> {});
115115
}
116116
}).isInstanceOf(VortexException.class);
117117
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class DocsConsistencyTest {
4646
private static final Pattern SERVICE_FILE = Pattern.compile(
4747
"META-INF/services/(io\\.github\\.dfa1\\.vortex[A-Za-z0-9_.]+)");
4848
private static final Pattern MD_LINK = Pattern.compile(
49-
"\\]\\((?!https?:|#|mailto:)([^)#\\s]+)(?:#[^)\\s]*)?\\)");
49+
"]\\((?!https?:|#|mailto:)([^)#\\s]+)(?:#[^)\\s]*)?\\)");
5050
private static final Pattern METHOD_CLAIM = Pattern.compile(
5151
"`([A-Z][A-Za-z0-9_]*+)\\.([a-z][A-Za-z0-9_]*+)\\(");
5252

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

Lines changed: 0 additions & 37 deletions
This file was deleted.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ void patched_i32_javaWriteJavaRead(@TempDir Path tmp) throws IOException {
6161
assertThat(decoded).containsExactly(data);
6262
}
6363

64+
@SuppressWarnings("SameParameterValue")
6465
private static int[] readIntColumn(Path file, String column) throws IOException {
6566
try (var vf = VortexReader.open(file, ReadRegistry.loadAll());
6667
var iter = vf.scan(ScanOptions.columns(column))) {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ private static double[] readDoubleColumn(Path file, String column) throws IOExce
195195
return doubles.stream().mapToDouble(Double::doubleValue).toArray();
196196
}
197197

198+
@SuppressWarnings("SameParameterValue")
198199
private static float[] readFloatColumn(Path file, String column) throws IOException {
199200
String uri = file.toAbsolutePath().toUri().toString();
200201
ScanOptions opts = ScanOptions.builder()
@@ -222,6 +223,7 @@ private static float[] readFloatColumn(Path file, String column) throws IOExcept
222223
return result;
223224
}
224225

226+
@SuppressWarnings("SameParameterValue")
225227
private static short[] readHalfColumn(Path file, String column) throws IOException {
226228
String uri = file.toAbsolutePath().toUri().toString();
227229
ScanOptions opts = ScanOptions.builder()
@@ -249,6 +251,7 @@ private static short[] readHalfColumn(Path file, String column) throws IOExcepti
249251
return result;
250252
}
251253

254+
@SuppressWarnings("SameParameterValue")
252255
private static int[] readIntColumn(Path file, String column) throws IOException {
253256
String uri = file.toAbsolutePath().toUri().toString();
254257
ScanOptions opts = ScanOptions.builder()
@@ -272,6 +275,7 @@ private static int[] readIntColumn(Path file, String column) throws IOException
272275
return ints.stream().mapToInt(Integer::intValue).toArray();
273276
}
274277

278+
@SuppressWarnings("SameParameterValue")
275279
private static String[] readStringColumn(Path file, String column) throws IOException {
276280
String uri = file.toAbsolutePath().toUri().toString();
277281
ScanOptions opts = ScanOptions.builder()
@@ -325,6 +329,7 @@ static Stream<float[]> f32ArrayProvider() {
325329
return RandomArrays.f32Arrays(30);
326330
}
327331

332+
@SuppressWarnings("SameParameterValue")
328333
private static boolean[] readBoolColumn(Path file, String column) throws IOException {
329334
String uri = file.toAbsolutePath().toUri().toString();
330335
ScanOptions opts = ScanOptions.builder()
@@ -368,6 +373,7 @@ private static long readRowCount(Path file) throws IOException {
368373
return count;
369374
}
370375

376+
@SuppressWarnings("SameParameterValue")
371377
private static long[] readListLongColumn(Path file, String column) throws IOException {
372378
String uri = file.toAbsolutePath().toUri().toString();
373379
ScanOptions opts = ScanOptions.builder()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ private static double round(double v) {
6161
return Math.round(v * 100.0) / 100.0;
6262
}
6363

64+
@SuppressWarnings("SameParameterValue")
6465
private static void writeOhlc(Path file, int totalRows, int batchSize) throws IOException {
6566
String uri = file.toAbsolutePath().toUri().toString();
6667
var rng = new Random(42L);
@@ -153,6 +154,7 @@ void writeOhlc10kToTmp_persistentFile() throws IOException {
153154

154155
/// Variant of writeOhlc that cycles through multiple ticker symbols so the
155156
/// resulting file exercises low-cardinality Utf8 column compression.
157+
@SuppressWarnings("SameParameterValue")
156158
private static void writeOhlcMultiSymbol(Path file, int totalRows, int batchSize,
157159
String[] symbols) throws IOException {
158160
String uri = file.toAbsolutePath().toUri().toString();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private static void recordPco(FbsArrayNode node, MemorySegment seg,
166166
stats.chunksPerArray.add(pm.chunkCount);
167167
stats.pagesPerArray.add(pm.pageCount);
168168
if (!pm.firstPageSizes.isEmpty() && stats.firstPageSizes.size() < 10) {
169-
stats.firstPageSizes.add(pm.firstPageSizes.get(0));
169+
stats.firstPageSizes.add(pm.firstPageSizes.getFirst());
170170
}
171171
if (pm.headerBytes != null) {
172172
stats.headerVersions.merge(hex(pm.headerBytes), 1, Integer::sum);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ private static void assertFilesMatch(Path result, Path oracle) throws IOExceptio
290290
/// @param parquet the parquet sibling
291291
/// @param out the output file to write CSV into
292292
/// @throws TestAbortedException if the oracle cannot read this parquet
293-
/// @throws IOException if writing fails
294-
private static void writeOracle(Path parquet, Path out) throws IOException {
293+
private static void writeOracle(Path parquet, Path out) {
295294
try (Writer writer = Files.newBufferedWriter(out)) {
296295
writeOracleCsv(parquet, writer);
297296
} catch (TestAbortedException e) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ void parquetImport_csvExport_matchesDirectParquetRead(@TempDir Path tmp) throws
6565
}
6666
}
6767

68+
@SuppressWarnings("SameParameterValue")
6869
private static void writeOracleCsv(Path parquet, Path csv) throws IOException {
6970
try (ParquetFileReader pfr = ParquetFileReader.open(InputFile.of(parquet));
7071
RowReader rows = pfr.rowReader();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class VortexInspectorIntegrationTest {
4343
NativeLoader.loadJni();
4444
}
4545

46+
@SuppressWarnings("SameParameterValue")
4647
private static void writeJni(Path file, int rows) throws IOException {
4748
String uri = file.toAbsolutePath().toUri().toString();
4849
var rng = new Random(42L);

0 commit comments

Comments
 (0)