You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2023/06/04 20:51:04 UTC

[datasketches-java] branch fix_spotbugs updated: Some newly detected SpotBugs issues resolved.

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

leerho pushed a commit to branch fix_spotbugs
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git


The following commit(s) were added to refs/heads/fix_spotbugs by this push:
     new 0b2e6c1e Some newly detected SpotBugs issues resolved.
0b2e6c1e is described below

commit 0b2e6c1e835de3b00fd0bac36a1b10d4a2546ac7
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Sun Jun 4 13:50:52 2023 -0700

    Some newly detected SpotBugs issues resolved.
---
 .../java/org/apache/datasketches/sampling/ReservoirItemsSketch.java     | 2 +-
 src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java | 2 +-
 .../java/org/apache/datasketches/sampling/ReservoirLongsSketch.java     | 2 +-
 src/main/java/org/apache/datasketches/sampling/ReservoirLongsUnion.java | 2 +-
 src/main/java/org/apache/datasketches/theta/CompactOperations.java      | 1 -
 5 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/datasketches/sampling/ReservoirItemsSketch.java b/src/main/java/org/apache/datasketches/sampling/ReservoirItemsSketch.java
index a00a2c09..3a658036 100644
--- a/src/main/java/org/apache/datasketches/sampling/ReservoirItemsSketch.java
+++ b/src/main/java/org/apache/datasketches/sampling/ReservoirItemsSketch.java
@@ -223,7 +223,7 @@ public final class ReservoirItemsSketch<T> {
     final boolean preLongsEqMin = (numPreLongs == Family.RESERVOIR.getMinPreLongs());
     final boolean preLongsEqMax = (numPreLongs == Family.RESERVOIR.getMaxPreLongs());
 
-    if (!preLongsEqMin & !preLongsEqMax) {
+    if (!preLongsEqMin && !preLongsEqMax) {
       throw new SketchesArgumentException(
               "Possible corruption: Non-empty sketch with only "
                       + Family.RESERVOIR.getMinPreLongs() + " preLong(s)");
diff --git a/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java b/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java
index 46d4056d..9f4bd5f3 100644
--- a/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java
+++ b/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java
@@ -104,7 +104,7 @@ public final class ReservoirItemsUnion<T> {
     final boolean preLongsEqMin = (numPreLongs == Family.RESERVOIR_UNION.getMinPreLongs());
     final boolean preLongsEqMax = (numPreLongs == Family.RESERVOIR_UNION.getMaxPreLongs());
 
-    if (!preLongsEqMin & !preLongsEqMax) {
+    if (!preLongsEqMin && !preLongsEqMax) {
       throw new SketchesArgumentException("Possible corruption: Non-empty union with only "
           + Family.RESERVOIR_UNION.getMinPreLongs() + "preLongs");
     }
diff --git a/src/main/java/org/apache/datasketches/sampling/ReservoirLongsSketch.java b/src/main/java/org/apache/datasketches/sampling/ReservoirLongsSketch.java
index 60d27750..acdfd303 100644
--- a/src/main/java/org/apache/datasketches/sampling/ReservoirLongsSketch.java
+++ b/src/main/java/org/apache/datasketches/sampling/ReservoirLongsSketch.java
@@ -204,7 +204,7 @@ public final class ReservoirLongsSketch {
     final boolean preLongsEqMin = (numPreLongs == Family.RESERVOIR.getMinPreLongs());
     final boolean preLongsEqMax = (numPreLongs == Family.RESERVOIR.getMaxPreLongs());
 
-    if (!preLongsEqMin & !preLongsEqMax) {
+    if (!preLongsEqMin && !preLongsEqMax) {
       throw new SketchesArgumentException("Possible corruption: Non-empty sketch with only "
           + Family.RESERVOIR.getMinPreLongs() + "preLongs");
     }
diff --git a/src/main/java/org/apache/datasketches/sampling/ReservoirLongsUnion.java b/src/main/java/org/apache/datasketches/sampling/ReservoirLongsUnion.java
index ee279a73..f8d9d1eb 100644
--- a/src/main/java/org/apache/datasketches/sampling/ReservoirLongsUnion.java
+++ b/src/main/java/org/apache/datasketches/sampling/ReservoirLongsUnion.java
@@ -95,7 +95,7 @@ public final class ReservoirLongsUnion {
     final boolean preLongsEqMin = (numPreLongs == Family.RESERVOIR_UNION.getMinPreLongs());
     final boolean preLongsEqMax = (numPreLongs == Family.RESERVOIR_UNION.getMaxPreLongs());
 
-    if (!preLongsEqMin & !preLongsEqMax) {
+    if (!preLongsEqMin && !preLongsEqMax) {
       throw new SketchesArgumentException("Possible corruption: Non-empty union with only "
           + Family.RESERVOIR_UNION.getMinPreLongs() + "preLongs");
     }
diff --git a/src/main/java/org/apache/datasketches/theta/CompactOperations.java b/src/main/java/org/apache/datasketches/theta/CompactOperations.java
index 726a2520..42fe9fdf 100644
--- a/src/main/java/org/apache/datasketches/theta/CompactOperations.java
+++ b/src/main/java/org/apache/datasketches/theta/CompactOperations.java
@@ -123,7 +123,6 @@ final class CompactOperations {
     final int srcPreLongs = extractPreLongs(srcMem);
     final int srcSerVer = extractSerVer(srcMem); //not used
     final int srcFamId = extractFamilyID(srcMem);
-    final Family srcFamily = Family.idToFamily(srcFamId);
     final int srcLgArrLongs = extractLgArrLongs(srcMem);
     final int srcFlags = extractFlags(srcMem);
     final short srcSeedHash = (short) extractSeedHash(srcMem);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org