This is an automated email from the ASF dual-hosted git repository. leerho pushed a commit to branch ffm_phase2 in repository https://gitbox.apache.org/repos/asf/datasketches-java.git
commit 2b2f56276e32bd355359efbb09b3c866686a26aa Author: Lee Rhodes <lee...@gmail.com> AuthorDate: Mon Jun 30 11:53:01 2025 -0700 Removed some unnecessary SuppressFBWarnings. Added some new SuppressFBWarnings due to new detection capabilities in SpotBugs. --- src/main/java/org/apache/datasketches/kll/KllDoublesSketch.java | 2 -- src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java | 2 -- src/main/java/org/apache/datasketches/kll/KllLongsSketch.java | 2 -- .../datasketches/theta/ConcurrentDirectQuickSelectSketch.java | 8 +++++--- .../datasketches/theta/ConcurrentHeapQuickSelectSketch.java | 6 +++--- .../org/apache/datasketches/theta/ConcurrentHeapThetaBuffer.java | 2 +- .../apache/datasketches/theta/ConcurrentPropagationService.java | 1 - src/main/java/org/apache/datasketches/tuple/AnotB.java | 1 - 8 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/apache/datasketches/kll/KllDoublesSketch.java b/src/main/java/org/apache/datasketches/kll/KllDoublesSketch.java index 01608ca02..ba3b6cf60 100644 --- a/src/main/java/org/apache/datasketches/kll/KllDoublesSketch.java +++ b/src/main/java/org/apache/datasketches/kll/KllDoublesSketch.java @@ -30,7 +30,6 @@ import java.util.Objects; import org.apache.datasketches.common.ArrayOfItemsSerDe; import org.apache.datasketches.common.SketchesArgumentException; -import org.apache.datasketches.common.SuppressFBWarnings; import org.apache.datasketches.kll.KllDirectDoublesSketch.KllDirectCompactDoublesSketch; import org.apache.datasketches.memory.DefaultMemoryRequestServer; import org.apache.datasketches.memory.Memory; @@ -528,7 +527,6 @@ public abstract class KllDoublesSketch extends KllSketch implements QuantilesDou // SORTED VIEW @Override - @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "OK in this case.") public DoublesSketchSortedView getSortedView() { refreshSortedView(); return doublesSV; diff --git a/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java b/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java index cf282c872..a7f0d99ae 100644 --- a/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java +++ b/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java @@ -30,7 +30,6 @@ import java.util.Objects; import org.apache.datasketches.common.ArrayOfItemsSerDe; import org.apache.datasketches.common.SketchesArgumentException; -import org.apache.datasketches.common.SuppressFBWarnings; import org.apache.datasketches.kll.KllDirectFloatsSketch.KllDirectCompactFloatsSketch; import org.apache.datasketches.memory.DefaultMemoryRequestServer; import org.apache.datasketches.memory.Memory; @@ -528,7 +527,6 @@ public abstract class KllFloatsSketch extends KllSketch implements QuantilesFloa // SORTED VIEW @Override - @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "OK in this case.") public FloatsSketchSortedView getSortedView() { refreshSortedView(); return floatsSV; diff --git a/src/main/java/org/apache/datasketches/kll/KllLongsSketch.java b/src/main/java/org/apache/datasketches/kll/KllLongsSketch.java index 827f825f8..b9d57dc9e 100644 --- a/src/main/java/org/apache/datasketches/kll/KllLongsSketch.java +++ b/src/main/java/org/apache/datasketches/kll/KllLongsSketch.java @@ -30,7 +30,6 @@ import java.util.Objects; import org.apache.datasketches.common.ArrayOfItemsSerDe; import org.apache.datasketches.common.SketchesArgumentException; -import org.apache.datasketches.common.SuppressFBWarnings; import org.apache.datasketches.kll.KllDirectLongsSketch.KllDirectCompactLongsSketch; import org.apache.datasketches.memory.DefaultMemoryRequestServer; import org.apache.datasketches.memory.Memory; @@ -528,7 +527,6 @@ public abstract class KllLongsSketch extends KllSketch implements QuantilesLongs // SORTED VIEW @Override - @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "OK in this case.") public LongsSketchSortedView getSortedView() { refreshSortedView(); return longsSV; diff --git a/src/main/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketch.java b/src/main/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketch.java index d151ffdf5..9230f3456 100644 --- a/src/main/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketch.java +++ b/src/main/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketch.java @@ -252,14 +252,16 @@ final class ConcurrentDirectQuickSelectSketch extends DirectQuickSelectSketch /** * Advances the epoch while there is no background propagation * This ensures a propagation invoked before the reset cannot affect the sketch after the reset - * is completed. Ignore VO_VOLATILE_INCREMENT findbugs warning, it is False Positive. + * is completed. Ignore AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE and AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE + * SpotBugs warnings, they are False Positive. */ - @SuppressFBWarnings(value = "VO_VOLATILE_INCREMENT", justification = "Likely False Positive, Fix Later") + + @SuppressFBWarnings(value = {"AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE", "VO_VOLATILE_INCREMENT"}, + justification = "Likely False Positive, Fix Later") private void advanceEpoch() { awaitBgPropagationTermination(); startEagerPropagation(); ConcurrentPropagationService.resetExecutorService(Thread.currentThread().threadId()); - //no inspection NonAtomicOperationOnVolatileField // this increment of a volatile field is done within the scope of the propagation // synchronization and hence is done by a single thread. epoch_++; diff --git a/src/main/java/org/apache/datasketches/theta/ConcurrentHeapQuickSelectSketch.java b/src/main/java/org/apache/datasketches/theta/ConcurrentHeapQuickSelectSketch.java index e4cc3a157..e01e01761 100644 --- a/src/main/java/org/apache/datasketches/theta/ConcurrentHeapQuickSelectSketch.java +++ b/src/main/java/org/apache/datasketches/theta/ConcurrentHeapQuickSelectSketch.java @@ -249,15 +249,15 @@ final class ConcurrentHeapQuickSelectSketch extends HeapQuickSelectSketch * This ensures a propagation invoked before the reset cannot affect the sketch after the reset * is completed. */ - @SuppressFBWarnings(value = "VO_VOLATILE_INCREMENT", justification = "Likely False Positive, Fix Later") + @SuppressFBWarnings(value = {"VO_VOLATILE_INCREMENT", "AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE"}, + justification = "Likely False Positive, Fix Later") private void advanceEpoch() { awaitBgPropagationTermination(); startEagerPropagation(); ConcurrentPropagationService.resetExecutorService(Thread.currentThread().threadId()); - //no inspection NonAtomicOperationOnVolatileField // this increment of a volatile field is done within the scope of the propagation // synchronization and hence is done by a single thread - // Ignore a FindBugs warning + // Ignore the SpotBugs warnings epoch_++; endPropagation(null, true); initBgPropagationService(); diff --git a/src/main/java/org/apache/datasketches/theta/ConcurrentHeapThetaBuffer.java b/src/main/java/org/apache/datasketches/theta/ConcurrentHeapThetaBuffer.java index d3b706aa8..5158e1c80 100644 --- a/src/main/java/org/apache/datasketches/theta/ConcurrentHeapThetaBuffer.java +++ b/src/main/java/org/apache/datasketches/theta/ConcurrentHeapThetaBuffer.java @@ -59,7 +59,7 @@ final class ConcurrentHeapThetaBuffer extends HeapQuickSelectSketch { // A flag indicating whether the shared sketch is in shared mode and requires eager propagation // Initially this is true. Once it is set to false (estimation mode) it never flips back. - private boolean isExactMode; + private volatile boolean isExactMode; // A flag to indicate if we expect the propagated data to be ordered private final boolean propagateOrderedCompact; diff --git a/src/main/java/org/apache/datasketches/theta/ConcurrentPropagationService.java b/src/main/java/org/apache/datasketches/theta/ConcurrentPropagationService.java index b3c0bf21d..aa422d2c5 100644 --- a/src/main/java/org/apache/datasketches/theta/ConcurrentPropagationService.java +++ b/src/main/java/org/apache/datasketches/theta/ConcurrentPropagationService.java @@ -41,7 +41,6 @@ final class ConcurrentPropagationService { } //Factory: Get the singleton - @SuppressFBWarnings(value = "SSD_DO_NOT_USE_INSTANCE_LOCK_ON_SHARED_STATIC_DATA", justification = "Fix later") private static ConcurrentPropagationService getInstance() { if (instance == null) { synchronized (ConcurrentPropagationService.class) { diff --git a/src/main/java/org/apache/datasketches/tuple/AnotB.java b/src/main/java/org/apache/datasketches/tuple/AnotB.java index fed710bdd..a6d33a7e6 100644 --- a/src/main/java/org/apache/datasketches/tuple/AnotB.java +++ b/src/main/java/org/apache/datasketches/tuple/AnotB.java @@ -67,7 +67,6 @@ import org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase; * * @author Lee Rhodes */ -@SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "Defer fix") public final class AnotB<S extends Summary> { private boolean empty_ = true; private long thetaLong_ = Long.MAX_VALUE; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@datasketches.apache.org For additional commands, e-mail: commits-h...@datasketches.apache.org