From abdeaa07461dcf1318b934002f99822e35ad29e7 Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Wed, 8 Apr 2015 14:11:44 -0700 Subject: [PATCH] Add stricter checking for potential coding errors Can use via `mvn clean compile test-compile -P strict' --- .../ApproximateHistogramErrorBenchmark.java | 10 ++-- .../IngestSegmentFirehoseFactoryTest.java | 4 +- pom.xml | 26 +++++++++++ .../aggregation/CountBufferAggregator.java | 2 +- .../aggregation/LongSumBufferAggregator.java | 2 +- .../hyperloglog/HyperLogLogCollector.java | 6 +-- .../granularity/QueryGranularityTest.java | 2 +- .../aggregation/CountAggregatorTest.java | 18 ++++---- .../aggregation/LongSumAggregatorTest.java | 18 ++++---- .../hyperloglog/HyperLogLogCollectorTest.java | 8 ++-- ...perUniqueFinalizingPostAggregatorTest.java | 2 +- .../query/groupby/GroupByQueryRunnerTest.java | 8 ++-- .../data/BenchmarkIndexibleWrites.java | 2 +- .../segment/data/IncrementalIndexTest.java | 2 +- .../filter/SpatialFilterBonusTest.java | 36 +++++++-------- .../segment/filter/SpatialFilterTest.java | 46 +++++++++---------- .../IncrementalIndexStorageAdapterTest.java | 10 ++-- .../segment/loading/StorageLocationTest.java | 2 +- .../coordination/ServerManagerTest.java | 4 +- .../coordination/ZkCoordinatorTest.java | 2 +- 20 files changed, 118 insertions(+), 92 deletions(-) diff --git a/extensions/histogram/src/test/java/io/druid/query/aggregation/histogram/ApproximateHistogramErrorBenchmark.java b/extensions/histogram/src/test/java/io/druid/query/aggregation/histogram/ApproximateHistogramErrorBenchmark.java index 8c92b5fb121..f8969313cff 100644 --- a/extensions/histogram/src/test/java/io/druid/query/aggregation/histogram/ApproximateHistogramErrorBenchmark.java +++ b/extensions/histogram/src/test/java/io/druid/query/aggregation/histogram/ApproximateHistogramErrorBenchmark.java @@ -150,26 +150,26 @@ public class ApproximateHistogramErrorBenchmark float err1 = 0; float err2 = 0; for (int j = 0; j < hcounts.length; j++) { - err1 += Math.abs((hcounts[j] - ahcounts1[j]) / numValues); - err2 += Math.abs((hcounts[j] - ahcounts2[j]) / numValues); + err1 += (float)Math.abs((hcounts[j] - ahcounts1[j]) / numValues); + err2 += (float)Math.abs((hcounts[j] - ahcounts2[j]) / numValues); } if (debug) { float sum = 0; for (double v : hcounts) { - sum += v; + sum += (float)v; } System.out.println("Exact Histogram Sum:"); System.out.println(sum); sum = 0; for (double v : ahcounts1) { - sum += v; + sum += (float)v; } System.out.println("Approximate Histogram Sum:"); System.out.println(sum); sum = 0; for (double v : ahcounts2) { - sum += v; + sum += (float)v; } System.out.println("Approximate Histogram Rule Fold Sum:"); System.out.println(sum); diff --git a/indexing-service/src/test/java/io/druid/indexing/firehose/IngestSegmentFirehoseFactoryTest.java b/indexing-service/src/test/java/io/druid/indexing/firehose/IngestSegmentFirehoseFactoryTest.java index 2946345115f..aee8c072b83 100644 --- a/indexing-service/src/test/java/io/druid/indexing/firehose/IngestSegmentFirehoseFactoryTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/firehose/IngestSegmentFirehoseFactoryTest.java @@ -349,7 +349,7 @@ public class IngestSegmentFirehoseFactoryTest private static final String DIM_FLOAT_NAME = "testDimFloatName"; private static final String METRIC_LONG_NAME = "testLongMetric"; private static final String METRIC_FLOAT_NAME = "testFloatMetric"; - private static final Long METRIC_LONG_VALUE = 1l; + private static final Long METRIC_LONG_VALUE = 1L; private static final Float METRIC_FLOAT_VALUE = 1.0f; private static final String TIME_COLUMN = "ts"; private static final Integer MAX_SHARD_NUMBER = 10; @@ -401,7 +401,7 @@ public class IngestSegmentFirehoseFactoryTest MAX_SHARD_NUMBER ), BINARY_VERSION, - 0l + 0L ); } diff --git a/pom.xml b/pom.xml index 9959c7944d9..804f1368ab1 100644 --- a/pom.xml +++ b/pom.xml @@ -711,4 +711,30 @@ + + + strict + + + + + org.apache.maven.plugins + maven-compiler-plugin + + javac-with-errorprone + true + + + + org.codehaus.plexus + plexus-compiler-javac-errorprone + 2.5 + + + + + + + + diff --git a/processing/src/main/java/io/druid/query/aggregation/CountBufferAggregator.java b/processing/src/main/java/io/druid/query/aggregation/CountBufferAggregator.java index fee3cccf626..2fd5f45c5c6 100644 --- a/processing/src/main/java/io/druid/query/aggregation/CountBufferAggregator.java +++ b/processing/src/main/java/io/druid/query/aggregation/CountBufferAggregator.java @@ -27,7 +27,7 @@ public class CountBufferAggregator implements BufferAggregator @Override public void init(ByteBuffer buf, int position) { - buf.putLong(position, 0l); + buf.putLong(position, 0L); } @Override diff --git a/processing/src/main/java/io/druid/query/aggregation/LongSumBufferAggregator.java b/processing/src/main/java/io/druid/query/aggregation/LongSumBufferAggregator.java index bdf9b5c5d43..3e2f0aaf5fa 100644 --- a/processing/src/main/java/io/druid/query/aggregation/LongSumBufferAggregator.java +++ b/processing/src/main/java/io/druid/query/aggregation/LongSumBufferAggregator.java @@ -37,7 +37,7 @@ public class LongSumBufferAggregator implements BufferAggregator @Override public void init(ByteBuffer buf, int position) { - buf.putLong(position, 0l); + buf.putLong(position, 0L); } @Override diff --git a/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollector.java b/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollector.java index eb243af9ef1..cc1feac8012 100644 --- a/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollector.java +++ b/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollector.java @@ -279,7 +279,7 @@ public abstract class HyperLogLogCollector implements Comparable 0) { ++numNoLongerZero; } diff --git a/processing/src/test/java/io/druid/granularity/QueryGranularityTest.java b/processing/src/test/java/io/druid/granularity/QueryGranularityTest.java index 9e39ad9fc6e..13523dae94b 100644 --- a/processing/src/test/java/io/druid/granularity/QueryGranularityTest.java +++ b/processing/src/test/java/io/druid/granularity/QueryGranularityTest.java @@ -501,7 +501,7 @@ public class QueryGranularityTest json = "{ \"type\": \"period\", \"period\": \"P1D\"," + "\"timeZone\": \"America/Los_Angeles\", \"origin\": \"1970-01-01T00:00:00Z\"}"; gran = mapper.readValue(json, QueryGranularity.class); - Assert.assertEquals(new PeriodGranularity(new Period("P1D"), new DateTime(0l), DateTimeZone.forID("America/Los_Angeles")), gran); + Assert.assertEquals(new PeriodGranularity(new Period("P1D"), new DateTime(0L), DateTimeZone.forID("America/Los_Angeles")), gran); QueryGranularity expected = new PeriodGranularity( new Period("P1D"), diff --git a/processing/src/test/java/io/druid/query/aggregation/CountAggregatorTest.java b/processing/src/test/java/io/druid/query/aggregation/CountAggregatorTest.java index 15f8a4c4242..f78ad5caeb3 100644 --- a/processing/src/test/java/io/druid/query/aggregation/CountAggregatorTest.java +++ b/processing/src/test/java/io/druid/query/aggregation/CountAggregatorTest.java @@ -33,17 +33,17 @@ public class CountAggregatorTest Assert.assertEquals("billy", agg.getName()); - Assert.assertEquals(0l, agg.get()); - Assert.assertEquals(0l, agg.get()); - Assert.assertEquals(0l, agg.get()); + Assert.assertEquals(0L, agg.get()); + Assert.assertEquals(0L, agg.get()); + Assert.assertEquals(0L, agg.get()); agg.aggregate(); - Assert.assertEquals(1l, agg.get()); - Assert.assertEquals(1l, agg.get()); - Assert.assertEquals(1l, agg.get()); + Assert.assertEquals(1L, agg.get()); + Assert.assertEquals(1L, agg.get()); + Assert.assertEquals(1L, agg.get()); agg.aggregate(); - Assert.assertEquals(2l, agg.get()); - Assert.assertEquals(2l, agg.get()); - Assert.assertEquals(2l, agg.get()); + Assert.assertEquals(2L, agg.get()); + Assert.assertEquals(2L, agg.get()); + Assert.assertEquals(2L, agg.get()); } @Test diff --git a/processing/src/test/java/io/druid/query/aggregation/LongSumAggregatorTest.java b/processing/src/test/java/io/druid/query/aggregation/LongSumAggregatorTest.java index f524e25878b..7e5074b98ba 100644 --- a/processing/src/test/java/io/druid/query/aggregation/LongSumAggregatorTest.java +++ b/processing/src/test/java/io/druid/query/aggregation/LongSumAggregatorTest.java @@ -40,17 +40,17 @@ public class LongSumAggregatorTest Assert.assertEquals("billy", agg.getName()); - Assert.assertEquals(0l, agg.get()); - Assert.assertEquals(0l, agg.get()); - Assert.assertEquals(0l, agg.get()); + Assert.assertEquals(0L, agg.get()); + Assert.assertEquals(0L, agg.get()); + Assert.assertEquals(0L, agg.get()); aggregate(selector, agg); - Assert.assertEquals(24l, agg.get()); - Assert.assertEquals(24l, agg.get()); - Assert.assertEquals(24l, agg.get()); + Assert.assertEquals(24L, agg.get()); + Assert.assertEquals(24L, agg.get()); + Assert.assertEquals(24L, agg.get()); aggregate(selector, agg); - Assert.assertEquals(44l, agg.get()); - Assert.assertEquals(44l, agg.get()); - Assert.assertEquals(44l, agg.get()); + Assert.assertEquals(44L, agg.get()); + Assert.assertEquals(44L, agg.get()); + Assert.assertEquals(44L, agg.get()); } @Test diff --git a/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorTest.java b/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorTest.java index 8fcbe93d050..d1b5883c309 100644 --- a/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorTest.java +++ b/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorTest.java @@ -482,7 +482,7 @@ public class HyperLogLogCollectorTest } final short numNonZeroInRemaining = computeNumNonZero((byte) remainingBytes); - numNonZero += (HyperLogLogCollector.NUM_BYTES_FOR_BUCKETS - initialBytes.length) * numNonZeroInRemaining; + numNonZero += (short)((HyperLogLogCollector.NUM_BYTES_FOR_BUCKETS - initialBytes.length) * numNonZeroInRemaining); ByteBuffer biggerOffset = ByteBuffer.allocate(HyperLogLogCollector.getLatestNumBytesForDenseStorage()); biggerOffset.put(HLLCV1.VERSION); @@ -577,7 +577,7 @@ public class HyperLogLogCollectorTest @Test public void testEstimation() throws Exception { - Random random = new Random(0l); + Random random = new Random(0L); final int[] valsToCheck = {10, 20, 50, 100, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 1000000, 2000000}; final double[] expectedVals = { @@ -603,7 +603,7 @@ public class HyperLogLogCollectorTest @Test public void testEstimationReadOnlyByteBuffers() throws Exception { - Random random = new Random(0l); + Random random = new Random(0L); final int[] valsToCheck = {10, 20, 50, 100, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 1000000, 2000000}; final double[] expectedVals = { @@ -633,7 +633,7 @@ public class HyperLogLogCollectorTest @Test public void testEstimationLimitDifferentFromCapacity() throws Exception { - Random random = new Random(0l); + Random random = new Random(0L); final int[] valsToCheck = {10, 20, 50, 100, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 1000000, 2000000}; final double[] expectedVals = { diff --git a/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperUniqueFinalizingPostAggregatorTest.java b/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperUniqueFinalizingPostAggregatorTest.java index 8b47df661dd..e711b1ab156 100644 --- a/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperUniqueFinalizingPostAggregatorTest.java +++ b/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperUniqueFinalizingPostAggregatorTest.java @@ -34,7 +34,7 @@ public class HyperUniqueFinalizingPostAggregatorTest @Test public void testCompute() throws Exception { - Random random = new Random(0l); + Random random = new Random(0L); HyperUniqueFinalizingPostAggregator postAggregator = new HyperUniqueFinalizingPostAggregator( "uniques" ); diff --git a/processing/src/test/java/io/druid/query/groupby/GroupByQueryRunnerTest.java b/processing/src/test/java/io/druid/query/groupby/GroupByQueryRunnerTest.java index da31afa0dde..665043dd917 100644 --- a/processing/src/test/java/io/druid/query/groupby/GroupByQueryRunnerTest.java +++ b/processing/src/test/java/io/druid/query/groupby/GroupByQueryRunnerTest.java @@ -1210,8 +1210,8 @@ public class GroupByQueryRunnerTest public void testPostAggMergedHavingSpec() { List expectedResults = Arrays.asList( - GroupByQueryRunnerTestHelper.createExpectedRow("2011-04-01", "alias", "mezzanine", "rows", 6L, "index", 4420L, QueryRunnerTestHelper.addRowsIndexConstantMetric,(double) (6l+4420l+1l)), - GroupByQueryRunnerTestHelper.createExpectedRow("2011-04-01", "alias", "premium", "rows", 6L, "index", 4416L, QueryRunnerTestHelper.addRowsIndexConstantMetric, (double) (6l+4416l+1l)) + GroupByQueryRunnerTestHelper.createExpectedRow("2011-04-01", "alias", "mezzanine", "rows", 6L, "index", 4420L, QueryRunnerTestHelper.addRowsIndexConstantMetric,(double) (6L+4420L+1L)), + GroupByQueryRunnerTestHelper.createExpectedRow("2011-04-01", "alias", "premium", "rows", 6L, "index", 4416L, QueryRunnerTestHelper.addRowsIndexConstantMetric, (double) (6L+4416L+1L)) ); GroupByQuery.Builder builder = GroupByQuery @@ -1274,7 +1274,7 @@ public class GroupByQueryRunnerTest "index", 4420L, QueryRunnerTestHelper.addRowsIndexConstantMetric, - (double) (6l + 4420l + 1l) + (double) (6L + 4420L + 1L) ), GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-01", @@ -1285,7 +1285,7 @@ public class GroupByQueryRunnerTest "index", 4416L, QueryRunnerTestHelper.addRowsIndexConstantMetric, - (double) (6l + 4416l + 1l) + (double) (6L + 4416L + 1L) ) ); diff --git a/processing/src/test/java/io/druid/segment/data/BenchmarkIndexibleWrites.java b/processing/src/test/java/io/druid/segment/data/BenchmarkIndexibleWrites.java index a53d3be1d2b..0f6671cceea 100644 --- a/processing/src/test/java/io/druid/segment/data/BenchmarkIndexibleWrites.java +++ b/processing/src/test/java/io/druid/segment/data/BenchmarkIndexibleWrites.java @@ -131,7 +131,7 @@ public class BenchmarkIndexibleWrites extends AbstractBenchmark private static Boolean wasCopying(Long val) { - return (val & 1l) > 0; + return (val & 1L) > 0; } @Override diff --git a/processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java b/processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java index ae727b8f980..2ad4c9cd0d5 100644 --- a/processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java +++ b/processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java @@ -182,7 +182,7 @@ public class IncrementalIndexTest for (int i = 0; i < dimensionCount; i++) { String dimName = String.format("Dim_%d", i); dimensionList.add(dimName); - builder.put(dimName, (Long) 1l); + builder.put(dimName, (Long) 1L); } return new MapBasedInputRow(timestamp, dimensionList, builder.build()); } diff --git a/processing/src/test/java/io/druid/segment/filter/SpatialFilterBonusTest.java b/processing/src/test/java/io/druid/segment/filter/SpatialFilterBonusTest.java index d0730f73bea..7638604a639 100644 --- a/processing/src/test/java/io/druid/segment/filter/SpatialFilterBonusTest.java +++ b/processing/src/test/java/io/druid/segment/filter/SpatialFilterBonusTest.java @@ -133,7 +133,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-01").toString(), "dim", "foo", "dim.geo", "0.0,0.0", - "val", 17l + "val", 17L ) ) ); @@ -145,7 +145,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-02").toString(), "dim", "foo", "dim.geo", "1.0,3.0", - "val", 29l + "val", 29L ) ) ); @@ -157,7 +157,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-03").toString(), "dim", "foo", "dim.geo", "4.0,2.0", - "val", 13l + "val", 13L ) ) ); @@ -169,7 +169,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-04").toString(), "dim", "foo", "dim.geo", "7.0,3.0", - "val", 91l + "val", 91L ) ) ); @@ -181,7 +181,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-05").toString(), "dim", "foo", "dim.geo", "8.0,6.0", - "val", 47l + "val", 47L ) ) ); @@ -193,7 +193,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-05").toString(), "dim", "foo", "dim.geo", "_mmx.unknown", - "val", 501l + "val", 501L ) ) ); @@ -306,7 +306,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-01").toString(), "dim", "foo", "dim.geo", "0.0,0.0", - "val", 17l + "val", 17L ) ) ); @@ -318,7 +318,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-02").toString(), "dim", "foo", "dim.geo", "1.0,3.0", - "val", 29l + "val", 29L ) ) ); @@ -330,7 +330,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-03").toString(), "dim", "foo", "dim.geo", "4.0,2.0", - "val", 13l + "val", 13L ) ) ); @@ -342,7 +342,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-05").toString(), "dim", "foo", "dim.geo", "_mmx.unknown", - "val", 501l + "val", 501L ) ) ); @@ -354,7 +354,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-04").toString(), "dim", "foo", "dim.geo", "7.0,3.0", - "val", 91l + "val", 91L ) ) ); @@ -366,7 +366,7 @@ public class SpatialFilterBonusTest "timestamp", new DateTime("2013-01-05").toString(), "dim", "foo", "dim.geo", "8.0,6.0", - "val", 47l + "val", 47L ) ) ); @@ -456,7 +456,7 @@ public class SpatialFilterBonusTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 3L) - .put("val", 59l) + .put("val", 59L) .build() ) ) @@ -508,7 +508,7 @@ public class SpatialFilterBonusTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 17l) + .put("val", 17L) .build() ) ), @@ -517,7 +517,7 @@ public class SpatialFilterBonusTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 29l) + .put("val", 29L) .build() ) ), @@ -526,7 +526,7 @@ public class SpatialFilterBonusTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 13l) + .put("val", 13L) .build() ) ), @@ -535,7 +535,7 @@ public class SpatialFilterBonusTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 91l) + .put("val", 91L) .build() ) ), @@ -544,7 +544,7 @@ public class SpatialFilterBonusTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 47l) + .put("val", 47L) .build() ) ) diff --git a/processing/src/test/java/io/druid/segment/filter/SpatialFilterTest.java b/processing/src/test/java/io/druid/segment/filter/SpatialFilterTest.java index 887ebdb5b56..e6c1dbcd4a1 100644 --- a/processing/src/test/java/io/druid/segment/filter/SpatialFilterTest.java +++ b/processing/src/test/java/io/druid/segment/filter/SpatialFilterTest.java @@ -136,7 +136,7 @@ public class SpatialFilterTest "dim", "foo", "lat", 0.0f, "long", 0.0f, - "val", 17l + "val", 17L ) ) ); @@ -149,7 +149,7 @@ public class SpatialFilterTest "dim", "foo", "lat", 1.0f, "long", 3.0f, - "val", 29l + "val", 29L ) ) ); @@ -162,7 +162,7 @@ public class SpatialFilterTest "dim", "foo", "lat", 4.0f, "long", 2.0f, - "val", 13l + "val", 13L ) ) ); @@ -175,7 +175,7 @@ public class SpatialFilterTest "dim", "foo", "lat", 7.0f, "long", 3.0f, - "val", 91l + "val", 91L ) ) ); @@ -188,7 +188,7 @@ public class SpatialFilterTest "dim", "foo", "lat", 8.0f, "long", 6.0f, - "val", 47l + "val", 47L ) ) ); @@ -201,7 +201,7 @@ public class SpatialFilterTest "dim", "foo", "lat", "_mmx.unknown", "long", "_mmx.unknown", - "val", 101l + "val", 101L ) ) ); @@ -213,7 +213,7 @@ public class SpatialFilterTest "timestamp", new DateTime("2013-01-05").toString(), "dim", "foo", "dim.geo", "_mmx.unknown", - "val", 501l + "val", 501L ) ) ); @@ -225,7 +225,7 @@ public class SpatialFilterTest "timestamp", new DateTime("2013-01-05").toString(), "lat2", 0.0f, "long2", 0.0f, - "val", 13l + "val", 13L ) ) ); @@ -349,7 +349,7 @@ public class SpatialFilterTest "dim", "foo", "lat", 0.0f, "long", 0.0f, - "val", 17l + "val", 17L ) ) ); @@ -362,7 +362,7 @@ public class SpatialFilterTest "dim", "foo", "lat", 1.0f, "long", 3.0f, - "val", 29l + "val", 29L ) ) ); @@ -375,7 +375,7 @@ public class SpatialFilterTest "dim", "foo", "lat", 4.0f, "long", 2.0f, - "val", 13l + "val", 13L ) ) ); @@ -388,7 +388,7 @@ public class SpatialFilterTest "dim", "foo", "lat", "_mmx.unknown", "long", "_mmx.unknown", - "val", 101l + "val", 101L ) ) ); @@ -400,7 +400,7 @@ public class SpatialFilterTest "timestamp", new DateTime("2013-01-05").toString(), "dim", "foo", "dim.geo", "_mmx.unknown", - "val", 501l + "val", 501L ) ) ); @@ -413,7 +413,7 @@ public class SpatialFilterTest "dim", "foo", "lat", 7.0f, "long", 3.0f, - "val", 91l + "val", 91L ) ) ); @@ -426,7 +426,7 @@ public class SpatialFilterTest "dim", "foo", "lat", 8.0f, "long", 6.0f, - "val", 47l + "val", 47L ) ) ); @@ -438,7 +438,7 @@ public class SpatialFilterTest "timestamp", new DateTime("2013-01-05").toString(), "lat2", 0.0f, "long2", 0.0f, - "val", 13l + "val", 13L ) ) ); @@ -532,7 +532,7 @@ public class SpatialFilterTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 3L) - .put("val", 59l) + .put("val", 59L) .build() ) ) @@ -585,7 +585,7 @@ public class SpatialFilterTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 13l) + .put("val", 13L) .build() ) ) @@ -637,7 +637,7 @@ public class SpatialFilterTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 17l) + .put("val", 17L) .build() ) ), @@ -646,7 +646,7 @@ public class SpatialFilterTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 29l) + .put("val", 29L) .build() ) ), @@ -655,7 +655,7 @@ public class SpatialFilterTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 13l) + .put("val", 13L) .build() ) ), @@ -664,7 +664,7 @@ public class SpatialFilterTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 91l) + .put("val", 91L) .build() ) ), @@ -673,7 +673,7 @@ public class SpatialFilterTest new TimeseriesResultValue( ImmutableMap.builder() .put("rows", 1L) - .put("val", 47l) + .put("val", 47L) .build() ) ) diff --git a/processing/src/test/java/io/druid/segment/incremental/IncrementalIndexStorageAdapterTest.java b/processing/src/test/java/io/druid/segment/incremental/IncrementalIndexStorageAdapterTest.java index 61f3686bfe4..1919b326ebd 100644 --- a/processing/src/test/java/io/druid/segment/incremental/IncrementalIndexStorageAdapterTest.java +++ b/processing/src/test/java/io/druid/segment/incremental/IncrementalIndexStorageAdapterTest.java @@ -153,10 +153,10 @@ public class IncrementalIndexStorageAdapterTest Assert.assertEquals(2, results.size()); MapBasedRow row = (MapBasedRow) results.get(0); - Assert.assertEquals(ImmutableMap.of("billy", "hi", "cnt", 1l), row.getEvent()); + Assert.assertEquals(ImmutableMap.of("billy", "hi", "cnt", 1L), row.getEvent()); row = (MapBasedRow) results.get(1); - Assert.assertEquals(ImmutableMap.of("sally", "bo", "cnt", 1l), row.getEvent()); + Assert.assertEquals(ImmutableMap.of("sally", "bo", "cnt", 1L), row.getEvent()); } @Test @@ -211,10 +211,10 @@ public class IncrementalIndexStorageAdapterTest Assert.assertEquals(2, results.size()); MapBasedRow row = (MapBasedRow) results.get(0); - Assert.assertEquals(ImmutableMap.of("billy", "hi", "cnt", 1l, "fieldLength", 2.0), row.getEvent()); + Assert.assertEquals(ImmutableMap.of("billy", "hi", "cnt", 1L, "fieldLength", 2.0), row.getEvent()); row = (MapBasedRow) results.get(1); - Assert.assertEquals(ImmutableMap.of("billy", "hip", "sally", "hop", "cnt", 1l, "fieldLength", 6.0), row.getEvent()); + Assert.assertEquals(ImmutableMap.of("billy", "hip", "sally", "hop", "cnt", 1L, "fieldLength", 6.0), row.getEvent()); } private static GroupByQueryEngine makeGroupByQueryEngine() @@ -382,6 +382,6 @@ public class IncrementalIndexStorageAdapterTest Assert.assertEquals(1, results.size()); MapBasedRow row = (MapBasedRow) results.get(0); - Assert.assertEquals(ImmutableMap.of("billy", "hi", "cnt", 1l), row.getEvent()); + Assert.assertEquals(ImmutableMap.of("billy", "hi", "cnt", 1L), row.getEvent()); } } diff --git a/server/src/test/java/io/druid/segment/loading/StorageLocationTest.java b/server/src/test/java/io/druid/segment/loading/StorageLocationTest.java index a0084694377..1459180ecea 100644 --- a/server/src/test/java/io/druid/segment/loading/StorageLocationTest.java +++ b/server/src/test/java/io/druid/segment/loading/StorageLocationTest.java @@ -33,7 +33,7 @@ public class StorageLocationTest @Test public void testStorageLocation() throws Exception { - long expectedAvail = 1000l; + long expectedAvail = 1000L; StorageLocation loc = new StorageLocation(new File("/tmp"), expectedAvail); verifyLoc(expectedAvail, loc); diff --git a/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java b/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java index a0525abeb31..5d362bfabba 100644 --- a/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java +++ b/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java @@ -464,7 +464,7 @@ public class ServerManagerTest Arrays.asList("metric1", "metric2"), new NoneShardSpec(), IndexIO.CURRENT_VERSION_ID, - 123l + 123L ) ); } @@ -486,7 +486,7 @@ public class ServerManagerTest Arrays.asList("metric1", "metric2"), new NoneShardSpec(), IndexIO.CURRENT_VERSION_ID, - 123l + 123L ) ); } diff --git a/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java b/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java index 15e093e04be..3ae21fb90de 100644 --- a/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java +++ b/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java @@ -232,7 +232,7 @@ public class ZkCoordinatorTest extends CuratorTestBase Arrays.asList("metric1", "metric2"), new NoneShardSpec(), IndexIO.CURRENT_VERSION_ID, - 123l + 123L ); }