This is an automated email from the ASF dual-hosted git repository.

FrankChen021 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new d58381a806c build(deps): Upgrade to latest SpotBugs (#19576)
d58381a806c is described below

commit d58381a806c696a2618eae21a9fac5be759b8383
Author: Andreas Maechler <[email protected]>
AuthorDate: Fri Jul 17 21:28:27 2026 -0600

    build(deps): Upgrade to latest SpotBugs (#19576)
    
    * Upgrade SpotBugs to 4.10.2
    
    Bump spotbugs-maven-plugin to 4.10.2.0 (SpotBugs core 4.10.2) and drop the
    explicit 4.8.6 core override so the plugin's bundled analyzer is used.
    
    4.10.2 is the first 4.10 release safe to adopt: 4.10.0 was never published
    due to a release error, and 4.10.0/4.10.1 shipped a Saxon-HE build that 
broke
    Java 11 compatibility, which 4.10.2 restored.
    
    * Exclude detector patterns new in SpotBugs 4.9 and 4.10
    
    SpotBugs 4.9 and 4.10 add new detectors. Running spotbugs:check across all
    modules surfaced findings from the following new patterns:
    
    - 4.9: AT_* atomicity patterns and HSM_HIDING_METHOD, excluded project-wide
      alongside the existing suppressions (the flagged sites rely on external
      synchronization or hide methods by design).
    - 4.10: 70 USO_* unsafe-synchronization findings (CERT LCK00-J) from the new
      FindImproperSynchronization detector, excluded project-wide; Druid relies 
on
      intrinsic synchronization intentionally.
    
    NN_NAKED_NOTIFY and NCR_NOT_PROPERLY_CHECKED_READ each flag only a handful 
of
    false positives, so they are suppressed with targeted matches rather than
    disabled globally, keeping the detectors active for the rest of the 
codebase.
    
    * Remove suppressions SpotBugs reports as useless
    
    SpotBugs 4.9 UselessSuppressionDetector flags these two @SuppressFBWarnings
    annotations as unnecessary; the underlying patterns are no longer reported 
at
    these sites.
---
 codestyle/spotbugs-exclude.xml                     | 25 ++++++++++++++++++++++
 pom.xml                                            | 10 +--------
 .../java/org/apache/druid/math/expr/Function.java  |  1 -
 .../segment/index/IndexedUtf8ValueIndexes.java     |  1 -
 4 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/codestyle/spotbugs-exclude.xml b/codestyle/spotbugs-exclude.xml
index 9776e554b8e..464ea99a2e6 100644
--- a/codestyle/spotbugs-exclude.xml
+++ b/codestyle/spotbugs-exclude.xml
@@ -81,8 +81,28 @@
             <Class name="org.apache.druid.msq.indexing.MSQWorkerTaskLauncher" 
/>
         </And>
     </Match>
+    <Match>
+        <!-- unzip() drains and discards the rest of the stream (workaround 
for #6905); the read buffer is intentionally unused -->
+        <And>
+            <Bug pattern="NCR_NOT_PROPERLY_CHECKED_READ" />
+            <Class name="org.apache.druid.utils.CompressionUtils" />
+        </And>
+    </Match>
+    <Match>
+        <!-- notifyAll() wakes waiters after state is mutated under the same 
lock, either in the caller or via @GuardedBy concurrent structures -->
+        <And>
+            <Bug pattern="NN_NAKED_NOTIFY" />
+            <Or>
+                <Class 
name="org.apache.druid.indexing.overlord.hrtr.HttpRemoteTaskRunner" />
+                <Class 
name="org.apache.druid.metadata.segment.cache.HeapMemorySegmentMetadataCache" />
+            </Or>
+        </And>
+    </Match>
 
+    <Bug pattern="AT_NONATOMIC_64BIT_PRIMITIVE"/>
+    <Bug pattern="AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE"/>
     <Bug pattern="AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION"/>
+    <Bug pattern="AT_STALE_THREAD_WRITE_OF_PRIMITIVE"/>
     <Bug pattern="BC_UNCONFIRMED_CAST"/>
     <Bug pattern="BIT_SIGNED_CHECK_HIGH_BIT"/>
     <Bug pattern="BX_UNBOXING_IMMEDIATELY_REBOXED"/>
@@ -100,6 +120,7 @@
     <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ"/>
     <Bug pattern="FE_FLOATING_POINT_EQUALITY"/>
     <Bug pattern="HE_EQUALS_USE_HASHCODE"/>
+    <Bug pattern="HSM_HIDING_METHOD"/>
     <Bug pattern="IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD"/>
     <Bug pattern="ICAST_IDIV_CAST_TO_DOUBLE"/>
     <Bug pattern="ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL"/>
@@ -137,6 +158,10 @@
     <Bug pattern="SWL_SLEEP_WITH_LOCK_HELD"/>
     <Bug pattern="UL_UNRELEASED_LOCK_EXCEPTION_PATH"/>
     <Bug pattern="URF_UNREAD_FIELD"/>
+    <Bug pattern="USO_UNSAFE_ACCESSIBLE_OBJECT_SYNCHRONIZATION"/>
+    <Bug pattern="USO_UNSAFE_EXPOSED_OBJECT_SYNCHRONIZATION"/>
+    <Bug pattern="USO_UNSAFE_METHOD_SYNCHRONIZATION"/>
+    <Bug pattern="USO_UNSAFE_OBJECT_SYNCHRONIZATION"/>
     <Bug pattern="CT_CONSTRUCTOR_THROW"/>
     <Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR"/>
     <Bug pattern="SING_SINGLETON_INDIRECTLY_IMPLEMENTS_CLONEABLE"/>
diff --git a/pom.xml b/pom.xml
index 538a22fa66a..53b68843c0a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1727,15 +1727,7 @@
             <plugin>
                 <groupId>com.github.spotbugs</groupId>
                 <artifactId>spotbugs-maven-plugin</artifactId>
-                <version>4.9.3.2</version>
-                <dependencies>
-                    <!-- overwrite dependency on spotbugs if you want to 
specify the version of spotbugs -->
-                    <dependency>
-                        <groupId>com.github.spotbugs</groupId>
-                        <artifactId>spotbugs</artifactId>
-                        <version>4.8.6</version>
-                    </dependency>
-                </dependencies>
+                <version>4.10.2.0</version>
                 <configuration>
                     
<excludeFilterFile>codestyle/spotbugs-exclude.xml</excludeFilterFile>
                     <maxHeap>768</maxHeap>
diff --git a/processing/src/main/java/org/apache/druid/math/expr/Function.java 
b/processing/src/main/java/org/apache/druid/math/expr/Function.java
index 15f0efddd53..3dd9e61b530 100644
--- a/processing/src/main/java/org/apache/druid/math/expr/Function.java
+++ b/processing/src/main/java/org/apache/druid/math/expr/Function.java
@@ -2172,7 +2172,6 @@ public interface Function extends NamedFunction
       return "case_searched";
     }
 
-    @SuppressFBWarnings("IM_BAD_CHECK_FOR_ODD")
     @Override
     public ExprEval apply(final List<Expr> args, final Expr.ObjectBinding 
bindings)
     {
diff --git 
a/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java
 
b/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java
index e0ca5f5780b..8cb68d59596 100644
--- 
a/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java
+++ 
b/processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueIndexes.java
@@ -132,7 +132,6 @@ public final class IndexedUtf8ValueIndexes<TDictionary 
extends Indexed<ByteBuffe
     );
   }
 
-  @SuppressFBWarnings("NP_NONNULL_PARAM_VIOLATION")
   @Override
   public BitmapColumnIndex forSortedValuesUtf8(List<ByteBuffer> 
sortedValuesUtf8)
   {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to