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/01/30 01:04:37 UTC

[datasketches-java] branch fixCodeQLwarnings created (now 38ecc3cc)

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

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


      at 38ecc3cc Fix some recent CodeQL Warnings

This branch includes the following new commits:

     new 38ecc3cc Fix some recent CodeQL Warnings

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[datasketches-java] 01/01: Fix some recent CodeQL Warnings

Posted by le...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 38ecc3ccd2b646cb62561068a81e26c192d1144f
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Sun Jan 29 17:04:23 2023 -0800

    Fix some recent CodeQL Warnings
---
 .../theta/ConcurrentDirectQuickSelectSketchTest.java   | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/test/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketchTest.java b/src/test/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketchTest.java
index 594a6b59..e4c11228 100644
--- a/src/test/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketchTest.java
+++ b/src/test/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketchTest.java
@@ -164,7 +164,7 @@ public class ConcurrentDirectQuickSelectSketchTest {
     int lgK = 9;
     int k = 1 << lgK;
     int u = 2*k;
-    boolean estimating = (u > k);
+    //boolean estimating = (u > k);
 
     boolean useMem = true;
     SharedLocal sl = new SharedLocal(lgK, lgK, useMem);
@@ -177,7 +177,7 @@ public class ConcurrentDirectQuickSelectSketchTest {
     double sk1est = local.getEstimate();
     double sk1lb  = local.getLowerBound(2);
     double sk1ub  = local.getUpperBound(2);
-    assertEquals(local.isEstimationMode(), estimating);
+    assertTrue(local.isEstimationMode());
 
     Sketch local2 = Sketch.wrap(sl.wmem);
 
@@ -185,7 +185,7 @@ public class ConcurrentDirectQuickSelectSketchTest {
     assertEquals(local2.getLowerBound(2), sk1lb);
     assertEquals(local2.getUpperBound(2), sk1ub);
     assertEquals(local2.isEmpty(), false);
-    assertEquals(local2.isEstimationMode(), estimating);
+    assertTrue(local2.isEstimationMode());
   }
 
   @Test
@@ -193,7 +193,7 @@ public class ConcurrentDirectQuickSelectSketchTest {
     int lgK = 9;
     int k = 1 << lgK;
     int u = 4*k;
-    boolean estimating = (u > k);
+    //boolean estimating = (u > k);
     boolean useMem = true;
     SharedLocal sl = new SharedLocal(lgK, lgK, useMem);
     UpdateSketch shared = sl.shared;
@@ -212,7 +212,7 @@ public class ConcurrentDirectQuickSelectSketchTest {
     double localEst = local.getEstimate();
     double localLB  = local.getLowerBound(2);
     double localUB  = local.getUpperBound(2);
-    assertEquals(local.isEstimationMode(), estimating);
+    assertTrue(local.isEstimationMode());
 
     CompactSketch csk;
 
@@ -221,7 +221,7 @@ public class ConcurrentDirectQuickSelectSketchTest {
     assertEquals(csk.getLowerBound(2), localLB);
     assertEquals(csk.getUpperBound(2), localUB);
     assertFalse(csk.isEmpty());
-    assertEquals(csk.isEstimationMode(), estimating);
+    assertTrue(csk.isEstimationMode());
     assertEquals(csk.getClass().getSimpleName(), "HeapCompactSketch");
 
     csk = shared.compact(true, null);
@@ -229,7 +229,7 @@ public class ConcurrentDirectQuickSelectSketchTest {
     assertEquals(csk.getLowerBound(2), localLB);
     assertEquals(csk.getUpperBound(2), localUB);
     assertFalse(csk.isEmpty());
-    assertEquals(csk.isEstimationMode(), estimating);
+    assertTrue(csk.isEstimationMode());
     assertEquals(csk.getClass().getSimpleName(), "HeapCompactSketch");
 
     int bytes = shared.getCompactBytes();
@@ -242,7 +242,7 @@ public class ConcurrentDirectQuickSelectSketchTest {
     assertEquals(csk.getLowerBound(2), localLB);
     assertEquals(csk.getUpperBound(2), localUB);
     assertFalse(csk.isEmpty());
-    assertEquals(csk.isEstimationMode(), estimating);
+    assertTrue(csk.isEstimationMode());
     assertEquals(csk.getClass().getSimpleName(), "DirectCompactSketch");
 
     mem2.clear();
@@ -251,7 +251,7 @@ public class ConcurrentDirectQuickSelectSketchTest {
     assertEquals(csk.getLowerBound(2), localLB);
     assertEquals(csk.getUpperBound(2), localUB);
     assertFalse(csk.isEmpty());
-    assertEquals(csk.isEstimationMode(), estimating);
+    assertTrue(csk.isEstimationMode());
     assertEquals(csk.getClass().getSimpleName(), "DirectCompactSketch");
     csk.toString(false, true, 0, false);
   }


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