From a27d05d97bb78f9bf74200199de0dc8412e8990e Mon Sep 17 00:00:00 2001 From: Vitaly Terentyev Date: Tue, 20 Oct 2026 13:57:42 +0400 Subject: [PATCH 1/7] Remove redundant finalize method --- .../jms/src/main/java/org/apache/beam/sdk/io/jms/JmsIO.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sdks/java/io/jms/src/main/java/org/apache/beam/sdk/io/jms/JmsIO.java b/sdks/java/io/jms/src/main/java/org/apache/beam/sdk/io/jms/JmsIO.java index 1b9d0ce5acd0..c007439c88e8 100644 --- a/sdks/java/io/jms/src/main/java/org/apache/beam/sdk/io/jms/JmsIO.java +++ b/sdks/java/io/jms/src/main/java/org/apache/beam/sdk/io/jms/JmsIO.java @@ -1001,12 +1001,6 @@ private void closeAutoscaler() { LOG.error("Error closing autoscaler", e); } } - - @Override - @SuppressWarnings({"Finalize", "removal"}) - protected void finalize() { - doClose(); - } } /** From ed667a6211382d0c6bec589b519cf500a8a2ac5b Mon Sep 17 00:00:00 2001 From: Vitaly Terentyev Date: Tue, 20 Oct 2026 14:17:43 +0400 Subject: [PATCH 2/7] Fix instanceof --- .../java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java b/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java index 90f987859d79..502c185d09f8 100644 --- a/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java +++ b/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java @@ -148,8 +148,7 @@ public int getInt(int rowId) { public long getLong(int rowId) { if (dataType instanceof TimestampType) { Object val = rows.get(rowId).getValue(fieldIndex); - if (val instanceof java.time.Instant) { - java.time.Instant inst = (java.time.Instant) val; + if (val instanceof java.time.Instant inst) { return inst.getEpochSecond() * 1_000_000L + inst.getNano() / 1000L; } else { throw new RuntimeException( From 51e0a1f066a57668ce8d7a2bab4a49799a7a32bd Mon Sep 17 00:00:00 2001 From: Vitaly Terentyev Date: Tue, 20 Oct 2026 15:58:31 +0400 Subject: [PATCH 3/7] Suppress warning --- .../org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java b/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java index 502c185d09f8..4c707f0394f2 100644 --- a/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java +++ b/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java @@ -144,11 +144,13 @@ public int getInt(int rowId) { return rows.get(rowId).getInt32(fieldIndex); } + @SuppressWarnings("PatternMatchingInstanceof") @Override public long getLong(int rowId) { if (dataType instanceof TimestampType) { Object val = rows.get(rowId).getValue(fieldIndex); - if (val instanceof java.time.Instant inst) { + if (val instanceof java.time.Instant) { + java.time.Instant inst = (java.time.Instant) val; return inst.getEpochSecond() * 1_000_000L + inst.getNano() / 1000L; } else { throw new RuntimeException( From 9165340175ab4a2d43d090551412c5f6d5f1b7d2 Mon Sep 17 00:00:00 2001 From: Vitaly Terentyev Date: Tue, 20 Oct 2026 16:27:48 +0400 Subject: [PATCH 4/7] Suppress warning --- .../src/test/java/org/apache/beam/sdk/io/iceberg/AddFilesIT.java | 1 + 1 file changed, 1 insertion(+) diff --git a/sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/AddFilesIT.java b/sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/AddFilesIT.java index 276ea4b0ee90..38d07d75cf45 100644 --- a/sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/AddFilesIT.java +++ b/sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/AddFilesIT.java @@ -220,6 +220,7 @@ public void setup() throws IOException { * GCS reports server-side errors (5xx) without a cause, so log what identifies the request to GCS * support and the bucket's notification count at the time. */ + @SuppressWarnings("PatternMatchingInstanceof") private void logNotificationFailure(StorageException e) { @Nullable String requestId = null; Throwable cause = e.getCause(); From 754dc7b86ddbebdd65debe595a8389a69f1a7154 Mon Sep 17 00:00:00 2001 From: Vitaly Terentyev Date: Tue, 20 Oct 2026 21:11:35 +0400 Subject: [PATCH 5/7] Add exclusion --- .../main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy index 17fc16e9967f..12c6badc4bfd 100644 --- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy @@ -1641,6 +1641,7 @@ class BeamModulePlugin implements Plugin { "StringCaseLocaleUsage", // DoFn methods are executed reflectively at pipeline runtime "UnusedMethod", + "PatternMatchingInstanceOf" ] disabledChecks.each { options.errorprone.errorproneArgs.add("-Xep:${it}:OFF") From 802d0e0a985f40a9b566716ce184a3521e285c37 Mon Sep 17 00:00:00 2001 From: Vitaly Terentyev Date: Tue, 20 Oct 2026 21:22:39 +0400 Subject: [PATCH 6/7] Fix typo --- .../main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy index 12c6badc4bfd..c545f3cc7ef8 100644 --- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy @@ -1641,7 +1641,7 @@ class BeamModulePlugin implements Plugin { "StringCaseLocaleUsage", // DoFn methods are executed reflectively at pipeline runtime "UnusedMethod", - "PatternMatchingInstanceOf" + "PatternMatchingInstanceof" ] disabledChecks.each { options.errorprone.errorproneArgs.add("-Xep:${it}:OFF") From 8b7a63c9cd571aac1d3376c8a7f540dd4c1c5f15 Mon Sep 17 00:00:00 2001 From: Vitaly Terentyev Date: Tue, 20 Oct 2026 21:45:01 +0400 Subject: [PATCH 7/7] Remove suppress --- .../java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java | 1 - .../src/test/java/org/apache/beam/sdk/io/iceberg/AddFilesIT.java | 1 - 2 files changed, 2 deletions(-) diff --git a/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java b/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java index 4c707f0394f2..90f987859d79 100644 --- a/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java +++ b/sdks/java/io/delta/src/test/java/org/apache/beam/sdk/io/delta/DeltaWriteTestUtils.java @@ -144,7 +144,6 @@ public int getInt(int rowId) { return rows.get(rowId).getInt32(fieldIndex); } - @SuppressWarnings("PatternMatchingInstanceof") @Override public long getLong(int rowId) { if (dataType instanceof TimestampType) { diff --git a/sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/AddFilesIT.java b/sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/AddFilesIT.java index 38d07d75cf45..276ea4b0ee90 100644 --- a/sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/AddFilesIT.java +++ b/sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/AddFilesIT.java @@ -220,7 +220,6 @@ public void setup() throws IOException { * GCS reports server-side errors (5xx) without a cause, so log what identifies the request to GCS * support and the bucket's notification count at the time. */ - @SuppressWarnings("PatternMatchingInstanceof") private void logNotificationFailure(StorageException e) { @Nullable String requestId = null; Throwable cause = e.getCause();