diff --git a/src/main/java/com/yahoo/sketches/theta/Sketch.java b/src/main/java/com/yahoo/sketches/theta/Sketch.java index 7b78b0a88..36c185acd 100644 --- a/src/main/java/com/yahoo/sketches/theta/Sketch.java +++ b/src/main/java/com/yahoo/sketches/theta/Sketch.java @@ -644,8 +644,6 @@ private static final boolean estMode(final long thetaLong, final boolean empty) /** * Instantiates a Heap Sketch from Memory. SerVer 1 & 2 already handled. - * @param famID the Family ID - * @param ordered true if the sketch is of the Compact family and ordered * @param srcMem See Memory * @param seed See Update Hash Seed. * The seed required to instantiate a non-compact sketch. diff --git a/src/main/java/com/yahoo/sketches/theta/UnionImpl.java b/src/main/java/com/yahoo/sketches/theta/UnionImpl.java index 8b5dfcb98..0c84aa72c 100644 --- a/src/main/java/com/yahoo/sketches/theta/UnionImpl.java +++ b/src/main/java/com/yahoo/sketches/theta/UnionImpl.java @@ -87,8 +87,8 @@ private UnionImpl(final UpdateSketch gadget, final long seed) { */ static UnionImpl initNewHeapInstance(final int lgNomLongs, final long seed, final float p, final ResizeFactor rf) { - final UpdateSketch gadget = new HeapQuickSelectSketch( - lgNomLongs, seed, p, rf, true); //create with UNION family + final UpdateSketch gadget = //create with UNION family + new HeapQuickSelectSketch(lgNomLongs, seed, p, rf, true); final UnionImpl unionImpl = new UnionImpl(gadget, seed); unionImpl.unionThetaLong_ = gadget.getThetaLong(); unionImpl.unionEmpty_ = gadget.isEmpty(); @@ -114,8 +114,8 @@ static UnionImpl initNewDirectInstance( final ResizeFactor rf, final MemoryRequestServer memReqSvr, final WritableMemory dstMem) { - final UpdateSketch gadget = new DirectQuickSelectSketch( - lgNomLongs, seed, p, rf, memReqSvr, dstMem, true); //create with UNION family + final UpdateSketch gadget = //create with UNION family + new DirectQuickSelectSketch(lgNomLongs, seed, p, rf, memReqSvr, dstMem, true); final UnionImpl unionImpl = new UnionImpl(gadget, seed); unionImpl.unionThetaLong_ = gadget.getThetaLong(); unionImpl.unionEmpty_ = gadget.isEmpty(); diff --git a/src/main/java/com/yahoo/sketches/tuple/adouble/DoubleSummaryDeserializer.java b/src/main/java/com/yahoo/sketches/tuple/adouble/DoubleSummaryDeserializer.java index a519d9d69..fa7a0cab0 100644 --- a/src/main/java/com/yahoo/sketches/tuple/adouble/DoubleSummaryDeserializer.java +++ b/src/main/java/com/yahoo/sketches/tuple/adouble/DoubleSummaryDeserializer.java @@ -23,6 +23,9 @@ import com.yahoo.sketches.tuple.DeserializeResult; import com.yahoo.sketches.tuple.SummaryDeserializer; +/** + * @author Lee Rhodes + */ public class DoubleSummaryDeserializer implements SummaryDeserializer { @Override diff --git a/src/main/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSummary.java b/src/main/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSummary.java index f6c879acb..b033cf71b 100644 --- a/src/main/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSummary.java +++ b/src/main/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSummary.java @@ -34,7 +34,7 @@ * @author Lee Rhodes */ public class ArrayOfStringsSummary implements UpdatableSummary { - public static final int PRIME = 0x7A3C_CA71; + private static final int PRIME = 0x7A3C_CA71; private String[] nodesArr = null; ArrayOfStringsSummary() { //required for ArrayOfStringsSummaryFactory @@ -90,6 +90,9 @@ public ArrayOfStringsSummary copy() { return nodes; } + /** + * @return the nodes array for this summary. + */ public String[] getValue() { return nodesArr.clone(); } @@ -154,6 +157,10 @@ static long stringArrHash(final String[] strArray) { return XxHash64.hashChars(s.toCharArray(), 0, s.length(), PRIME); } + /** + * @param s the string to hash + * @return the hash of the string + */ public static long stringHash(final String s) { return XxHash64.hashChars(s.toCharArray(), 0, s.length(), PRIME); } diff --git a/src/test/java/com/yahoo/sketches/BinomialBoundsNTest.java b/src/test/java/com/yahoo/sketches/BinomialBoundsNTest.java index 1a9b4b550..ab5f8e725 100644 --- a/src/test/java/com/yahoo/sketches/BinomialBoundsNTest.java +++ b/src/test/java/com/yahoo/sketches/BinomialBoundsNTest.java @@ -31,6 +31,7 @@ /** * @author Kevin Lang */ +@SuppressWarnings("javadoc") public class BinomialBoundsNTest { public static double[] runTestAux (long max_numSamplesI, int ci, double min_p) { @@ -41,21 +42,21 @@ public static double[] runTestAux (long max_numSamplesI, int ci, double min_p) { double sum3 = 0.0; double sum4 = 0.0; long count = 0; - + while (numSamplesI <= max_numSamplesI) { /* was <= */ p = 1.0; - + while (p >= min_p) { lb = BinomialBoundsN.getLowerBound (numSamplesI, p, ci, false); ub = BinomialBoundsN.getUpperBound (numSamplesI, p, ci, false); - + // if (numSamplesI == 300 && p > 0.365 && p < 0.367) { ub += 0.01; } // artificial discrepancy - + // the logarithm helps discrepancies to not be swamped out of the total - sum1 += Math.log (lb + 1.0); + sum1 += Math.log (lb + 1.0); sum2 += Math.log (ub + 1.0); count += 2; - + if (p < 1.0) { lb = BinomialBoundsN.getLowerBound (numSamplesI, 1.0 - p, ci, false); ub = BinomialBoundsN.getUpperBound (numSamplesI, 1.0 - p, ci, false); @@ -63,32 +64,32 @@ public static double[] runTestAux (long max_numSamplesI, int ci, double min_p) { sum4 += Math.log (ub + 1.0); count += 2; } - + p *= 0.99; } - numSamplesI = Math.max (numSamplesI+1, 1001*numSamplesI/1000); + numSamplesI = Math.max (numSamplesI+1, (1001*numSamplesI)/1000); } - + println(String.format("{%.15e, %.15e, %.15e, %.15e, %d}", sum1, sum2, sum3, sum4, count)); double[] arrOut = {sum1, sum2, sum3, sum4, count}; return arrOut; } - + private static final double TOL = 1E-15; - + @Test public static void checkBounds() { int i = 0; for (int ci = 1; ci <= 3; ci++, i++) { double[] arr = runTestAux (20, ci, 1e-3); for (int j=0; j<5; j++) { - assertTrue((arr[j] / std[i][j] -1.0) < TOL); + assertTrue(((arr[j] / std[i][j]) -1.0) < TOL); } } for (int ci = 1; ci <= 3; ci++, i++) { double[] arr = runTestAux (200, ci, 1e-5); for (int j=0; j<5; j++) { - assertTrue((arr[j] / std[i][j] -1.0) < TOL); + assertTrue(((arr[j] / std[i][j]) -1.0) < TOL); } } //comment last one out for a shorter test @@ -99,22 +100,22 @@ public static void checkBounds() { // } // } } - + // With all 3 enabled the test should produce in groups of 3 */ private static final double[][] std = { {7.083330682531043e+04, 8.530373642825481e+04, 3.273647725073409e+04, 3.734024243699785e+04, 57750}, {6.539415269641498e+04, 8.945522372568645e+04, 3.222302546497840e+04, 3.904738469737429e+04, 57750}, {6.006043493107306e+04, 9.318105731423477e+04, 3.186269956585285e+04, 4.096466221922520e+04, 57750}, - + {2.275584770163813e+06, 2.347586549014998e+06, 1.020399409477305e+06, 1.036729927598294e+06, 920982}, {2.243569126699713e+06, 2.374663344107342e+06, 1.017017233582122e+06, 1.042597845553438e+06, 920982}, {2.210056231903739e+06, 2.400441267999687e+06, 1.014081235946986e+06, 1.049480769755676e+06, 920982}, - + {4.688240115809608e+07, 4.718067204619278e+07, 2.148362024482338e+07, 2.153118905212302e+07, 12834414}, {4.674205938540214e+07, 4.731333757486791e+07, 2.146902141966406e+07, 2.154916650733873e+07, 12834414}, {4.659896614422579e+07, 4.744404182094614e+07, 2.145525391547799e+07, 2.156815612325058e+07, 12834414} }; - + @Test public static void checkCheckArgs() { try { @@ -129,7 +130,7 @@ public static void checkCheckArgs() { //pass } } - + @Test public static void checkComputeApproxBino_LB_UB() { long n = 100; @@ -143,12 +144,12 @@ public static void checkComputeApproxBino_LB_UB() { result = getUpperBound(n, theta, 1, true); assertEquals(result, 0.0, 0.0); } - + @Test(expectedExceptions = SketchesArgumentException.class) public static void checkThetaLimits1() { BinomialBoundsN.getUpperBound(100, 1.1, 1, false); } - + @Test public static void boundsExample() { println("BinomialBoundsN Example:"); @@ -164,17 +165,17 @@ public static void boundsExample() { println("LB: "+lb); println(""); } - + @Test public void printlnTest() { println("PRINTING: "+this.getClass().getName()); } - + /** - * @param s value to print + * @param s value to print */ static void println(String s) { //System.out.println(s); //disable here } - + } diff --git a/src/test/java/com/yahoo/sketches/BoundsOnBinomialProportionsTest.java b/src/test/java/com/yahoo/sketches/BoundsOnBinomialProportionsTest.java index 852111239..22281f1d5 100644 --- a/src/test/java/com/yahoo/sketches/BoundsOnBinomialProportionsTest.java +++ b/src/test/java/com/yahoo/sketches/BoundsOnBinomialProportionsTest.java @@ -33,6 +33,7 @@ /** * @author Kevin Lang */ +@SuppressWarnings("javadoc") public class BoundsOnBinomialProportionsTest { @Test @@ -51,7 +52,7 @@ public static void tinyLBTest () { // System.out.printf ("LB\t%d\t%d\t%.1f\t%.16g%n", n, k, kappa, lb); } } - + @Test public static void tinyUBTest () { // these answers were computed using a different programming language and therefore might not match exactly. @@ -68,7 +69,7 @@ public static void tinyUBTest () { // System.out.printf ("UB\t%d\t%d\t%.1f\t%.16g%n", n, k, kappa, ub); } } - + // This is for Kevin's use only, and will not be one of the unit tests. public static void lotsOfSpewage (long maxN) { for (long n = 0; n <= maxN; n++) { @@ -113,7 +114,7 @@ public static void checkNumStdDevZero() { println("LB: "+lb); println("UB: "+ub); } - + @Test public static void checkInputs() { try { @@ -139,24 +140,24 @@ public static void checkInputs() { } assertEquals(estimateUnknownP(0, 0), 0.5, 0.0); } - + @Test public static void checkErf() { assertTrue(erf(-2.0) < 0.99); assertTrue(erf(2.0) > 0.99); } - + @Test public void printlnTest() { println("PRINTING: "+this.getClass().getName()); } - + /** - * @param s value to print + * @param s value to print */ static void println(String s) { //System.out.println(s); //disable here } - - + + } diff --git a/src/test/java/com/yahoo/sketches/BoundsOnRatiosInSampledSetsTest.java b/src/test/java/com/yahoo/sketches/BoundsOnRatiosInSampledSetsTest.java index 2eab03f86..e78c4d6f8 100644 --- a/src/test/java/com/yahoo/sketches/BoundsOnRatiosInSampledSetsTest.java +++ b/src/test/java/com/yahoo/sketches/BoundsOnRatiosInSampledSetsTest.java @@ -29,6 +29,7 @@ import org.testng.annotations.Test; +@SuppressWarnings("javadoc") public class BoundsOnRatiosInSampledSetsTest { @Test @@ -37,31 +38,31 @@ public void checkNormalReturns() { getLowerBoundForBoverA(500, 100, 0.75); getLowerBoundForBoverA(500, 100, 1.0); assertEquals(getLowerBoundForBoverA(0, 0, .1), 0.0, 0.0); - + getUpperBoundForBoverA(500, 100, .1); getUpperBoundForBoverA(500, 100, 0.75); getUpperBoundForBoverA(500, 100, 1.0); assertEquals(getUpperBoundForBoverA(0, 0, .1), 1.0, 0.0); - + getEstimateOfBoverA(500,100); getEstimateOfA(500, .1); getEstimateOfB(100, .1); assertEquals(getEstimateOfBoverA(0, 0), .5, 0.0); } - + @Test(expectedExceptions = SketchesArgumentException.class) public void checkInputA() { checkInputs(-1, 0, .3); } - + @Test(expectedExceptions = SketchesArgumentException.class) public void checkInputB() { checkInputs(500, -1, .3); } - + @Test(expectedExceptions = SketchesArgumentException.class) public void checkInputF() { checkInputs(500, 100, -1); } - + } diff --git a/src/test/java/com/yahoo/sketches/BoundsOnRatiosInThetaSketchedSetsTest.java b/src/test/java/com/yahoo/sketches/BoundsOnRatiosInThetaSketchedSetsTest.java index be9445f68..86b6b02c9 100644 --- a/src/test/java/com/yahoo/sketches/BoundsOnRatiosInThetaSketchedSetsTest.java +++ b/src/test/java/com/yahoo/sketches/BoundsOnRatiosInThetaSketchedSetsTest.java @@ -29,6 +29,7 @@ import com.yahoo.sketches.theta.Sketches; import com.yahoo.sketches.theta.UpdateSketch; +@SuppressWarnings("javadoc") public class BoundsOnRatiosInThetaSketchedSetsTest { @Test @@ -38,7 +39,7 @@ public void checkNormalReturns() { int uA = 10000; int uC = 100000; for (int i=0; i 0} - * + * * @param n the upper exclusive bound * @return random integer */ @@ -228,7 +229,7 @@ private static String printArr(double[] arr) { } return sb.toString(); } - + //For console testing static void test1() { int len = 16; @@ -285,7 +286,7 @@ static void test2() { println(printArr(arr)); } - //For console testing + //For console testing static void test3() { int len = 16; int nonZeros = (3 * len) / 4; @@ -368,7 +369,7 @@ static void testDbl2() { println(printArr(arr)); } - //For console testing + //For console testing static void testDbl3() { int len = 16; int nonZeros = (3 * len) / 4; @@ -395,7 +396,7 @@ static void testDbl3() { println("Result Array:"+LS); println(printArr(arr)); } - + // public static void main(String[] args) { // println(LS+"==LONGS 1=========="+LS); // test1(); @@ -409,7 +410,7 @@ static void testDbl3() { // testDbl2(); // println(LS+"==DOUBLES 3========"+LS); // testDbl3(); -// +// // // QuickSelectTest qst = new QuickSelectTest(); // qst.checkQuickSelect0Based(); @@ -422,24 +423,24 @@ static void testDbl3() { // qst.checkQuickSelectDbl1BasedIncludingZeros(); // // } - + @Test public void printlnTest() { println("PRINTING: "+this.getClass().getName()); } - + /** - * @param s value to print + * @param s value to print */ static void println(String s) { //System.out.println(s); //disable here } - + /** - * @param d value to print + * @param d value to print */ static void println(double d) { //System.out.println(d); //disable here } - + } diff --git a/src/test/java/com/yahoo/sketches/SketchesExceptionTest.java b/src/test/java/com/yahoo/sketches/SketchesExceptionTest.java index b545a9d17..798d6d5b4 100644 --- a/src/test/java/com/yahoo/sketches/SketchesExceptionTest.java +++ b/src/test/java/com/yahoo/sketches/SketchesExceptionTest.java @@ -21,6 +21,7 @@ import org.testng.annotations.Test; +@SuppressWarnings("javadoc") public class SketchesExceptionTest { @Test(expectedExceptions = SketchesException.class) diff --git a/src/test/java/com/yahoo/sketches/UtilTest.java b/src/test/java/com/yahoo/sketches/UtilTest.java index 67b2eaad7..694c07fdb 100644 --- a/src/test/java/com/yahoo/sketches/UtilTest.java +++ b/src/test/java/com/yahoo/sketches/UtilTest.java @@ -51,6 +51,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class UtilTest { @Test(expectedExceptions = SketchesArgumentException.class) diff --git a/src/test/java/com/yahoo/sketches/cpc/CompressedStateTest.java b/src/test/java/com/yahoo/sketches/cpc/CompressedStateTest.java index 55c22d6f9..d1ac36dab 100644 --- a/src/test/java/com/yahoo/sketches/cpc/CompressedStateTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/CompressedStateTest.java @@ -32,6 +32,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class CompressedStateTest { static PrintStream ps = System.out; long vIn = 0; diff --git a/src/test/java/com/yahoo/sketches/cpc/CompressionCharacterization.java b/src/test/java/com/yahoo/sketches/cpc/CompressionCharacterization.java index 0a276e626..9e26b8652 100644 --- a/src/test/java/com/yahoo/sketches/cpc/CompressionCharacterization.java +++ b/src/test/java/com/yahoo/sketches/cpc/CompressionCharacterization.java @@ -37,6 +37,7 @@ * @author Lee Rhodes * @author Kevin Lang */ +@SuppressWarnings("javadoc") public class CompressionCharacterization { private String hfmt; private String dfmt; diff --git a/src/test/java/com/yahoo/sketches/cpc/CompressionDataTest.java b/src/test/java/com/yahoo/sketches/cpc/CompressionDataTest.java index 642fbfcf4..df06ccd57 100644 --- a/src/test/java/com/yahoo/sketches/cpc/CompressionDataTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/CompressionDataTest.java @@ -30,6 +30,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class CompressionDataTest { @Test diff --git a/src/test/java/com/yahoo/sketches/cpc/CpcCBinariesTest.java b/src/test/java/com/yahoo/sketches/cpc/CpcCBinariesTest.java index f75fc5a39..d583c3cef 100644 --- a/src/test/java/com/yahoo/sketches/cpc/CpcCBinariesTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/CpcCBinariesTest.java @@ -34,6 +34,7 @@ * Checks sketch images obtained from C++. * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class CpcCBinariesTest { static PrintStream ps = System.out; static final String LS = System.getProperty("line.separator"); diff --git a/src/test/java/com/yahoo/sketches/cpc/CpcCompressionTest.java b/src/test/java/com/yahoo/sketches/cpc/CpcCompressionTest.java index c7dd113fa..84cd6feb8 100644 --- a/src/test/java/com/yahoo/sketches/cpc/CpcCompressionTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/CpcCompressionTest.java @@ -43,6 +43,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class CpcCompressionTest { @Test diff --git a/src/test/java/com/yahoo/sketches/cpc/CpcSketchTest.java b/src/test/java/com/yahoo/sketches/cpc/CpcSketchTest.java index 6e71b81f7..ca122248c 100644 --- a/src/test/java/com/yahoo/sketches/cpc/CpcSketchTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/CpcSketchTest.java @@ -36,6 +36,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class CpcSketchTest { static PrintStream ps = System.out; diff --git a/src/test/java/com/yahoo/sketches/cpc/CpcUnionTest.java b/src/test/java/com/yahoo/sketches/cpc/CpcUnionTest.java index 4c428b9ab..8901ccca3 100644 --- a/src/test/java/com/yahoo/sketches/cpc/CpcUnionTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/CpcUnionTest.java @@ -32,6 +32,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class CpcUnionTest { @Test diff --git a/src/test/java/com/yahoo/sketches/cpc/CpcWrapperTest.java b/src/test/java/com/yahoo/sketches/cpc/CpcWrapperTest.java index 20cbcbe0d..a1fd5e45f 100644 --- a/src/test/java/com/yahoo/sketches/cpc/CpcWrapperTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/CpcWrapperTest.java @@ -32,6 +32,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class CpcWrapperTest { static PrintStream ps = System.out; diff --git a/src/test/java/com/yahoo/sketches/cpc/IconEstimatorTest.java b/src/test/java/com/yahoo/sketches/cpc/IconEstimatorTest.java index 28909458b..495e531ae 100644 --- a/src/test/java/com/yahoo/sketches/cpc/IconEstimatorTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/IconEstimatorTest.java @@ -30,6 +30,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class IconEstimatorTest { //SLOW EXACT VERSION, Eventually move to characterization diff --git a/src/test/java/com/yahoo/sketches/cpc/LzTzSpeedTesting.java b/src/test/java/com/yahoo/sketches/cpc/LzTzSpeedTesting.java index 1836bed39..ed0fc56c9 100644 --- a/src/test/java/com/yahoo/sketches/cpc/LzTzSpeedTesting.java +++ b/src/test/java/com/yahoo/sketches/cpc/LzTzSpeedTesting.java @@ -33,6 +33,7 @@ * * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class LzTzSpeedTesting { static final byte[] byteTrailingZerosTable = new byte[256]; static final byte[] byteLeadingZerosTable = new byte[256]; diff --git a/src/test/java/com/yahoo/sketches/cpc/MergingValidation.java b/src/test/java/com/yahoo/sketches/cpc/MergingValidation.java index 01f9ef264..debe1b429 100644 --- a/src/test/java/com/yahoo/sketches/cpc/MergingValidation.java +++ b/src/test/java/com/yahoo/sketches/cpc/MergingValidation.java @@ -32,6 +32,7 @@ * @author Lee Rhodes * @author Kevin Lang */ +@SuppressWarnings("javadoc") public class MergingValidation { private String hfmt; private String dfmt; diff --git a/src/test/java/com/yahoo/sketches/cpc/PairTableTest.java b/src/test/java/com/yahoo/sketches/cpc/PairTableTest.java index 7cc67a27f..a43f76330 100644 --- a/src/test/java/com/yahoo/sketches/cpc/PairTableTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/PairTableTest.java @@ -32,6 +32,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class PairTableTest { Random rand = new Random(); diff --git a/src/test/java/com/yahoo/sketches/cpc/PreambleUtilTest.java b/src/test/java/com/yahoo/sketches/cpc/PreambleUtilTest.java index e707b83c3..d7dffb8ce 100644 --- a/src/test/java/com/yahoo/sketches/cpc/PreambleUtilTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/PreambleUtilTest.java @@ -64,6 +64,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class PreambleUtilTest { static final short defaultSeedHash = computeSeedHash(DEFAULT_UPDATE_SEED) ; diff --git a/src/test/java/com/yahoo/sketches/cpc/QuickMergingValidation.java b/src/test/java/com/yahoo/sketches/cpc/QuickMergingValidation.java index 7911af74e..9dd083845 100644 --- a/src/test/java/com/yahoo/sketches/cpc/QuickMergingValidation.java +++ b/src/test/java/com/yahoo/sketches/cpc/QuickMergingValidation.java @@ -32,6 +32,7 @@ * @author Lee Rhodes * @author Kevin Lang */ +@SuppressWarnings("javadoc") public class QuickMergingValidation { private String hfmt; private String dfmt; diff --git a/src/test/java/com/yahoo/sketches/cpc/RuntimeAssertsTest.java b/src/test/java/com/yahoo/sketches/cpc/RuntimeAssertsTest.java index 23ccdbf20..f963e0f3e 100644 --- a/src/test/java/com/yahoo/sketches/cpc/RuntimeAssertsTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/RuntimeAssertsTest.java @@ -29,6 +29,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class RuntimeAssertsTest { @Test diff --git a/src/test/java/com/yahoo/sketches/cpc/SpecialCBinariesTest.java b/src/test/java/com/yahoo/sketches/cpc/SpecialCBinariesTest.java index fbadd0e84..1bec09cb2 100644 --- a/src/test/java/com/yahoo/sketches/cpc/SpecialCBinariesTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/SpecialCBinariesTest.java @@ -38,6 +38,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class SpecialCBinariesTest { static PrintStream ps = System.out; static final String LS = System.getProperty("line.separator"); diff --git a/src/test/java/com/yahoo/sketches/cpc/StreamingValidation.java b/src/test/java/com/yahoo/sketches/cpc/StreamingValidation.java index 29cce1b4e..65a883465 100644 --- a/src/test/java/com/yahoo/sketches/cpc/StreamingValidation.java +++ b/src/test/java/com/yahoo/sketches/cpc/StreamingValidation.java @@ -30,6 +30,7 @@ * @author Lee Rhodes * @author Kevin Lang */ +@SuppressWarnings("javadoc") public class StreamingValidation { private String hfmt; private String dfmt; diff --git a/src/test/java/com/yahoo/sketches/cpc/TestAllTest.java b/src/test/java/com/yahoo/sketches/cpc/TestAllTest.java index 6701a6dbe..cbcabc04f 100644 --- a/src/test/java/com/yahoo/sketches/cpc/TestAllTest.java +++ b/src/test/java/com/yahoo/sketches/cpc/TestAllTest.java @@ -29,6 +29,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class TestAllTest { //STREAMING diff --git a/src/test/java/com/yahoo/sketches/fdt/FdtSketchTest.java b/src/test/java/com/yahoo/sketches/fdt/FdtSketchTest.java index 6a8ac7c7e..79406763f 100644 --- a/src/test/java/com/yahoo/sketches/fdt/FdtSketchTest.java +++ b/src/test/java/com/yahoo/sketches/fdt/FdtSketchTest.java @@ -35,6 +35,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class FdtSketchTest { private static final String LS = System.getProperty("line.separator"); private static final char sep = '|'; //string separator diff --git a/src/test/java/com/yahoo/sketches/fdt/GroupTest.java b/src/test/java/com/yahoo/sketches/fdt/GroupTest.java index b274f8519..36ca51acb 100644 --- a/src/test/java/com/yahoo/sketches/fdt/GroupTest.java +++ b/src/test/java/com/yahoo/sketches/fdt/GroupTest.java @@ -26,6 +26,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class GroupTest { private static final String LS = System.getProperty("line.separator"); diff --git a/src/test/java/com/yahoo/sketches/frequencies/DistTest.java b/src/test/java/com/yahoo/sketches/frequencies/DistTest.java index 22f6acfaf..6b760631e 100644 --- a/src/test/java/com/yahoo/sketches/frequencies/DistTest.java +++ b/src/test/java/com/yahoo/sketches/frequencies/DistTest.java @@ -22,6 +22,7 @@ import org.testng.Assert; //import org.testng.annotations.Test; +@SuppressWarnings("javadoc") public class DistTest { /** @@ -29,7 +30,7 @@ public class DistTest { * @return a random number generated from the geometric distribution. */ public static long randomGeometricDist(double prob) { - assert (prob > 0.0 && prob < 1.0); + assert ((prob > 0.0) && (prob < 1.0)); return 1 + (long) (Math.log(Math.random()) / Math.log(1.0 - prob)); } @@ -40,8 +41,9 @@ public static double zeta(long n, double theta) { int i; double ans = 0.0; - for (i = 1; i <= n; i++) + for (i = 1; i <= n; i++) { ans += Math.pow(1. / i, theta); + } return (ans); } @@ -60,18 +62,20 @@ public static long zipf(double theta, long n, double zetan) { // the first time since it uses the random generators alpha = 1. / (1. - theta); - eta = (1. - Math.pow(2. / n, 1. - theta)) / (1. - zeta(2, theta) / zetan); + eta = (1. - Math.pow(2. / n, 1. - theta)) / (1. - (zeta(2, theta) / zetan)); u = 0.0; - while (u == 0.0) + while (u == 0.0) { u = Math.random(); + } uz = u * zetan; - if (uz < 1.) + if (uz < 1.) { val = 1; - else if (uz < (1. + Math.pow(0.5, theta))) + } else if (uz < (1. + Math.pow(0.5, theta))) { val = 2; - else - val = 1 + (n * Math.pow(eta * u - eta + 1., alpha)); + } else { + val = 1 + (n * Math.pow(((eta * u) - eta) + 1., alpha)); + } return (long) val; } @@ -82,11 +86,12 @@ public static void testRandomGeometricDist() { double prob = .1; for (int i = 0; i < 100; i++) { long item = randomGeometricDist(prob); - if (item > maxItem) + if (item > maxItem) { maxItem = item; + } // If you succeed with probability p the probability // of failing 20/p times is smaller than 1/2^20. - Assert.assertTrue(maxItem < 20.0 / prob); + Assert.assertTrue(maxItem < (20.0 / prob)); } } diff --git a/src/test/java/com/yahoo/sketches/frequencies/ItemsSketchTest.java b/src/test/java/com/yahoo/sketches/frequencies/ItemsSketchTest.java index 6c202bda5..cbaabeccf 100644 --- a/src/test/java/com/yahoo/sketches/frequencies/ItemsSketchTest.java +++ b/src/test/java/com/yahoo/sketches/frequencies/ItemsSketchTest.java @@ -41,6 +41,7 @@ import com.yahoo.sketches.SketchesArgumentException; import com.yahoo.sketches.frequencies.ItemsSketch.Row; +@SuppressWarnings("javadoc") public class ItemsSketchTest { @Test diff --git a/src/test/java/com/yahoo/sketches/frequencies/LongsSketchTest.java b/src/test/java/com/yahoo/sketches/frequencies/LongsSketchTest.java index 78fd09ddc..619dfef32 100644 --- a/src/test/java/com/yahoo/sketches/frequencies/LongsSketchTest.java +++ b/src/test/java/com/yahoo/sketches/frequencies/LongsSketchTest.java @@ -41,6 +41,7 @@ import com.yahoo.sketches.Util; import com.yahoo.sketches.frequencies.LongsSketch.Row; +@SuppressWarnings("javadoc") public class LongsSketchTest { @Test diff --git a/src/test/java/com/yahoo/sketches/frequencies/ReversePurgeLongHashMapTest.java b/src/test/java/com/yahoo/sketches/frequencies/ReversePurgeLongHashMapTest.java index f76a7d645..732dccb88 100644 --- a/src/test/java/com/yahoo/sketches/frequencies/ReversePurgeLongHashMapTest.java +++ b/src/test/java/com/yahoo/sketches/frequencies/ReversePurgeLongHashMapTest.java @@ -25,6 +25,7 @@ import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class ReversePurgeLongHashMapTest { @Test(expectedExceptions = SketchesArgumentException.class) diff --git a/src/test/java/com/yahoo/sketches/frequencies/SerDeCompatibilityTest.java b/src/test/java/com/yahoo/sketches/frequencies/SerDeCompatibilityTest.java index fb9c5fd99..205e90043 100644 --- a/src/test/java/com/yahoo/sketches/frequencies/SerDeCompatibilityTest.java +++ b/src/test/java/com/yahoo/sketches/frequencies/SerDeCompatibilityTest.java @@ -26,13 +26,14 @@ import com.yahoo.sketches.ArrayOfItemsSerDe; import com.yahoo.sketches.ArrayOfLongsSerDe; +@SuppressWarnings("javadoc") public class SerDeCompatibilityTest { static final ArrayOfItemsSerDe serDe = new ArrayOfLongsSerDe(); @Test public void itemsToLongs() { - ItemsSketch sketch1 = new ItemsSketch(8); + ItemsSketch sketch1 = new ItemsSketch<>(8); sketch1.update(1L); sketch1.update(2L); sketch1.update(3L); diff --git a/src/test/java/com/yahoo/sketches/frequencies/StressTestHashMap.java b/src/test/java/com/yahoo/sketches/frequencies/StressTestHashMap.java index 3bc9b5777..85b5fa026 100644 --- a/src/test/java/com/yahoo/sketches/frequencies/StressTestHashMap.java +++ b/src/test/java/com/yahoo/sketches/frequencies/StressTestHashMap.java @@ -21,14 +21,15 @@ import com.yahoo.sketches.hash.MurmurHash3; +@SuppressWarnings("javadoc") public class StressTestHashMap { public static void main(String[] args) { stress(); } - + private static void stress() { - for (int capacity = 2 << 5; capacity < 2 << 24; capacity *= 2) { + for (int capacity = 2 << 5; capacity < (2 << 24); capacity *= 2) { int n = 10000000; long[] keys = new long[n]; @@ -36,7 +37,7 @@ private static void stress() { for (int i = 0; i < n; i++) { keys[i] = murmur(i); - values[i] = (i < capacity / 2) ? n : 1; + values[i] = (i < (capacity / 2)) ? n : 1; } ReversePurgeLongHashMap hashmap = new ReversePurgeLongHashMap(capacity); diff --git a/src/test/java/com/yahoo/sketches/hash/MurmurHash3AdaptorTest.java b/src/test/java/com/yahoo/sketches/hash/MurmurHash3AdaptorTest.java index 0b2a39db7..7e8a7ef38 100644 --- a/src/test/java/com/yahoo/sketches/hash/MurmurHash3AdaptorTest.java +++ b/src/test/java/com/yahoo/sketches/hash/MurmurHash3AdaptorTest.java @@ -33,6 +33,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class MurmurHash3AdaptorTest { @Test @@ -90,7 +91,7 @@ public void checkToBytesCharArr() { result = hashToBytes(arr, 0L); Assert.assertEquals(result, null); } - + @Test public void checkToBytesByteArr() { byte[] arr = { 1, 2 }; @@ -195,7 +196,7 @@ public void checkToLongsCharArr() { result = hashToLongs(arr, 0L); Assert.assertEquals(result, null); } - + @Test public void checkToLongsByteArr() { byte[] arr = { 1, 2 }; @@ -265,8 +266,8 @@ public void checkAsDouble() { } //Check asInt() functions - - @Test + + @Test public void checkAsInt() { int lo = (3 << 28); int hi = (1 << 30) + 1; @@ -276,31 +277,31 @@ public void checkAsInt() { Assert.assertTrue((result >= 0) && (result < lo)); result = asInt(longArr, hi); Assert.assertTrue((result >= 0) && (result < hi)); - + int[] intArr = {i, i+1}; //int[] result = asInt(intArr, lo); Assert.assertTrue((result >= 0) && (result < lo)); result = asInt(intArr, hi); Assert.assertTrue((result >= 0) && (result < hi)); - + byte[] byteArr = {i, (byte)(i+1)}; //byte[] result = asInt(byteArr, lo); Assert.assertTrue((result >= 0) && (result < lo)); result = asInt(byteArr, hi); Assert.assertTrue((result >= 0) && (result < hi)); - + long longV = i; //long result = asInt(longV, lo); Assert.assertTrue((result >= 0) && (result < lo)); result = asInt(longV, hi); Assert.assertTrue((result >= 0) && (result < hi)); - + double v = i; //double result = asInt(v, lo); Assert.assertTrue((result >= 0) && (result < lo)); result = asInt(v, hi); Assert.assertTrue((result >= 0) && (result < hi)); - + String s = Integer.toString(i); //String result = asInt(s, lo); Assert.assertTrue((result >= 0) && (result < lo)); @@ -308,37 +309,37 @@ public void checkAsInt() { Assert.assertTrue((result >= 0) && (result < hi)); } } - + @Test (expectedExceptions = SketchesArgumentException.class) public void checkAsIntCornerCaseLongNull() { long[] arr = null; asInt(arr, 1000); } - + @Test (expectedExceptions = SketchesArgumentException.class) public void checkAsIntCornerCaseLongEmpty() { long[] arr = new long[0]; asInt(arr, 1000); } - + @Test (expectedExceptions = SketchesArgumentException.class) public void checkAsIntCornerCaseIntNull() { int[] arr = null; asInt(arr, 1000); } - + @Test (expectedExceptions = SketchesArgumentException.class) public void checkAsIntCornerCaseIntEmpty() { int[] arr = new int[0]; asInt(arr, 1000); } - + @Test (expectedExceptions = SketchesArgumentException.class) public void checkAsIntCornerCaseByteNull() { byte[] arr = null; asInt(arr, 1000); } - + @Test (expectedExceptions = SketchesArgumentException.class) public void checkAsIntCornerCaseByteEmpty() { byte[] arr = new byte[0]; @@ -350,26 +351,26 @@ public void checkAsIntCornerCaseStringNull() { String s = null; asInt(s, 1000); } - + @Test (expectedExceptions = SketchesArgumentException.class) public void checkAsIntCornerCaseStringEmpty() { String s = ""; asInt(s, 1000); } - + @Test (expectedExceptions = SketchesArgumentException.class) public void checkAsIntCornerCaseNTooSmall() { String s = "abc"; asInt(s, 1); } - + @Test public void printlnTest() { println("PRINTING: "+this.getClass().getName()); } - + /** - * @param s value to print + * @param s value to print */ static void println(String s) { //System.out.println(s); //disable here diff --git a/src/test/java/com/yahoo/sketches/hash/MurmurHash3Test.java b/src/test/java/com/yahoo/sketches/hash/MurmurHash3Test.java index 554ec395e..92676402f 100644 --- a/src/test/java/com/yahoo/sketches/hash/MurmurHash3Test.java +++ b/src/test/java/com/yahoo/sketches/hash/MurmurHash3Test.java @@ -28,9 +28,10 @@ /** * Tests the MurmurHash3 against specific, known hash results given known * inputs obtained from the public domain C++ version 150. - * + * * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class MurmurHash3Test { @Test @@ -124,8 +125,8 @@ public void checkIntArrRemainderEQ0() { //int[], test a remainder = 0 Assert.assertEquals(result[0], h1); Assert.assertEquals(result[1], h2); } - - + + /** * Tests an odd remainder of int[]. */ @@ -156,7 +157,7 @@ public void checkCharArrOddRemainder() { //char[], odd remainder Assert.assertEquals(result[0], h1); Assert.assertEquals(result[1], h2); } - + /** * Tests an odd remainder of int[]. */ @@ -171,14 +172,14 @@ public void checkCharArrRemainderEQ0() { //char[], remainder of 0 Assert.assertEquals(result[0], h1); Assert.assertEquals(result[1], h2); } - + @Test public void checkByteArrAllOnesZeros() { //byte[], test a ones byte and a zeros byte - byte[] key = { + byte[] key = { 0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, 0x6b, 0x20, 0x62, 0x72, 0x6f, 0x77, 0x6e, 0x20, 0x66, 0x6f, 0x78, 0x20, 0x6a, 0x75, 0x6d, 0x70, 0x73, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x7a, 0x79, 0x20, 0x64, 0x6f, 0x67, - (byte) 0xff, 0x64, 0x6f, 0x67, 0x00 + (byte) 0xff, 0x64, 0x6f, 0x67, 0x00 }; long[] result = MurmurHash3.hash(key, 0); @@ -202,22 +203,22 @@ public void checkCrossTypeHashConsistency() { long[] out1 = hash(bArr, 0L); println(com.yahoo.sketches.Util.longToHexBytes(out1[0])); println(com.yahoo.sketches.Util.longToHexBytes(out1[1])); - + println("Chars"); - char[] cArr = {0X0201, 0X0403, 0X0605, 0X0807, 0X0a09, 0X0c0b, 0X0e0d, 0X100f, + char[] cArr = {0X0201, 0X0403, 0X0605, 0X0807, 0X0a09, 0X0c0b, 0X0e0d, 0X100f, 0X1211, 0X1413, 0X1615, 0X1817}; out = hash(cArr, 0L); Assert.assertEquals(out, out1); println(com.yahoo.sketches.Util.longToHexBytes(out[0])); println(com.yahoo.sketches.Util.longToHexBytes(out[1])); - + println("Ints"); int[] iArr = {0X04030201, 0X08070605, 0X0c0b0a09, 0X100f0e0d, 0X14131211, 0X18171615}; out = hash(iArr, 0L); Assert.assertEquals(out, out1); println(com.yahoo.sketches.Util.longToHexBytes(out[0])); println(com.yahoo.sketches.Util.longToHexBytes(out[1])); - + println("Longs"); long[] lArr = {0X0807060504030201L, 0X100f0e0d0c0b0a09L, 0X1817161514131211L}; out = hash(lArr, 0L); @@ -225,8 +226,8 @@ public void checkCrossTypeHashConsistency() { println(com.yahoo.sketches.Util.longToHexBytes(out[0])); println(com.yahoo.sketches.Util.longToHexBytes(out[1])); } - - + + //Helper methods private static long[] stringToLongs(String in) { byte[] bArr = in.getBytes(UTF_8); @@ -270,9 +271,9 @@ private static int[] stringToInts(String in) { public void printlnTest() { println("PRINTING: "+this.getClass().getName()); } - + /** - * @param s value to print + * @param s value to print */ static void println(String s) { //System.out.println(s); //disable here diff --git a/src/test/java/com/yahoo/sketches/hash/MurmurHash3v2Test.java b/src/test/java/com/yahoo/sketches/hash/MurmurHash3v2Test.java index b4d95cb87..56c540701 100644 --- a/src/test/java/com/yahoo/sketches/hash/MurmurHash3v2Test.java +++ b/src/test/java/com/yahoo/sketches/hash/MurmurHash3v2Test.java @@ -30,6 +30,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class MurmurHash3v2Test { @Test diff --git a/src/test/java/com/yahoo/sketches/hash/XxHashTest.java b/src/test/java/com/yahoo/sketches/hash/XxHashTest.java index 50581d8ab..825fbbeb1 100644 --- a/src/test/java/com/yahoo/sketches/hash/XxHashTest.java +++ b/src/test/java/com/yahoo/sketches/hash/XxHashTest.java @@ -28,6 +28,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class XxHashTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hll/AuxHashMapTest.java b/src/test/java/com/yahoo/sketches/hll/AuxHashMapTest.java index cb9427b7d..52d5d9753 100644 --- a/src/test/java/com/yahoo/sketches/hll/AuxHashMapTest.java +++ b/src/test/java/com/yahoo/sketches/hll/AuxHashMapTest.java @@ -30,6 +30,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class AuxHashMapTest { static final String LS = System.getProperty("line.separator"); diff --git a/src/test/java/com/yahoo/sketches/hll/BaseHllSketchTest.java b/src/test/java/com/yahoo/sketches/hll/BaseHllSketchTest.java index 6e967fab5..9f8567480 100644 --- a/src/test/java/com/yahoo/sketches/hll/BaseHllSketchTest.java +++ b/src/test/java/com/yahoo/sketches/hll/BaseHllSketchTest.java @@ -30,6 +30,7 @@ * @author Lee Rhodes * */ +@SuppressWarnings("javadoc") public class BaseHllSketchTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hll/CouponListTest.java b/src/test/java/com/yahoo/sketches/hll/CouponListTest.java index c29bac677..dbcd0cecd 100644 --- a/src/test/java/com/yahoo/sketches/hll/CouponListTest.java +++ b/src/test/java/com/yahoo/sketches/hll/CouponListTest.java @@ -31,6 +31,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class CouponListTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hll/CrossCountingTest.java b/src/test/java/com/yahoo/sketches/hll/CrossCountingTest.java index 874995f69..2e99167fe 100644 --- a/src/test/java/com/yahoo/sketches/hll/CrossCountingTest.java +++ b/src/test/java/com/yahoo/sketches/hll/CrossCountingTest.java @@ -29,7 +29,7 @@ /** * @author Lee Rhodes */ -@SuppressWarnings("unused") +@SuppressWarnings({"unused", "javadoc"}) public class CrossCountingTest { static final String LS = System.getProperty("line.separator"); diff --git a/src/test/java/com/yahoo/sketches/hll/DirectAuxHashMapTest.java b/src/test/java/com/yahoo/sketches/hll/DirectAuxHashMapTest.java index 09e1f5e56..30a151086 100644 --- a/src/test/java/com/yahoo/sketches/hll/DirectAuxHashMapTest.java +++ b/src/test/java/com/yahoo/sketches/hll/DirectAuxHashMapTest.java @@ -39,6 +39,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DirectAuxHashMapTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hll/DirectCouponListTest.java b/src/test/java/com/yahoo/sketches/hll/DirectCouponListTest.java index 3466b6598..f0f55d617 100644 --- a/src/test/java/com/yahoo/sketches/hll/DirectCouponListTest.java +++ b/src/test/java/com/yahoo/sketches/hll/DirectCouponListTest.java @@ -34,6 +34,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DirectCouponListTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hll/DirectHllSketchTest.java b/src/test/java/com/yahoo/sketches/hll/DirectHllSketchTest.java index e5d8f47c2..3dfbdc5c4 100644 --- a/src/test/java/com/yahoo/sketches/hll/DirectHllSketchTest.java +++ b/src/test/java/com/yahoo/sketches/hll/DirectHllSketchTest.java @@ -34,6 +34,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DirectHllSketchTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hll/DirectUnionCaseTest.java b/src/test/java/com/yahoo/sketches/hll/DirectUnionCaseTest.java index 27ba02847..fdf27f0bd 100644 --- a/src/test/java/com/yahoo/sketches/hll/DirectUnionCaseTest.java +++ b/src/test/java/com/yahoo/sketches/hll/DirectUnionCaseTest.java @@ -36,6 +36,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DirectUnionCaseTest { long v = 0; diff --git a/src/test/java/com/yahoo/sketches/hll/DirectUnionTest.java b/src/test/java/com/yahoo/sketches/hll/DirectUnionTest.java index 70a30245c..06e48dc5e 100644 --- a/src/test/java/com/yahoo/sketches/hll/DirectUnionTest.java +++ b/src/test/java/com/yahoo/sketches/hll/DirectUnionTest.java @@ -37,6 +37,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DirectUnionTest { static final String LS = System.getProperty("line.separator"); diff --git a/src/test/java/com/yahoo/sketches/hll/HllArrayTest.java b/src/test/java/com/yahoo/sketches/hll/HllArrayTest.java index 504a08ce7..b88fc8c9e 100644 --- a/src/test/java/com/yahoo/sketches/hll/HllArrayTest.java +++ b/src/test/java/com/yahoo/sketches/hll/HllArrayTest.java @@ -29,8 +29,8 @@ /** * @author Lee Rhodes - * */ +@SuppressWarnings("javadoc") public class HllArrayTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hll/HllSketchTest.java b/src/test/java/com/yahoo/sketches/hll/HllSketchTest.java index e94045d79..f62c60efa 100644 --- a/src/test/java/com/yahoo/sketches/hll/HllSketchTest.java +++ b/src/test/java/com/yahoo/sketches/hll/HllSketchTest.java @@ -44,7 +44,7 @@ /** * @author Lee Rhodes */ -//@SuppressWarnings("unused") +@SuppressWarnings("javadoc") public class HllSketchTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hll/PreambleUtilTest.java b/src/test/java/com/yahoo/sketches/hll/PreambleUtilTest.java index 875d5df7e..0f5c193b0 100644 --- a/src/test/java/com/yahoo/sketches/hll/PreambleUtilTest.java +++ b/src/test/java/com/yahoo/sketches/hll/PreambleUtilTest.java @@ -40,6 +40,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class PreambleUtilTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hll/TablesTest.java b/src/test/java/com/yahoo/sketches/hll/TablesTest.java index e137dd9ba..e5c302abc 100644 --- a/src/test/java/com/yahoo/sketches/hll/TablesTest.java +++ b/src/test/java/com/yahoo/sketches/hll/TablesTest.java @@ -28,10 +28,12 @@ import org.testng.annotations.Test; import com.yahoo.sketches.SketchesArgumentException; + /** * @author Lee Rhodes * */ +@SuppressWarnings("javadoc") public class TablesTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hll/ToFromByteArrayTest.java b/src/test/java/com/yahoo/sketches/hll/ToFromByteArrayTest.java index 0b5fa0bbe..2bf5f929e 100644 --- a/src/test/java/com/yahoo/sketches/hll/ToFromByteArrayTest.java +++ b/src/test/java/com/yahoo/sketches/hll/ToFromByteArrayTest.java @@ -31,8 +31,8 @@ /** * @author Lee Rhodes - * */ +@SuppressWarnings("javadoc") public class ToFromByteArrayTest { static final int[] nArr = new int[] {1, 3, 10, 30, 100, 300, 1000, 3000, 10000, 30000}; diff --git a/src/test/java/com/yahoo/sketches/hll/UnionCaseTest.java b/src/test/java/com/yahoo/sketches/hll/UnionCaseTest.java index b86bac0f9..738d5a55a 100644 --- a/src/test/java/com/yahoo/sketches/hll/UnionCaseTest.java +++ b/src/test/java/com/yahoo/sketches/hll/UnionCaseTest.java @@ -33,8 +33,8 @@ /** * @author Lee Rhodes - * */ +@SuppressWarnings("javadoc") public class UnionCaseTest { long v = 0; diff --git a/src/test/java/com/yahoo/sketches/hll/UnionTest.java b/src/test/java/com/yahoo/sketches/hll/UnionTest.java index bd83f1269..873c1e03d 100644 --- a/src/test/java/com/yahoo/sketches/hll/UnionTest.java +++ b/src/test/java/com/yahoo/sketches/hll/UnionTest.java @@ -36,6 +36,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class UnionTest { static final String LS = System.getProperty("line.separator"); diff --git a/src/test/java/com/yahoo/sketches/hllmap/CouponHashMapTest.java b/src/test/java/com/yahoo/sketches/hllmap/CouponHashMapTest.java index 4c60e595e..94d03e286 100644 --- a/src/test/java/com/yahoo/sketches/hllmap/CouponHashMapTest.java +++ b/src/test/java/com/yahoo/sketches/hllmap/CouponHashMapTest.java @@ -25,9 +25,8 @@ import org.testng.annotations.Test; import com.yahoo.sketches.SketchesArgumentException; -import com.yahoo.sketches.hllmap.CouponHashMap; -import com.yahoo.sketches.hllmap.Map; +@SuppressWarnings("javadoc") public class CouponHashMapTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hllmap/CouponTraverseMapTest.java b/src/test/java/com/yahoo/sketches/hllmap/CouponTraverseMapTest.java index ad13e19b6..373e99ed1 100644 --- a/src/test/java/com/yahoo/sketches/hllmap/CouponTraverseMapTest.java +++ b/src/test/java/com/yahoo/sketches/hllmap/CouponTraverseMapTest.java @@ -24,8 +24,7 @@ import org.testng.Assert; import org.testng.annotations.Test; -import com.yahoo.sketches.hllmap.CouponTraverseMap; - +@SuppressWarnings("javadoc") public class CouponTraverseMapTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hllmap/HllMapTest.java b/src/test/java/com/yahoo/sketches/hllmap/HllMapTest.java index c3f499c8f..2bf092d85 100644 --- a/src/test/java/com/yahoo/sketches/hllmap/HllMapTest.java +++ b/src/test/java/com/yahoo/sketches/hllmap/HllMapTest.java @@ -24,6 +24,7 @@ import com.yahoo.sketches.Util; +@SuppressWarnings("javadoc") public class HllMapTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hllmap/SingleCouponMapTest.java b/src/test/java/com/yahoo/sketches/hllmap/SingleCouponMapTest.java index 6ae52418b..366abc125 100644 --- a/src/test/java/com/yahoo/sketches/hllmap/SingleCouponMapTest.java +++ b/src/test/java/com/yahoo/sketches/hllmap/SingleCouponMapTest.java @@ -24,9 +24,7 @@ import org.testng.Assert; import org.testng.annotations.Test; -import com.yahoo.sketches.hllmap.Map; -import com.yahoo.sketches.hllmap.SingleCouponMap; - +@SuppressWarnings("javadoc") public class SingleCouponMapTest { @Test diff --git a/src/test/java/com/yahoo/sketches/hllmap/UniqueCountMapTest.java b/src/test/java/com/yahoo/sketches/hllmap/UniqueCountMapTest.java index 7a73ea9a1..85f44f833 100644 --- a/src/test/java/com/yahoo/sketches/hllmap/UniqueCountMapTest.java +++ b/src/test/java/com/yahoo/sketches/hllmap/UniqueCountMapTest.java @@ -28,6 +28,7 @@ import com.yahoo.sketches.SketchesArgumentException; import com.yahoo.sketches.Util; +@SuppressWarnings("javadoc") public class UniqueCountMapTest { private final static int INIT_ENTRIES = 211; @Test diff --git a/src/test/java/com/yahoo/sketches/kll/DeprecatedAndMiscTest.java b/src/test/java/com/yahoo/sketches/kll/DeprecatedAndMiscTest.java index 38e72d888..3446c0995 100644 --- a/src/test/java/com/yahoo/sketches/kll/DeprecatedAndMiscTest.java +++ b/src/test/java/com/yahoo/sketches/kll/DeprecatedAndMiscTest.java @@ -26,6 +26,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DeprecatedAndMiscTest { @SuppressWarnings("deprecation") diff --git a/src/test/java/com/yahoo/sketches/kll/KllFloatsSketchIteratorTest.java b/src/test/java/com/yahoo/sketches/kll/KllFloatsSketchIteratorTest.java index 4a97fb376..9d0984b80 100644 --- a/src/test/java/com/yahoo/sketches/kll/KllFloatsSketchIteratorTest.java +++ b/src/test/java/com/yahoo/sketches/kll/KllFloatsSketchIteratorTest.java @@ -22,6 +22,7 @@ import org.testng.Assert; import org.testng.annotations.Test; +@SuppressWarnings("javadoc") public class KllFloatsSketchIteratorTest { @Test @@ -46,7 +47,7 @@ public void oneItemSketch() { public void bigSketches() { for (int n = 1000; n < 100000; n += 2000) { KllFloatsSketch sketch = new KllFloatsSketch(); - for (int i = 0; i < n; i++) { + for (int i = 0; i < n; i++) { sketch.update(i); } KllFloatsSketchIterator it = sketch.iterator(); diff --git a/src/test/java/com/yahoo/sketches/kll/KllFloatsSketchTest.java b/src/test/java/com/yahoo/sketches/kll/KllFloatsSketchTest.java index 246d10a9d..3a33bb728 100644 --- a/src/test/java/com/yahoo/sketches/kll/KllFloatsSketchTest.java +++ b/src/test/java/com/yahoo/sketches/kll/KllFloatsSketchTest.java @@ -31,6 +31,7 @@ import com.yahoo.sketches.SketchesArgumentException; import com.yahoo.sketches.tuple.TestUtil; +@SuppressWarnings("javadoc") public class KllFloatsSketchTest { private static final double PMF_EPS_FOR_K_8 = 0.35; // PMF rank error (epsilon) for k=8 @@ -417,7 +418,7 @@ public void getQuantiles() { sketch.update(1); sketch.update(2); sketch.update(3); - final float[] quantiles1 = sketch.getQuantiles(new double[] {0, 0.5, 1}); + final float[] quantiles1 = sketch.getQuantiles(new double[] {0, 0.5, 1}); final float[] quantiles2 = sketch.getQuantiles(3); assertEquals(quantiles1, quantiles2); assertEquals(quantiles1[0], 1f); diff --git a/src/test/java/com/yahoo/sketches/kll/KllValidationTest.java b/src/test/java/com/yahoo/sketches/kll/KllValidationTest.java index 364d37aa7..a9cede59d 100644 --- a/src/test/java/com/yahoo/sketches/kll/KllValidationTest.java +++ b/src/test/java/com/yahoo/sketches/kll/KllValidationTest.java @@ -34,6 +34,7 @@ // These results are for the version that delays the rollup until the next value comes in. // The @Test annotations have to be enabled to use this class and a section in KllHelper also // needs to be enabled. +@SuppressWarnings("javadoc") public class KllValidationTest { private static final long[] correctResultsWithReset = { diff --git a/src/test/java/com/yahoo/sketches/quantiles/AccuracyTest.java b/src/test/java/com/yahoo/sketches/quantiles/AccuracyTest.java index c5fb2e324..5b16e0bbb 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/AccuracyTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/AccuracyTest.java @@ -26,6 +26,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class AccuracyTest { static Random rand = new Random(); diff --git a/src/test/java/com/yahoo/sketches/quantiles/DebugUnionTest.java b/src/test/java/com/yahoo/sketches/quantiles/DebugUnionTest.java index f161939e6..ad1d662ef 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DebugUnionTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DebugUnionTest.java @@ -33,6 +33,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DebugUnionTest { @Test diff --git a/src/test/java/com/yahoo/sketches/quantiles/DeprecatedAndMiscTest.java b/src/test/java/com/yahoo/sketches/quantiles/DeprecatedAndMiscTest.java index 387a9adb2..600615b85 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DeprecatedAndMiscTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DeprecatedAndMiscTest.java @@ -31,6 +31,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DeprecatedAndMiscTest { @SuppressWarnings({ "deprecation", "unused" }) diff --git a/src/test/java/com/yahoo/sketches/quantiles/DirectCompactDoublesSketchTest.java b/src/test/java/com/yahoo/sketches/quantiles/DirectCompactDoublesSketchTest.java index 1c74352e4..230437355 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DirectCompactDoublesSketchTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DirectCompactDoublesSketchTest.java @@ -36,7 +36,9 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class DirectCompactDoublesSketchTest { + @BeforeMethod public void setUp() { DoublesSketch.rand.setSeed(32749); // make sketches deterministic for testing diff --git a/src/test/java/com/yahoo/sketches/quantiles/DirectQuantilesMemoryRequestTest.java b/src/test/java/com/yahoo/sketches/quantiles/DirectQuantilesMemoryRequestTest.java index 2eb73bf85..4cb84a7b4 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DirectQuantilesMemoryRequestTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DirectQuantilesMemoryRequestTest.java @@ -35,6 +35,7 @@ * implementation that owns the native memory allocations, thus is responsible for * allocating larger Memory when requested and the actual freeing of the old memory allocations. */ +@SuppressWarnings("javadoc") public class DirectQuantilesMemoryRequestTest { @Test diff --git a/src/test/java/com/yahoo/sketches/quantiles/DirectUpdateDoublesSketchTest.java b/src/test/java/com/yahoo/sketches/quantiles/DirectUpdateDoublesSketchTest.java index c593ce794..1e527809a 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DirectUpdateDoublesSketchTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DirectUpdateDoublesSketchTest.java @@ -35,6 +35,7 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class DirectUpdateDoublesSketchTest { @BeforeMethod diff --git a/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchBuilderTest.java b/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchBuilderTest.java index fd3b8c1b2..928ae8b73 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchBuilderTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchBuilderTest.java @@ -26,6 +26,7 @@ import com.yahoo.memory.WritableMemory; +@SuppressWarnings("javadoc") public class DoublesSketchBuilderTest { @Test diff --git a/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchIteratorTest.java b/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchIteratorTest.java index 78e3abfcc..f474af2c7 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchIteratorTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchIteratorTest.java @@ -22,6 +22,7 @@ import org.testng.Assert; import org.testng.annotations.Test; +@SuppressWarnings("javadoc") public class DoublesSketchIteratorTest { @Test @@ -46,7 +47,7 @@ public void oneItemSketch() { public void bigSketches() { for (int n = 1000; n < 100000; n += 2000) { UpdateDoublesSketch sketch = DoublesSketch.builder().build(); - for (int i = 0; i < n; i++) { + for (int i = 0; i < n; i++) { sketch.update(i); } DoublesSketchIterator it = sketch.iterator(); diff --git a/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchTest.java b/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchTest.java index 2a2be04ec..7a22dc7d1 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DoublesSketchTest.java @@ -30,6 +30,7 @@ import com.yahoo.memory.WritableDirectHandle; import com.yahoo.memory.WritableMemory; +@SuppressWarnings("javadoc") public class DoublesSketchTest { @Test diff --git a/src/test/java/com/yahoo/sketches/quantiles/DoublesUnionBuilderTest.java b/src/test/java/com/yahoo/sketches/quantiles/DoublesUnionBuilderTest.java index efc2172be..a0dfb4eca 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DoublesUnionBuilderTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DoublesUnionBuilderTest.java @@ -27,6 +27,7 @@ import com.yahoo.memory.Memory; import com.yahoo.memory.WritableMemory; +@SuppressWarnings("javadoc") public class DoublesUnionBuilderTest { @Test diff --git a/src/test/java/com/yahoo/sketches/quantiles/DoublesUnionImplTest.java b/src/test/java/com/yahoo/sketches/quantiles/DoublesUnionImplTest.java index 7ce2ffa9e..d7ada8c16 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DoublesUnionImplTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DoublesUnionImplTest.java @@ -34,6 +34,7 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class DoublesUnionImplTest { @Test diff --git a/src/test/java/com/yahoo/sketches/quantiles/DoublesUtilTest.java b/src/test/java/com/yahoo/sketches/quantiles/DoublesUtilTest.java index bf31279e8..046a5bb42 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/DoublesUtilTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/DoublesUtilTest.java @@ -27,6 +27,7 @@ import com.yahoo.memory.Memory; import com.yahoo.memory.WritableMemory; +@SuppressWarnings("javadoc") public class DoublesUtilTest { @Test diff --git a/src/test/java/com/yahoo/sketches/quantiles/ForwardCompatibilityTest.java b/src/test/java/com/yahoo/sketches/quantiles/ForwardCompatibilityTest.java index b8e1f5253..b39c109ba 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/ForwardCompatibilityTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/ForwardCompatibilityTest.java @@ -28,6 +28,7 @@ import com.yahoo.memory.Memory; +@SuppressWarnings("javadoc") public class ForwardCompatibilityTest { @Test diff --git a/src/test/java/com/yahoo/sketches/quantiles/HeapCompactDoublesSketchTest.java b/src/test/java/com/yahoo/sketches/quantiles/HeapCompactDoublesSketchTest.java index 313eea26a..1ca3d0ade 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/HeapCompactDoublesSketchTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/HeapCompactDoublesSketchTest.java @@ -32,6 +32,7 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class HeapCompactDoublesSketchTest { @BeforeMethod diff --git a/src/test/java/com/yahoo/sketches/quantiles/HeapUpdateDoublesSketchTest.java b/src/test/java/com/yahoo/sketches/quantiles/HeapUpdateDoublesSketchTest.java index cf8668392..e95342f84 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/HeapUpdateDoublesSketchTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/HeapUpdateDoublesSketchTest.java @@ -44,6 +44,7 @@ import com.yahoo.sketches.QuantilesHelper; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class HeapUpdateDoublesSketchTest { @BeforeMethod diff --git a/src/test/java/com/yahoo/sketches/quantiles/ItemsSketchIteratorTest.java b/src/test/java/com/yahoo/sketches/quantiles/ItemsSketchIteratorTest.java index b8e2a3148..cedba57b3 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/ItemsSketchIteratorTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/ItemsSketchIteratorTest.java @@ -24,6 +24,7 @@ import org.testng.Assert; import org.testng.annotations.Test; +@SuppressWarnings("javadoc") public class ItemsSketchIteratorTest { @Test @@ -48,7 +49,7 @@ public void oneItemSketch() { public void bigSketches() { for (int n = 1000; n < 100000; n += 2000) { ItemsSketch sketch = ItemsSketch.getInstance(128, Comparator.naturalOrder()); - for (int i = 0; i < n; i++) { + for (int i = 0; i < n; i++) { sketch.update(i); } ItemsSketchIterator it = sketch.iterator(); diff --git a/src/test/java/com/yahoo/sketches/quantiles/ItemsSketchTest.java b/src/test/java/com/yahoo/sketches/quantiles/ItemsSketchTest.java index b1cd6004e..00a13c8bf 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/ItemsSketchTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/ItemsSketchTest.java @@ -37,6 +37,7 @@ import com.yahoo.sketches.ArrayOfStringsSerDe; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class ItemsSketchTest { @BeforeMethod diff --git a/src/test/java/com/yahoo/sketches/quantiles/ItemsUnionTest.java b/src/test/java/com/yahoo/sketches/quantiles/ItemsUnionTest.java index 065ea6d83..7cbb9a6df 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/ItemsUnionTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/ItemsUnionTest.java @@ -31,6 +31,7 @@ import com.yahoo.sketches.ArrayOfLongsSerDe; import com.yahoo.sketches.ArrayOfStringsSerDe; +@SuppressWarnings("javadoc") public class ItemsUnionTest { @Test @@ -348,20 +349,20 @@ public void checkMergeIntoEqualKs() { skValid2 = buildIS(32, n, n); ItemsMergeImpl.mergeInto(skValid1, skValid2); Assert.assertEquals(skValid2.getMinValue(), 0.0, 0.0); - Assert.assertEquals(skValid2.getMaxValue(), 2 * n - 1.0, 0.0); + Assert.assertEquals(skValid2.getMaxValue(), (2 * n) - 1.0, 0.0); n = 512; skValid1 = buildIS(32, n, 0); skValid2 = buildIS(32, n, n); ItemsMergeImpl.mergeInto(skValid1, skValid2); Assert.assertEquals(skValid2.getMinValue(), 0.0, 0.0); - Assert.assertEquals(skValid2.getMaxValue(), 2 * n - 1.0, 0.0); + Assert.assertEquals(skValid2.getMaxValue(), (2 * n) - 1.0, 0.0); skValid1 = buildIS(32, n, 0); skValid2 = buildIS(32, n, n); ItemsMergeImpl.mergeInto(skValid2, skValid1); Assert.assertEquals(skValid1.getMinValue(), 0.0, 0.0); - Assert.assertEquals(skValid1.getMaxValue(), 2 * n - 1.0, 0.0); + Assert.assertEquals(skValid1.getMaxValue(), (2 * n) - 1.0, 0.0); } @Test @@ -386,7 +387,7 @@ public void checkToByteArray() { Assert.assertEquals(bytesOut.length, 8); Assert.assertTrue(union.isEmpty()); - final byte[] byteArr = buildIS(k, 2 * k + 5).toByteArray(serDe); + final byte[] byteArr = buildIS(k, (2 * k) + 5).toByteArray(serDe); final Memory mem = Memory.wrap(byteArr); union = ItemsUnion.getInstance(mem, Comparator.naturalOrder(), serDe); bytesOut = union.toByteArray(serDe); diff --git a/src/test/java/com/yahoo/sketches/quantiles/PreambleUtilTest.java b/src/test/java/com/yahoo/sketches/quantiles/PreambleUtilTest.java index 293af8958..3fbac7a03 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/PreambleUtilTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/PreambleUtilTest.java @@ -43,6 +43,7 @@ import com.yahoo.memory.WritableDirectHandle; import com.yahoo.memory.WritableMemory; +@SuppressWarnings("javadoc") public class PreambleUtilTest { @Test diff --git a/src/test/java/com/yahoo/sketches/quantiles/ReadOnlyMemoryTest.java b/src/test/java/com/yahoo/sketches/quantiles/ReadOnlyMemoryTest.java index be0a8f059..a0a8efa0b 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/ReadOnlyMemoryTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/ReadOnlyMemoryTest.java @@ -28,6 +28,7 @@ import com.yahoo.sketches.SketchesArgumentException; import com.yahoo.sketches.SketchesReadOnlyException; +@SuppressWarnings("javadoc") public class ReadOnlyMemoryTest { @Test diff --git a/src/test/java/com/yahoo/sketches/quantiles/SerDeCompatibilityTest.java b/src/test/java/com/yahoo/sketches/quantiles/SerDeCompatibilityTest.java index b17fe6fc1..a0e978151 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/SerDeCompatibilityTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/SerDeCompatibilityTest.java @@ -28,6 +28,7 @@ import com.yahoo.sketches.ArrayOfDoublesSerDe; import com.yahoo.sketches.ArrayOfItemsSerDe; +@SuppressWarnings("javadoc") public class SerDeCompatibilityTest { private static final ArrayOfItemsSerDe serDe = new ArrayOfDoublesSerDe(); @@ -59,7 +60,7 @@ public void doublesToItems() { DoublesSketchTest.testSketchEquality(sketch1, cs); //final byte[] bytes = sketch1.compact().toByteArray(); // must be compact final byte[] bytes = cs.toByteArray(); // must be compact - + //reconstruct with ItemsSketch final ItemsSketch sketch2 = ItemsSketch.getInstance(Memory.wrap(bytes), Comparator.naturalOrder(), serDe); @@ -72,5 +73,5 @@ public void doublesToItems() { // based on ~1.7% normalized rank error for this particular case Assert.assertEquals(sketch2.getQuantile(0.5), 500.0, 17); } - + } diff --git a/src/test/java/com/yahoo/sketches/quantiles/UtilTest.java b/src/test/java/com/yahoo/sketches/quantiles/UtilTest.java index dea845d5b..62b0a824b 100644 --- a/src/test/java/com/yahoo/sketches/quantiles/UtilTest.java +++ b/src/test/java/com/yahoo/sketches/quantiles/UtilTest.java @@ -30,6 +30,7 @@ import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class UtilTest { @Test diff --git a/src/test/java/com/yahoo/sketches/sampling/ReservoirItemsSketchTest.java b/src/test/java/com/yahoo/sketches/sampling/ReservoirItemsSketchTest.java index 2d8b2a6e7..c4b71b691 100644 --- a/src/test/java/com/yahoo/sketches/sampling/ReservoirItemsSketchTest.java +++ b/src/test/java/com/yahoo/sketches/sampling/ReservoirItemsSketchTest.java @@ -46,6 +46,7 @@ import com.yahoo.sketches.SketchesException; import com.yahoo.sketches.SketchesStateException; +@SuppressWarnings("javadoc") public class ReservoirItemsSketchTest { private static final double EPS = 1e-8; diff --git a/src/test/java/com/yahoo/sketches/sampling/ReservoirItemsUnionTest.java b/src/test/java/com/yahoo/sketches/sampling/ReservoirItemsUnionTest.java index 2605e41df..b712ed0af 100644 --- a/src/test/java/com/yahoo/sketches/sampling/ReservoirItemsUnionTest.java +++ b/src/test/java/com/yahoo/sketches/sampling/ReservoirItemsUnionTest.java @@ -44,6 +44,7 @@ import com.yahoo.sketches.SketchesArgumentException; // Tests mostly focus on Long since other types are already tested in ReservoirItemsSketchTest. +@SuppressWarnings("javadoc") public class ReservoirItemsUnionTest { @Test public void checkEmptyUnion() { @@ -321,7 +322,7 @@ public void checkListInputUpdate() { assertEquals(riu.getResult().getK(), k); // power of 2, so exact data = new ArrayList<>(2 * k); - for (int i = 0; i < 2 * k; ++i) { + for (int i = 0; i < (2 * k); ++i) { data.add(i); } riu.update(10 * n, 2 * k, data); diff --git a/src/test/java/com/yahoo/sketches/sampling/ReservoirLongsSketchTest.java b/src/test/java/com/yahoo/sketches/sampling/ReservoirLongsSketchTest.java index 41cf1038d..f75470544 100644 --- a/src/test/java/com/yahoo/sketches/sampling/ReservoirLongsSketchTest.java +++ b/src/test/java/com/yahoo/sketches/sampling/ReservoirLongsSketchTest.java @@ -39,6 +39,7 @@ import com.yahoo.sketches.SketchesException; import com.yahoo.sketches.SketchesStateException; +@SuppressWarnings("javadoc") public class ReservoirLongsSketchTest { private static final double EPS = 1e-8; diff --git a/src/test/java/com/yahoo/sketches/sampling/ReservoirLongsUnionTest.java b/src/test/java/com/yahoo/sketches/sampling/ReservoirLongsUnionTest.java index 7f12bc2af..c777aa022 100644 --- a/src/test/java/com/yahoo/sketches/sampling/ReservoirLongsUnionTest.java +++ b/src/test/java/com/yahoo/sketches/sampling/ReservoirLongsUnionTest.java @@ -37,6 +37,7 @@ import com.yahoo.sketches.Family; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class ReservoirLongsUnionTest { @Test public void checkEmptyUnion() { diff --git a/src/test/java/com/yahoo/sketches/sampling/ReservoirSizeTest.java b/src/test/java/com/yahoo/sketches/sampling/ReservoirSizeTest.java index 12d4d249b..603e19ad1 100644 --- a/src/test/java/com/yahoo/sketches/sampling/ReservoirSizeTest.java +++ b/src/test/java/com/yahoo/sketches/sampling/ReservoirSizeTest.java @@ -27,6 +27,7 @@ import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class ReservoirSizeTest { @Test public void checkComputeSize() { diff --git a/src/test/java/com/yahoo/sketches/sampling/VarOptItemsSamplesTest.java b/src/test/java/com/yahoo/sketches/sampling/VarOptItemsSamplesTest.java index cad7c097b..77cf44565 100644 --- a/src/test/java/com/yahoo/sketches/sampling/VarOptItemsSamplesTest.java +++ b/src/test/java/com/yahoo/sketches/sampling/VarOptItemsSamplesTest.java @@ -33,6 +33,7 @@ /** * @author Jon Malkin */ +@SuppressWarnings("javadoc") public class VarOptItemsSamplesTest { @Test public void compareIteratorToArrays() { diff --git a/src/test/java/com/yahoo/sketches/sampling/VarOptItemsSketchTest.java b/src/test/java/com/yahoo/sketches/sampling/VarOptItemsSketchTest.java index ff0bbb372..111ac32e1 100644 --- a/src/test/java/com/yahoo/sketches/sampling/VarOptItemsSketchTest.java +++ b/src/test/java/com/yahoo/sketches/sampling/VarOptItemsSketchTest.java @@ -39,6 +39,7 @@ import com.yahoo.sketches.SketchesArgumentException; import com.yahoo.sketches.SketchesStateException; +@SuppressWarnings("javadoc") public class VarOptItemsSketchTest { static final double EPS = 1e-10; diff --git a/src/test/java/com/yahoo/sketches/sampling/VarOptItemsUnionTest.java b/src/test/java/com/yahoo/sketches/sampling/VarOptItemsUnionTest.java index 5196c56cf..a7b2ec007 100644 --- a/src/test/java/com/yahoo/sketches/sampling/VarOptItemsUnionTest.java +++ b/src/test/java/com/yahoo/sketches/sampling/VarOptItemsUnionTest.java @@ -36,10 +36,10 @@ import com.yahoo.sketches.Family; import com.yahoo.sketches.SketchesArgumentException; - /** * @author Jon Malkin */ +@SuppressWarnings("javadoc") public class VarOptItemsUnionTest { @Test(expectedExceptions = SketchesArgumentException.class) public void checkBadSerVer() { @@ -166,8 +166,8 @@ public void unionIdenticalSamplingSketches() { sketch = getUnweightedLongsVIS(k, k + 1); // tau = (k + 1) / k union.update(sketch); result = union.getResult(); - expectedWeight = 2.0 * n + k + 1; - assertEquals(result.getN(), 2 * n + k + 1); + expectedWeight = (2.0 * n) + k + 1; + assertEquals(result.getN(), (2 * n) + k + 1); assertEquals(result.getTotalWtR(), expectedWeight, EPS); union.reset(); @@ -237,7 +237,7 @@ public void unionExactReservoirSketch() { compareUnionsExact(union1, union2); // union2 should be unchanged - for (long i = 1; i < k - 1; ++i) { + for (long i = 1; i < (k - 1); ++i) { ris.update(i); vis.update(i, 1.0); } @@ -312,7 +312,7 @@ public void unionReservoirVariousTauValues() { // reservoir tau will be greater than gadget's tau VarOptItemsSketch vis = VarOptItemsSketch.newInstance(k); ReservoirItemsSketch ris = ReservoirItemsSketch.newInstance(k); - for (long i = 1; i < 2 * n; ++i) { + for (long i = 1; i < (2 * n); ++i) { ris.update(i); vis.update(i, 1.0); } @@ -324,7 +324,7 @@ public void unionReservoirVariousTauValues() { // reservoir tau will be smaller than gadget's tau vis = VarOptItemsSketch.newInstance(k); ris = ReservoirItemsSketch.newInstance(k); - for (long i = 1; i <= k + 1; ++i) { + for (long i = 1; i <= (k + 1); ++i) { ris.update(i); vis.update(i, 1.0); } diff --git a/src/test/java/com/yahoo/sketches/theta/CompactSketchTest.java b/src/test/java/com/yahoo/sketches/theta/CompactSketchTest.java index ff9fe0fc3..26073b4d1 100644 --- a/src/test/java/com/yahoo/sketches/theta/CompactSketchTest.java +++ b/src/test/java/com/yahoo/sketches/theta/CompactSketchTest.java @@ -36,6 +36,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class CompactSketchTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/ConcurrentDirectQuickSelectSketchTest.java b/src/test/java/com/yahoo/sketches/theta/ConcurrentDirectQuickSelectSketchTest.java index 3b96d4291..d717ec6f7 100644 --- a/src/test/java/com/yahoo/sketches/theta/ConcurrentDirectQuickSelectSketchTest.java +++ b/src/test/java/com/yahoo/sketches/theta/ConcurrentDirectQuickSelectSketchTest.java @@ -39,6 +39,7 @@ /** * @author eshcar */ +@SuppressWarnings("javadoc") public class ConcurrentDirectQuickSelectSketchTest { private int lgK; diff --git a/src/test/java/com/yahoo/sketches/theta/ConcurrentHeapQuickSelectSketchTest.java b/src/test/java/com/yahoo/sketches/theta/ConcurrentHeapQuickSelectSketchTest.java index 362be6ea0..bdb0e5b1d 100644 --- a/src/test/java/com/yahoo/sketches/theta/ConcurrentHeapQuickSelectSketchTest.java +++ b/src/test/java/com/yahoo/sketches/theta/ConcurrentHeapQuickSelectSketchTest.java @@ -42,6 +42,7 @@ /** * @author eshcar */ +@SuppressWarnings("javadoc") public class ConcurrentHeapQuickSelectSketchTest { private int lgK; private long seed = DEFAULT_UPDATE_SEED; diff --git a/src/test/java/com/yahoo/sketches/theta/DirectIntersectionTest.java b/src/test/java/com/yahoo/sketches/theta/DirectIntersectionTest.java index 7dc3f509c..1792044c9 100644 --- a/src/test/java/com/yahoo/sketches/theta/DirectIntersectionTest.java +++ b/src/test/java/com/yahoo/sketches/theta/DirectIntersectionTest.java @@ -41,6 +41,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DirectIntersectionTest { private static final int PREBYTES = CONST_PREAMBLE_LONGS << 3; //24 diff --git a/src/test/java/com/yahoo/sketches/theta/DirectQuickSelectSketchTest.java b/src/test/java/com/yahoo/sketches/theta/DirectQuickSelectSketchTest.java index 9c33ef173..c7f03bea8 100644 --- a/src/test/java/com/yahoo/sketches/theta/DirectQuickSelectSketchTest.java +++ b/src/test/java/com/yahoo/sketches/theta/DirectQuickSelectSketchTest.java @@ -55,6 +55,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DirectQuickSelectSketchTest { @Test(expectedExceptions = SketchesArgumentException.class) diff --git a/src/test/java/com/yahoo/sketches/theta/DirectUnionTest.java b/src/test/java/com/yahoo/sketches/theta/DirectUnionTest.java index 27374d681..01fc24b2c 100644 --- a/src/test/java/com/yahoo/sketches/theta/DirectUnionTest.java +++ b/src/test/java/com/yahoo/sketches/theta/DirectUnionTest.java @@ -42,6 +42,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class DirectUnionTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/EmptyTest.java b/src/test/java/com/yahoo/sketches/theta/EmptyTest.java index 869661076..fc9f2a334 100644 --- a/src/test/java/com/yahoo/sketches/theta/EmptyTest.java +++ b/src/test/java/com/yahoo/sketches/theta/EmptyTest.java @@ -37,6 +37,7 @@ * * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class EmptyTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/ExamplesTest.java b/src/test/java/com/yahoo/sketches/theta/ExamplesTest.java index 81476ff62..170f5db1e 100644 --- a/src/test/java/com/yahoo/sketches/theta/ExamplesTest.java +++ b/src/test/java/com/yahoo/sketches/theta/ExamplesTest.java @@ -21,25 +21,26 @@ import org.testng.annotations.Test; -/** +/** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class ExamplesTest { - + @Test public void simpleCountingSketch() { int k = 4096; int u = 1000000; - + UpdateSketch sketch = UpdateSketch.builder().setNominalEntries(k).build(); for (int i = 0; i < u; i++) { sketch.update(i); } - + println(sketch.toString()); } /* -### HeapQuickSelectSketch SUMMARY: +### HeapQuickSelectSketch SUMMARY: Nominal Entries (k) : 4096 Estimate : 1002714.745231455 Upper Bound, 95% conf : 1027777.3354974985 @@ -57,17 +58,17 @@ Nominal Entries (k) : 4096 Seed Hash : ffff93cc ### END SKETCH SUMMARY */ - + @Test public void printlnTest() { println("PRINTING: "+this.getClass().getName()); } - + /** - * @param s value to print + * @param s value to print */ static void println(String s) { //System.out.println(s); //enable/disable here } - + } diff --git a/src/test/java/com/yahoo/sketches/theta/ForwardCompatibilityTest.java b/src/test/java/com/yahoo/sketches/theta/ForwardCompatibilityTest.java index 5c2536e05..e4ade7ef4 100644 --- a/src/test/java/com/yahoo/sketches/theta/ForwardCompatibilityTest.java +++ b/src/test/java/com/yahoo/sketches/theta/ForwardCompatibilityTest.java @@ -34,6 +34,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class ForwardCompatibilityTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/HeapAlphaSketchTest.java b/src/test/java/com/yahoo/sketches/theta/HeapAlphaSketchTest.java index 7833b46e3..202e944ce 100644 --- a/src/test/java/com/yahoo/sketches/theta/HeapAlphaSketchTest.java +++ b/src/test/java/com/yahoo/sketches/theta/HeapAlphaSketchTest.java @@ -50,6 +50,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class HeapAlphaSketchTest { private Family fam_ = ALPHA; diff --git a/src/test/java/com/yahoo/sketches/theta/HeapAnotBTest.java b/src/test/java/com/yahoo/sketches/theta/HeapAnotBTest.java index c0d84cd80..3e5bdc43d 100644 --- a/src/test/java/com/yahoo/sketches/theta/HeapAnotBTest.java +++ b/src/test/java/com/yahoo/sketches/theta/HeapAnotBTest.java @@ -34,6 +34,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class HeapAnotBTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/HeapIntersectionTest.java b/src/test/java/com/yahoo/sketches/theta/HeapIntersectionTest.java index 32ba66cff..a927b6be1 100644 --- a/src/test/java/com/yahoo/sketches/theta/HeapIntersectionTest.java +++ b/src/test/java/com/yahoo/sketches/theta/HeapIntersectionTest.java @@ -38,6 +38,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class HeapIntersectionTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/HeapQuickSelectSketchTest.java b/src/test/java/com/yahoo/sketches/theta/HeapQuickSelectSketchTest.java index 62dee2331..38dc1ada3 100644 --- a/src/test/java/com/yahoo/sketches/theta/HeapQuickSelectSketchTest.java +++ b/src/test/java/com/yahoo/sketches/theta/HeapQuickSelectSketchTest.java @@ -51,6 +51,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class HeapQuickSelectSketchTest { private Family fam_ = QUICKSELECT; diff --git a/src/test/java/com/yahoo/sketches/theta/HeapUnionTest.java b/src/test/java/com/yahoo/sketches/theta/HeapUnionTest.java index f7442da3a..2869bf9ba 100644 --- a/src/test/java/com/yahoo/sketches/theta/HeapUnionTest.java +++ b/src/test/java/com/yahoo/sketches/theta/HeapUnionTest.java @@ -39,6 +39,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class HeapUnionTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/IteratorTest.java b/src/test/java/com/yahoo/sketches/theta/IteratorTest.java index 0647a3d15..d8894ee18 100644 --- a/src/test/java/com/yahoo/sketches/theta/IteratorTest.java +++ b/src/test/java/com/yahoo/sketches/theta/IteratorTest.java @@ -29,6 +29,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class IteratorTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/JaccardSimilarityTest.java b/src/test/java/com/yahoo/sketches/theta/JaccardSimilarityTest.java index dc3e8f295..9c6e34f43 100644 --- a/src/test/java/com/yahoo/sketches/theta/JaccardSimilarityTest.java +++ b/src/test/java/com/yahoo/sketches/theta/JaccardSimilarityTest.java @@ -29,6 +29,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class JaccardSimilarityTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/PairwiseCornerCasesTest.java b/src/test/java/com/yahoo/sketches/theta/PairwiseCornerCasesTest.java index 2a1d82047..8d138644f 100644 --- a/src/test/java/com/yahoo/sketches/theta/PairwiseCornerCasesTest.java +++ b/src/test/java/com/yahoo/sketches/theta/PairwiseCornerCasesTest.java @@ -34,6 +34,7 @@ import com.yahoo.memory.WritableMemory; +@SuppressWarnings("javadoc") public class PairwiseCornerCasesTest { Random rand = new Random(9001); //deterministic diff --git a/src/test/java/com/yahoo/sketches/theta/PairwiseSetOperationsTest.java b/src/test/java/com/yahoo/sketches/theta/PairwiseSetOperationsTest.java index 059c28c50..d4837a47b 100644 --- a/src/test/java/com/yahoo/sketches/theta/PairwiseSetOperationsTest.java +++ b/src/test/java/com/yahoo/sketches/theta/PairwiseSetOperationsTest.java @@ -23,6 +23,7 @@ import org.testng.annotations.Test; +@SuppressWarnings("javadoc") public class PairwiseSetOperationsTest { // Intersection diff --git a/src/test/java/com/yahoo/sketches/theta/PreambleUtilTest.java b/src/test/java/com/yahoo/sketches/theta/PreambleUtilTest.java index d7dccf5e3..74bd4b7c6 100644 --- a/src/test/java/com/yahoo/sketches/theta/PreambleUtilTest.java +++ b/src/test/java/com/yahoo/sketches/theta/PreambleUtilTest.java @@ -66,6 +66,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class PreambleUtilTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/ReadOnlyMemoryTest.java b/src/test/java/com/yahoo/sketches/theta/ReadOnlyMemoryTest.java index dc2a79508..41d26c5f6 100644 --- a/src/test/java/com/yahoo/sketches/theta/ReadOnlyMemoryTest.java +++ b/src/test/java/com/yahoo/sketches/theta/ReadOnlyMemoryTest.java @@ -31,6 +31,7 @@ import com.yahoo.memory.Memory; import com.yahoo.sketches.SketchesReadOnlyException; +@SuppressWarnings("javadoc") public class ReadOnlyMemoryTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/SetOperationTest.java b/src/test/java/com/yahoo/sketches/theta/SetOperationTest.java index 266ff9545..90da7987f 100644 --- a/src/test/java/com/yahoo/sketches/theta/SetOperationTest.java +++ b/src/test/java/com/yahoo/sketches/theta/SetOperationTest.java @@ -46,6 +46,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class SetOperationTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/SingleItemSketchTest.java b/src/test/java/com/yahoo/sketches/theta/SingleItemSketchTest.java index 722eb048d..7ff8a13e6 100644 --- a/src/test/java/com/yahoo/sketches/theta/SingleItemSketchTest.java +++ b/src/test/java/com/yahoo/sketches/theta/SingleItemSketchTest.java @@ -39,6 +39,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class SingleItemSketchTest { final static short DEFAULT_SEED_HASH = (short) (computeSeedHash(DEFAULT_UPDATE_SEED) & 0XFFFFL); diff --git a/src/test/java/com/yahoo/sketches/theta/SketchTest.java b/src/test/java/com/yahoo/sketches/theta/SketchTest.java index 852d33507..94b2d4f5b 100644 --- a/src/test/java/com/yahoo/sketches/theta/SketchTest.java +++ b/src/test/java/com/yahoo/sketches/theta/SketchTest.java @@ -51,6 +51,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class SketchTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/SketchesTest.java b/src/test/java/com/yahoo/sketches/theta/SketchesTest.java index 1cbc2d788..b20e287aa 100644 --- a/src/test/java/com/yahoo/sketches/theta/SketchesTest.java +++ b/src/test/java/com/yahoo/sketches/theta/SketchesTest.java @@ -45,6 +45,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class SketchesTest { private static Memory getCompactSketchMemory(int k, int from, int to) { diff --git a/src/test/java/com/yahoo/sketches/theta/UnionImplTest.java b/src/test/java/com/yahoo/sketches/theta/UnionImplTest.java index 96a0bfa41..8bff30505 100644 --- a/src/test/java/com/yahoo/sketches/theta/UnionImplTest.java +++ b/src/test/java/com/yahoo/sketches/theta/UnionImplTest.java @@ -34,6 +34,7 @@ import com.yahoo.sketches.SketchesArgumentException; import com.yahoo.sketches.Util; +@SuppressWarnings("javadoc") public class UnionImplTest { @Test diff --git a/src/test/java/com/yahoo/sketches/theta/UpdateSketchTest.java b/src/test/java/com/yahoo/sketches/theta/UpdateSketchTest.java index 8ccec5901..28f35224f 100644 --- a/src/test/java/com/yahoo/sketches/theta/UpdateSketchTest.java +++ b/src/test/java/com/yahoo/sketches/theta/UpdateSketchTest.java @@ -35,9 +35,11 @@ import com.yahoo.sketches.ResizeFactor; import com.yahoo.sketches.SketchesArgumentException; import com.yahoo.sketches.Util; + /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class UpdateSketchTest { @Test diff --git a/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesAnotBTest.java b/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesAnotBTest.java index cc5c84ee2..c82720f1e 100644 --- a/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesAnotBTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesAnotBTest.java @@ -25,6 +25,7 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class ArrayOfDoublesAnotBTest { @Test @@ -219,11 +220,15 @@ public void exactModeCustomSeed() { public void estimationMode() { int key = 0; ArrayOfDoublesUpdatableSketch sketchA = new ArrayOfDoublesUpdatableSketchBuilder().build(); - for (int i = 0; i < 8192; i++) sketchA.update(key++, new double[] {1}); + for (int i = 0; i < 8192; i++) { + sketchA.update(key++, new double[] {1}); + } key -= 4096; // overlap half of the entries ArrayOfDoublesUpdatableSketch sketchB = new ArrayOfDoublesUpdatableSketchBuilder().build(); - for (int i = 0; i < 8192; i++) sketchB.update(key++, new double[] {1}); + for (int i = 0; i < 8192; i++) { + sketchB.update(key++, new double[] {1}); + } ArrayOfDoublesAnotB aNotB = new ArrayOfDoublesSetOperationBuilder().buildAnotB(); aNotB.update(sketchA, sketchB); @@ -254,11 +259,15 @@ public void estimationMode() { public void estimationModeLargeB() { int key = 0; ArrayOfDoublesUpdatableSketch sketchA = new ArrayOfDoublesUpdatableSketchBuilder().build(); - for (int i = 0; i < 10000; i++) sketchA.update(key++, new double[] {1}); + for (int i = 0; i < 10000; i++) { + sketchA.update(key++, new double[] {1}); + } key -= 2000; // overlap ArrayOfDoublesUpdatableSketch sketchB = new ArrayOfDoublesUpdatableSketchBuilder().build(); - for (int i = 0; i < 100000; i++) sketchB.update(key++, new double[] {1}); + for (int i = 0; i < 100000; i++) { + sketchB.update(key++, new double[] {1}); + } final int expected = 10000 - 2000; ArrayOfDoublesAnotB aNotB = new ArrayOfDoublesSetOperationBuilder().buildAnotB(); diff --git a/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesCompactSketchTest.java b/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesCompactSketchTest.java index 0b2d4e7e6..04cafb677 100644 --- a/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesCompactSketchTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesCompactSketchTest.java @@ -25,6 +25,7 @@ import com.yahoo.memory.Memory; import com.yahoo.memory.WritableMemory; +@SuppressWarnings("javadoc") public class ArrayOfDoublesCompactSketchTest { @Test public void heapToDirectExactTwoDoubles() { diff --git a/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesIntersectionTest.java b/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesIntersectionTest.java index c8974632e..c0a64d421 100644 --- a/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesIntersectionTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesIntersectionTest.java @@ -25,11 +25,14 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class ArrayOfDoublesIntersectionTest { private static ArrayOfDoublesCombiner combiner = new ArrayOfDoublesCombiner() { @Override public double[] combine(double[] a, double[] b) { - for (int i = 0; i < a.length; i++) a[i] += b[i]; + for (int i = 0; i < a.length; i++) { + a[i] += b[i]; + } return a; } }; @@ -143,7 +146,9 @@ public void heapExactMode() { Assert.assertEquals(result.getLowerBound(1), 1.0); Assert.assertEquals(result.getUpperBound(1), 1.0); double[][] values = result.getValues(); - for (int i = 0; i < values.length; i++) Assert.assertEquals(values[i][0], 4.0); + for (int i = 0; i < values.length; i++) { + Assert.assertEquals(values[i][0], 4.0); + } intersection.reset(); intersection.update(null, null); @@ -159,10 +164,14 @@ public void heapExactMode() { public void heapDisjointEstimationMode() { int key = 0; ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder().build(); - for (int i = 0; i < 8192; i++) sketch1.update(key++, new double[] {1.0}); + for (int i = 0; i < 8192; i++) { + sketch1.update(key++, new double[] {1.0}); + } ArrayOfDoublesUpdatableSketch sketch2 = new ArrayOfDoublesUpdatableSketchBuilder().build(); - for (int i = 0; i < 8192; i++) sketch2.update(key++, new double[] {1.0}); + for (int i = 0; i < 8192; i++) { + sketch2.update(key++, new double[] {1.0}); + } ArrayOfDoublesIntersection intersection = new ArrayOfDoublesSetOperationBuilder().buildIntersection(); intersection.update(sketch1, combiner); @@ -181,11 +190,15 @@ public void directDisjointEstimationMode() { int key = 0; ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder(). build(WritableMemory.wrap(new byte[1000000])); - for (int i = 0; i < 8192; i++) sketch1.update(key++, new double[] {1.0}); + for (int i = 0; i < 8192; i++) { + sketch1.update(key++, new double[] {1.0}); + } ArrayOfDoublesUpdatableSketch sketch2 = new ArrayOfDoublesUpdatableSketchBuilder(). build(WritableMemory.wrap(new byte[1000000])); - for (int i = 0; i < 8192; i++) sketch2.update(key++, new double[] {1.0}); + for (int i = 0; i < 8192; i++) { + sketch2.update(key++, new double[] {1.0}); + } ArrayOfDoublesIntersection intersection = new ArrayOfDoublesSetOperationBuilder(). buildIntersection(WritableMemory.wrap(new byte[1000000])); @@ -204,11 +217,15 @@ public void directDisjointEstimationMode() { public void heapEstimationMode() { int key = 0; ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder().build(); - for (int i = 0; i < 8192; i++) sketch1.update(key++, new double[] {1.0}); + for (int i = 0; i < 8192; i++) { + sketch1.update(key++, new double[] {1.0}); + } key -= 4096; // overlap half of the entries ArrayOfDoublesUpdatableSketch sketch2 = new ArrayOfDoublesUpdatableSketchBuilder().build(); - for (int i = 0; i < 8192; i++) sketch2.update(key++, new double[] {1.0}); + for (int i = 0; i < 8192; i++) { + sketch2.update(key++, new double[] {1.0}); + } ArrayOfDoublesIntersection intersection = new ArrayOfDoublesSetOperationBuilder().buildIntersection(); intersection.update(sketch1, combiner); @@ -219,18 +236,24 @@ public void heapEstimationMode() { Assert.assertTrue(result.getLowerBound(1) <= result.getEstimate()); Assert.assertTrue(result.getUpperBound(1) > result.getEstimate()); double[][] values = result.getValues(); - for (int i = 0; i < values.length; i++) Assert.assertEquals(values[i][0], 2.0); + for (int i = 0; i < values.length; i++) { + Assert.assertEquals(values[i][0], 2.0); + } } @Test public void directEstimationMode() { int key = 0; ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder().build(WritableMemory.wrap(new byte[1000000])); - for (int i = 0; i < 8192; i++) sketch1.update(key++, new double[] {1.0}); + for (int i = 0; i < 8192; i++) { + sketch1.update(key++, new double[] {1.0}); + } key -= 4096; // overlap half of the entries ArrayOfDoublesUpdatableSketch sketch2 = new ArrayOfDoublesUpdatableSketchBuilder().build(WritableMemory.wrap(new byte[1000000])); - for (int i = 0; i < 8192; i++) sketch2.update(key++, new double[] {1.0}); + for (int i = 0; i < 8192; i++) { + sketch2.update(key++, new double[] {1.0}); + } ArrayOfDoublesIntersection intersection = new ArrayOfDoublesSetOperationBuilder().buildIntersection(WritableMemory.wrap(new byte[1000000])); intersection.update(sketch1, combiner); @@ -241,7 +264,9 @@ public void directEstimationMode() { Assert.assertTrue(result.getLowerBound(1) <= result.getEstimate()); Assert.assertTrue(result.getUpperBound(1) > result.getEstimate()); double[][] values = result.getValues(); - for (int i = 0; i < values.length; i++) Assert.assertEquals(values[i][0], 2.0); + for (int i = 0; i < values.length; i++) { + Assert.assertEquals(values[i][0], 2.0); + } } @Test @@ -270,7 +295,9 @@ public void heapExactModeCustomSeed() { Assert.assertEquals(result.getLowerBound(1), 1.0); Assert.assertEquals(result.getUpperBound(1), 1.0); double[][] values = result.getValues(); - for (int i = 0; i < values.length; i++) Assert.assertEquals(values[i][0], 4.0); + for (int i = 0; i < values.length; i++) { + Assert.assertEquals(values[i][0], 4.0); + } } @Test(expectedExceptions = SketchesArgumentException.class) diff --git a/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesQuickSelectSketchTest.java b/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesQuickSelectSketchTest.java index 84e901175..5196aa996 100644 --- a/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesQuickSelectSketchTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesQuickSelectSketchTest.java @@ -26,6 +26,7 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class ArrayOfDoublesQuickSelectSketchTest { @Test(expectedExceptions = SketchesArgumentException.class) @@ -36,7 +37,7 @@ public void invalidSamplingProbability() { @Test public void heapToDirectExactTwoDoubles() { double[] valuesArr = {1.0, 2.0}; - ArrayOfDoublesUpdatableSketch sketch1 = + ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder().setNumberOfValues(2).build(); sketch1.update("a", valuesArr); sketch1.update("b", valuesArr); @@ -69,7 +70,7 @@ public void heapToDirectWithSeed() { long seed = 1; double[] values = {1.0}; - ArrayOfDoublesUpdatableSketch sketch1 = + ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder().setSeed(seed).build(); sketch1.update("a", values); sketch1.update("b", values); @@ -85,15 +86,15 @@ public void heapToDirectWithSeed() { @Test(expectedExceptions = SketchesArgumentException.class) public void checkInsertExceptions() { - ArrayOfDoublesUpdatableSketch sketch1 = + ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder().setNumberOfValues(2).build(); sketch1.update("a", new double[] {1.0}); } - + @Test public void directToHeapExactTwoDoubles() { double[] valuesArr = {1.0, 2.0}; - ArrayOfDoublesUpdatableSketch sketch1 = + ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder(). setNumberOfValues(2).build(WritableMemory.wrap(new byte[1000000])); sketch1.update("a", valuesArr); @@ -121,13 +122,13 @@ public void directToHeapExactTwoDoubles() { Assert.assertEquals(array[1], 4.0); } } - + @Test public void directToHeapWithSeed() { long seed = 1; double[] values = {1.0}; - ArrayOfDoublesUpdatableSketch sketch1 = + ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder().setSeed(seed).build( WritableMemory.wrap(new byte[1000000])); sketch1.update("a", values); diff --git a/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesUnionTest.java b/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesUnionTest.java index 47cb28dec..6eeaab6ff 100644 --- a/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesUnionTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/ArrayOfDoublesUnionTest.java @@ -28,6 +28,7 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class ArrayOfDoublesUnionTest { @Test diff --git a/src/test/java/com/yahoo/sketches/tuple/CompactSketchWithDoubleSummaryTest.java b/src/test/java/com/yahoo/sketches/tuple/CompactSketchWithDoubleSummaryTest.java index de861b394..c6602a33d 100644 --- a/src/test/java/com/yahoo/sketches/tuple/CompactSketchWithDoubleSummaryTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/CompactSketchWithDoubleSummaryTest.java @@ -28,10 +28,11 @@ import com.yahoo.sketches.tuple.adouble.DoubleSummaryDeserializer; import com.yahoo.sketches.tuple.adouble.DoubleSummaryFactory; +@SuppressWarnings("javadoc") public class CompactSketchWithDoubleSummaryTest { @Test public void emptyFromNonPublicConstructorNullArray() { - CompactSketch sketch = new CompactSketch(null, null, Long.MAX_VALUE, true); + CompactSketch sketch = new CompactSketch<>(null, null, Long.MAX_VALUE, true); Assert.assertTrue(sketch.isEmpty()); Assert.assertFalse(sketch.isEstimationMode()); Assert.assertEquals(sketch.getEstimate(), 0.0); @@ -49,7 +50,7 @@ public void emptyFromNonPublicConstructorNullArray() { public void emptyFromNonPublicConstructor() { long[] keys = new long[0]; DoubleSummary[] summaries = (DoubleSummary[]) java.lang.reflect.Array.newInstance(DoubleSummary.class, 0); - CompactSketch sketch = new CompactSketch(keys, summaries, Long.MAX_VALUE, true); + CompactSketch sketch = new CompactSketch<>(keys, summaries, Long.MAX_VALUE, true); Assert.assertTrue(sketch.isEmpty()); Assert.assertFalse(sketch.isEstimationMode()); Assert.assertEquals(sketch.getEstimate(), 0.0); @@ -136,7 +137,9 @@ public void serializeDeserializeSmallExact() { @Test public void serializeDeserializeEstimation() throws Exception { UpdatableSketch us = new UpdatableSketchBuilder<>(new DoubleSummaryFactory()).build(); - for (int i = 0; i < 8192; i++) us.update(i, 1.0); + for (int i = 0; i < 8192; i++) { + us.update(i, 1.0); + } us.trim(); CompactSketch sketch1 = us.compact(); byte[] bytes = sketch1.toByteArray(); @@ -162,7 +165,9 @@ public void serializeDeserializeEstimation() throws Exception { @Test(expectedExceptions = SketchesArgumentException.class) public void deserializeWrongType() { UpdatableSketch us = new UpdatableSketchBuilder<>(new DoubleSummaryFactory()).build(); - for (int i = 0; i < 8192; i++) us.update(i, 1.0); + for (int i = 0; i < 8192; i++) { + us.update(i, 1.0); + } CompactSketch sketch1 = us.compact(); Sketches.heapifyUpdatableSketch(Memory.wrap(sketch1.toByteArray()), new DoubleSummaryDeserializer(), new DoubleSummaryFactory()); diff --git a/src/test/java/com/yahoo/sketches/tuple/DirectArrayOfDoublesCompactSketchTest.java b/src/test/java/com/yahoo/sketches/tuple/DirectArrayOfDoublesCompactSketchTest.java index 519be3598..5e4839164 100644 --- a/src/test/java/com/yahoo/sketches/tuple/DirectArrayOfDoublesCompactSketchTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/DirectArrayOfDoublesCompactSketchTest.java @@ -27,6 +27,7 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class DirectArrayOfDoublesCompactSketchTest { @Test diff --git a/src/test/java/com/yahoo/sketches/tuple/DirectArrayOfDoublesQuickSelectSketchTest.java b/src/test/java/com/yahoo/sketches/tuple/DirectArrayOfDoublesQuickSelectSketchTest.java index f47412d1d..869f224c1 100644 --- a/src/test/java/com/yahoo/sketches/tuple/DirectArrayOfDoublesQuickSelectSketchTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/DirectArrayOfDoublesQuickSelectSketchTest.java @@ -26,6 +26,7 @@ import com.yahoo.sketches.ResizeFactor; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class DirectArrayOfDoublesQuickSelectSketchTest { @Test public void isEmpty() { diff --git a/src/test/java/com/yahoo/sketches/tuple/FilterTest.java b/src/test/java/com/yahoo/sketches/tuple/FilterTest.java index dadd1d7f5..5f839593d 100644 --- a/src/test/java/com/yahoo/sketches/tuple/FilterTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/FilterTest.java @@ -27,6 +27,7 @@ import com.yahoo.sketches.tuple.adouble.DoubleSummary; import com.yahoo.sketches.tuple.adouble.DoubleSummaryFactory; +@SuppressWarnings("javadoc") public class FilterTest { private static final int numberOfElements = 100; diff --git a/src/test/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesCompactSketchTest.java b/src/test/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesCompactSketchTest.java index 9f44b4593..f39441908 100644 --- a/src/test/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesCompactSketchTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesCompactSketchTest.java @@ -26,6 +26,7 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class HeapArrayOfDoublesCompactSketchTest { @Test public void emptyFromQuickSelectSketch() { diff --git a/src/test/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesQuickSelectSketchTest.java b/src/test/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesQuickSelectSketchTest.java index 32db63e91..0d0413da4 100644 --- a/src/test/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesQuickSelectSketchTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesQuickSelectSketchTest.java @@ -26,6 +26,7 @@ import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.ResizeFactor; +@SuppressWarnings("javadoc") public class HeapArrayOfDoublesQuickSelectSketchTest { @Test public void isEmpty() { @@ -76,7 +77,9 @@ public void exactMode() { ArrayOfDoublesUpdatableSketch sketch = new ArrayOfDoublesUpdatableSketchBuilder().build(); Assert.assertTrue(sketch.isEmpty()); Assert.assertEquals(sketch.getEstimate(), 0.0); - for (int i = 1; i <= 4096; i++) sketch.update(i, new double[] {1.0}); + for (int i = 1; i <= 4096; i++) { + sketch.update(i, new double[] {1.0}); + } Assert.assertFalse(sketch.isEmpty()); Assert.assertFalse(sketch.isEstimationMode()); Assert.assertEquals(sketch.getEstimate(), 4096.0); @@ -88,9 +91,15 @@ public void exactMode() { double[][] values = sketch.getValues(); Assert.assertEquals(values.length, 4096); int count = 0; - for (int i = 0; i < values.length; i++) if (values[i] != null) count++; + for (int i = 0; i < values.length; i++) { + if (values[i] != null) { + count++; + } + } Assert.assertEquals(count, 4096); - for (int i = 0; i < 4096; i++) Assert.assertEquals(values[i][0], 1.0); + for (int i = 0; i < 4096; i++) { + Assert.assertEquals(values[i][0], 1.0); + } sketch.reset(); Assert.assertTrue(sketch.isEmpty()); @@ -112,7 +121,9 @@ public void exactMode() { public void estimationMode() { ArrayOfDoublesUpdatableSketch sketch = new ArrayOfDoublesUpdatableSketchBuilder().build(); Assert.assertEquals(sketch.getEstimate(), 0.0); - for (int i = 1; i <= 8192; i++) sketch.update(i, new double[] {1.0}); + for (int i = 1; i <= 8192; i++) { + sketch.update(i, new double[] {1.0}); + } Assert.assertTrue(sketch.isEstimationMode()); Assert.assertEquals(sketch.getEstimate(), 8192, 8192 * 0.01); Assert.assertTrue(sketch.getEstimate() >= sketch.getLowerBound(1)); @@ -197,10 +208,12 @@ public void serializeDeserializeEstimationNoResize() throws Exception { ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder(). setResizeFactor(ResizeFactor.X1).build(); for (int j = 0; j < 10; j++) { - for (int i = 0; i < 8192; i++) sketch1.update(i, new double[] {1.0}); + for (int i = 0; i < 8192; i++) { + sketch1.update(i, new double[] {1.0}); + } } byte[] byteArray = sketch1.toByteArray(); - + //for visual testing //TestUtil.writeBytesToFile(byteArray, "ArrayOfDoublesQuickSelectSketch4K.data"); @@ -210,7 +223,9 @@ public void serializeDeserializeEstimationNoResize() throws Exception { Assert.assertEquals(sketch1.getTheta(), sketch2.getTheta()); double[][] values = sketch2.getValues(); Assert.assertTrue(values.length >= 4096); - for (double[] array: values) Assert.assertEquals(array[0], 10.0); + for (double[] array: values) { + Assert.assertEquals(array[0], 10.0); + } } @Test @@ -218,7 +233,9 @@ public void serializeDeserializeSampling() { int sketchSize = 16384; int numberOfUniques = sketchSize; ArrayOfDoublesUpdatableSketch sketch1 = new ArrayOfDoublesUpdatableSketchBuilder().setNominalEntries(sketchSize).setSamplingProbability(0.5f).build(); - for (int i = 0; i < numberOfUniques; i++) sketch1.update(i, new double[] {1.0}); + for (int i = 0; i < numberOfUniques; i++) { + sketch1.update(i, new double[] {1.0}); + } ArrayOfDoublesSketch sketch2 = ArrayOfDoublesSketch.heapify(Memory.wrap(sketch1.toByteArray())); Assert.assertTrue(sketch2.isEstimationMode()); Assert.assertEquals(sketch2.getEstimate() / numberOfUniques, 1.0, 0.01); diff --git a/src/test/java/com/yahoo/sketches/tuple/ReadOnlyMemoryTest.java b/src/test/java/com/yahoo/sketches/tuple/ReadOnlyMemoryTest.java index c15c17b3e..25f1efb43 100644 --- a/src/test/java/com/yahoo/sketches/tuple/ReadOnlyMemoryTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/ReadOnlyMemoryTest.java @@ -25,6 +25,7 @@ import com.yahoo.memory.Memory; import com.yahoo.sketches.SketchesReadOnlyException; +@SuppressWarnings("javadoc") public class ReadOnlyMemoryTest { @Test diff --git a/src/test/java/com/yahoo/sketches/tuple/SerializerDeserializerTest.java b/src/test/java/com/yahoo/sketches/tuple/SerializerDeserializerTest.java index 48d18871a..3268df5dc 100644 --- a/src/test/java/com/yahoo/sketches/tuple/SerializerDeserializerTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/SerializerDeserializerTest.java @@ -26,6 +26,7 @@ import com.yahoo.sketches.Family; import com.yahoo.sketches.SketchesArgumentException; +@SuppressWarnings("javadoc") public class SerializerDeserializerTest { @Test diff --git a/src/test/java/com/yahoo/sketches/tuple/TestUtil.java b/src/test/java/com/yahoo/sketches/tuple/TestUtil.java index bb8d0f681..c94e05020 100644 --- a/src/test/java/com/yahoo/sketches/tuple/TestUtil.java +++ b/src/test/java/com/yahoo/sketches/tuple/TestUtil.java @@ -27,22 +27,29 @@ import java.util.ArrayList; import java.util.List; +@SuppressWarnings("javadoc") public class TestUtil { public static List asList(double[] array) { - List list = new ArrayList(array.length); - for (int i = 0; i < array.length; i++) list.add(array[i]); + List list = new ArrayList<>(array.length); + for (int i = 0; i < array.length; i++) { + list.add(array[i]); + } return list; } public static List asList(float[] array) { - List list = new ArrayList(array.length); - for (int i = 0; i < array.length; i++) list.add(array[i]); + List list = new ArrayList<>(array.length); + for (int i = 0; i < array.length; i++) { + list.add(array[i]); + } return list; } public static List asList(long[] array) { - List list = new ArrayList(array.length); - for (int i = 0; i < array.length; i++) list.add(array[i]); + List list = new ArrayList<>(array.length); + for (int i = 0; i < array.length; i++) { + list.add(array[i]); + } return list; } @@ -51,7 +58,7 @@ public static void writeBytesToFile(byte[] bytes, String fileName) throws IOExce out.write(bytes); } } - + public static byte[] readBytesFromFile(String fileName) throws IOException { try (FileInputStream in = new FileInputStream(new File(fileName))) { ByteArrayOutputStream out = new ByteArrayOutputStream(); diff --git a/src/test/java/com/yahoo/sketches/tuple/adouble/UpdatableSketchWithDoubleSummaryTest.java b/src/test/java/com/yahoo/sketches/tuple/adouble/UpdatableSketchWithDoubleSummaryTest.java index e73846193..ff95bce7d 100644 --- a/src/test/java/com/yahoo/sketches/tuple/adouble/UpdatableSketchWithDoubleSummaryTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/adouble/UpdatableSketchWithDoubleSummaryTest.java @@ -36,6 +36,7 @@ import com.yahoo.sketches.tuple.UpdatableSketchBuilder; import com.yahoo.sketches.tuple.adouble.DoubleSummary.Mode; +@SuppressWarnings("javadoc") public class UpdatableSketchWithDoubleSummaryTest { @Test diff --git a/src/test/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSketchTest.java b/src/test/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSketchTest.java index c344d86db..14303be5d 100644 --- a/src/test/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSketchTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSketchTest.java @@ -34,6 +34,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class ArrayOfStringsSketchTest { private static final String LS = System.getProperty("line.separator"); diff --git a/src/test/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSummaryTest.java b/src/test/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSummaryTest.java index cfd2441d5..81dfce36c 100644 --- a/src/test/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSummaryTest.java +++ b/src/test/java/com/yahoo/sketches/tuple/strings/ArrayOfStringsSummaryTest.java @@ -32,6 +32,7 @@ /** * @author Lee Rhodes */ +@SuppressWarnings("javadoc") public class ArrayOfStringsSummaryTest { @Test