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 2020/07/02 17:59:57 UTC
[incubator-datasketches-java] 01/01: Small changes needed in master
before the next set of PRs.
This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch SmallCleanup
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-java.git
commit fd4c995a9913bdbbeff619a18cdb6d6eb8201bbe
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Thu Jul 2 10:59:26 2020 -0700
Small changes needed in master before the next set of PRs.
---
src/main/java/org/apache/datasketches/theta/Sketch.java | 2 +-
.../tuple/arrayofdoubles/ArrayOfDoublesQuickSelectSketch.java | 2 +-
.../java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java | 2 ++
.../apache/datasketches/tuple/adouble/AdoubleIntersectionTest.java | 1 +
.../org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java | 3 ++-
.../apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java | 5 ++---
tools/FindBugsExcludeFilter.xml | 3 +--
7 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/apache/datasketches/theta/Sketch.java b/src/main/java/org/apache/datasketches/theta/Sketch.java
index 8acfdaf..7e7be3a 100644
--- a/src/main/java/org/apache/datasketches/theta/Sketch.java
+++ b/src/main/java/org/apache/datasketches/theta/Sketch.java
@@ -634,7 +634,7 @@ public abstract class Sketch {
* @param curCount the given curCount
* @param thetaLong the given thetaLong
* @return thetaLong
- */
+ */ //This handles #4 above
static final long correctThetaOnCompact(final boolean empty, final int curCount,
final long thetaLong) {
return (empty && (curCount == 0) && (thetaLong < Long.MAX_VALUE)) ? Long.MAX_VALUE : thetaLong;
diff --git a/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesQuickSelectSketch.java b/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesQuickSelectSketch.java
index 299b517..c4de929 100644
--- a/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesQuickSelectSketch.java
+++ b/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesQuickSelectSketch.java
@@ -104,7 +104,7 @@ abstract class ArrayOfDoublesQuickSelectSketch extends ArrayOfDoublesUpdatableSk
*/
static int getMaxBytes(final int nomEntries, final int numValues) {
return ENTRIES_START
- + ((SIZE_OF_KEY_BYTES + (SIZE_OF_VALUE_BYTES * numValues)) * ceilingPowerOf2(nomEntries) * 2);
+ + (SIZE_OF_KEY_BYTES + SIZE_OF_VALUE_BYTES * numValues) * ceilingPowerOf2(nomEntries) * 2;
}
// non-public methods below
diff --git a/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java b/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java
index 360a91b..847ec83 100644
--- a/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java
@@ -44,6 +44,7 @@ public class AdoubleAnotBTest {
private final DoubleSummary.Mode mode = Mode.Sum;
private final Results results = new Results();
+ @SuppressWarnings("deprecation")
private static void threeMethodsWithTheta(
final AnotB<DoubleSummary> aNotB,
final Sketch<DoubleSummary> skA,
@@ -147,6 +148,7 @@ public class AdoubleAnotBTest {
/*****************************************/
+ @SuppressWarnings("deprecation")
@Test
public void aNotBNullEmptyCombinations() {
AnotB<DoubleSummary> aNotB = new AnotB<>();
diff --git a/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleIntersectionTest.java b/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleIntersectionTest.java
index 25359ca..4dc75f7 100644
--- a/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleIntersectionTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleIntersectionTest.java
@@ -82,6 +82,7 @@ public class AdoubleIntersectionTest {
Assert.assertEquals(result.getUpperBound(1), 0.0);
}
+ @SuppressWarnings("deprecation")
@Test
public void intersectionExactMode() {
UpdatableSketch<Double, DoubleSummary> sketch1 =
diff --git a/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java b/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java
index 217b066..5cd7b98 100644
--- a/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java
@@ -70,6 +70,7 @@ public class IntegerSketchTest {
assertEquals(csk.getEstimate(), K * 1.0, K * .03);
}
+ @SuppressWarnings("deprecation")
@Test
public void aNotBTest() {
int lgK = 4;
@@ -82,7 +83,7 @@ public class IntegerSketchTest {
a1Sk1.update(i, 1);
}
anotb.update(a1Sk1, a1Sk2);
- CompactSketch<IntegerSummary> cSk = anotb.getResult();
+ anotb.getResult();
}
@Test
diff --git a/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java b/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java
index 908079f..43b4034 100644
--- a/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java
@@ -22,14 +22,13 @@ package org.apache.datasketches.tuple.strings;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
-import org.testng.annotations.Test;
-
import org.apache.datasketches.memory.WritableMemory;
import org.apache.datasketches.tuple.AnotB;
import org.apache.datasketches.tuple.CompactSketch;
import org.apache.datasketches.tuple.Intersection;
import org.apache.datasketches.tuple.SketchIterator;
import org.apache.datasketches.tuple.Union;
+import org.testng.annotations.Test;
/**
* @author Lee Rhodes
@@ -38,6 +37,7 @@ import org.apache.datasketches.tuple.Union;
public class ArrayOfStringsSketchTest {
private static final String LS = System.getProperty("line.separator");
+ @SuppressWarnings("deprecation")
@Test
public void checkSketch() {
ArrayOfStringsSketch sketch1 = new ArrayOfStringsSketch();
@@ -57,7 +57,6 @@ public class ArrayOfStringsSketchTest {
String[] strArr3 = {"g", "h" };
sketch2.update(strArr3, strArr3);
-
Union<ArrayOfStringsSummary> union = new Union<>(new ArrayOfStringsSummarySetOperations());
union.update(sketch1);
union.update(sketch2);
diff --git a/tools/FindBugsExcludeFilter.xml b/tools/FindBugsExcludeFilter.xml
index f090992..ee747b6 100644
--- a/tools/FindBugsExcludeFilter.xml
+++ b/tools/FindBugsExcludeFilter.xml
@@ -1,5 +1,3 @@
-<FindBugsFilter> <!-- sketches-core -->
-
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -18,6 +16,7 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
+<FindBugsFilter> <!-- sketches-core -->
<!-- Too many false positives to be useful. I could not make it happy :( -->
<Match>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org