diff --git a/benchmarks/src/main/java/io/druid/benchmark/datagen/BenchmarkSchemaInfo.java b/benchmarks/src/main/java/io/druid/benchmark/datagen/BenchmarkSchemaInfo.java index 0a81f7ee990..bc0ff220a86 100644 --- a/benchmarks/src/main/java/io/druid/benchmark/datagen/BenchmarkSchemaInfo.java +++ b/benchmarks/src/main/java/io/druid/benchmark/datagen/BenchmarkSchemaInfo.java @@ -19,7 +19,6 @@ package io.druid.benchmark.datagen; -import io.druid.benchmark.datagen.BenchmarkColumnSchema; import io.druid.query.aggregation.AggregatorFactory; import org.joda.time.Interval; diff --git a/codestyle/checkstyle-suppressions.xml b/codestyle/checkstyle-suppressions.xml new file mode 100644 index 00000000000..493a18bee12 --- /dev/null +++ b/codestyle/checkstyle-suppressions.xml @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml new file mode 100644 index 00000000000..10e67e44a49 --- /dev/null +++ b/codestyle/checkstyle.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureTaskLogs.java b/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureTaskLogs.java index 71b9757e995..714f0f416f7 100644 --- a/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureTaskLogs.java +++ b/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureTaskLogs.java @@ -73,7 +73,9 @@ public class AzureTaskLogs implements TaskLogs { final String taskKey = getTaskLogKey(taskid); try { - if (!azureStorage.getBlobExists(container, taskKey)) return Optional.absent(); + if (!azureStorage.getBlobExists(container, taskKey)) { + return Optional.absent(); + } return Optional.of( new ByteSource() { diff --git a/extensions-contrib/druid-rocketmq/src/main/java/io/druid/firehose/rocketmq/RocketMQFirehoseFactory.java b/extensions-contrib/druid-rocketmq/src/main/java/io/druid/firehose/rocketmq/RocketMQFirehoseFactory.java index f3dcce46dd0..37eea84129d 100644 --- a/extensions-contrib/druid-rocketmq/src/main/java/io/druid/firehose/rocketmq/RocketMQFirehoseFactory.java +++ b/extensions-contrib/druid-rocketmq/src/main/java/io/druid/firehose/rocketmq/RocketMQFirehoseFactory.java @@ -34,16 +34,23 @@ import com.alibaba.rocketmq.remoting.exception.RemotingException; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Sets; +import com.metamx.common.logger.Logger; import com.metamx.common.parsers.ParseException; import io.druid.data.input.ByteBufferInputRowParser; import io.druid.data.input.Firehose; import io.druid.data.input.FirehoseFactory; import io.druid.data.input.InputRow; -import com.metamx.common.logger.Logger; import java.io.IOException; import java.nio.ByteBuffer; -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListSet; import java.util.concurrent.CountDownLatch; diff --git a/extensions-contrib/orc-extensions/src/main/java/io/druid/data/input/orc/OrcHadoopInputRowParser.java b/extensions-contrib/orc-extensions/src/main/java/io/druid/data/input/orc/OrcHadoopInputRowParser.java index 3040504a007..fca7f51030a 100644 --- a/extensions-contrib/orc-extensions/src/main/java/io/druid/data/input/orc/OrcHadoopInputRowParser.java +++ b/extensions-contrib/orc-extensions/src/main/java/io/druid/data/input/orc/OrcHadoopInputRowParser.java @@ -199,16 +199,19 @@ public class OrcHadoopInputRowParser implements InputRowParser @Override public boolean equals(Object o) { - if (!(o instanceof OrcHadoopInputRowParser)) + if (!(o instanceof OrcHadoopInputRowParser)) { return false; + } OrcHadoopInputRowParser other = (OrcHadoopInputRowParser)o; - if (!parseSpec.equals(other.parseSpec)) + if (!parseSpec.equals(other.parseSpec)) { return false; + } - if (!typeString.equals(other.typeString)) + if (!typeString.equals(other.typeString)) { return false; + } return true; } diff --git a/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcHadoopInputRowParserTest.java b/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcHadoopInputRowParserTest.java index cc473f4829b..15dee856454 100644 --- a/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcHadoopInputRowParserTest.java +++ b/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcHadoopInputRowParserTest.java @@ -25,7 +25,13 @@ import com.google.inject.Binder; import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.name.Names; -import io.druid.data.input.impl.*; +import io.druid.data.input.impl.DimensionSchema; +import io.druid.data.input.impl.DimensionsSpec; +import io.druid.data.input.impl.InputRowParser; +import io.druid.data.input.impl.ParseSpec; +import io.druid.data.input.impl.StringDimensionSchema; +import io.druid.data.input.impl.TimeAndDimsParseSpec; +import io.druid.data.input.impl.TimestampSpec; import io.druid.guice.GuiceInjectors; import io.druid.initialization.Initialization; import io.druid.jackson.DefaultObjectMapper; diff --git a/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/LoadingLookupFactory.java b/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/LoadingLookupFactory.java index 5a964878985..bb6aba8ea5e 100644 --- a/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/LoadingLookupFactory.java +++ b/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/LoadingLookupFactory.java @@ -96,7 +96,9 @@ public class LoadingLookupFactory implements LookupExtractorFactory @Nullable LookupExtractorFactory lookupExtractorFactory ) { - if (lookupExtractorFactory == null) return true; + if (lookupExtractorFactory == null) { + return true; + } return !this.equals(lookupExtractorFactory); } diff --git a/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/AWSSessionCredentialsAdapter.java b/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/AWSSessionCredentialsAdapter.java index 70bb8427421..d5bc25677fc 100644 --- a/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/AWSSessionCredentialsAdapter.java +++ b/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/AWSSessionCredentialsAdapter.java @@ -27,10 +27,11 @@ public class AWSSessionCredentialsAdapter extends AWSSessionCredentials { public AWSSessionCredentialsAdapter(AWSCredentialsProvider provider) { super(null, null, null); - if(provider.getCredentials() instanceof com.amazonaws.auth.AWSSessionCredentials) + if(provider.getCredentials() instanceof com.amazonaws.auth.AWSSessionCredentials) { this.provider = provider; - else + } else { throw new IllegalArgumentException("provider does not contain session credentials"); + } } @Override diff --git a/pom.xml b/pom.xml index 9fbdb915f8b..b9e1b390f81 100644 --- a/pom.xml +++ b/pom.xml @@ -690,6 +690,30 @@ coveralls-maven-plugin 4.0.0 + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.17 + + ${project.build.sourceDirectory} + true + codestyle/checkstyle.xml + codestyle/checkstyle-suppressions.xml + checkstyle.suppressions.file + UTF-8 + true + true + + + + validate + validate + + check + + + + diff --git a/processing/src/main/java/io/druid/granularity/PeriodGranularity.java b/processing/src/main/java/io/druid/granularity/PeriodGranularity.java index 1834e50f35c..91239c04cfd 100644 --- a/processing/src/main/java/io/druid/granularity/PeriodGranularity.java +++ b/processing/src/main/java/io/druid/granularity/PeriodGranularity.java @@ -111,8 +111,11 @@ public class PeriodGranularity extends BaseQueryGranularity y -= y % years; long tt = chronology.years().add(origin, y); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.years().add(tt, -years); - else t = tt; + if(t < tt) { + t = chronology.years().add(tt, -years); + } else { + t = tt; + } return t; } else @@ -130,8 +133,11 @@ public class PeriodGranularity extends BaseQueryGranularity m -= m % months; long tt = chronology.months().add(origin, m); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.months().add(tt, -months); - else t = tt; + if(t < tt) { + t = chronology.months().add(tt, -months); + } else { + t = tt; + } return t; } else @@ -150,8 +156,11 @@ public class PeriodGranularity extends BaseQueryGranularity w -= w % weeks; long tt = chronology.weeks().add(origin, w); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.weeks().add(tt, -weeks); - else t = tt; + if(t < tt) { + t = chronology.weeks().add(tt, -weeks); + } else { + t = tt; + } return t; } else @@ -172,8 +181,11 @@ public class PeriodGranularity extends BaseQueryGranularity d -= d % days; long tt = chronology.days().add(origin, d); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.days().add(tt, -days); - else t = tt; + if(t < tt) { + t = chronology.days().add(tt, -days); + } else { + t = tt; + } return t; } else @@ -193,8 +205,11 @@ public class PeriodGranularity extends BaseQueryGranularity h -= h % hours; long tt = chronology.hours().add(origin, h); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.hours().add(tt, -hours); - else t = tt; + if(t < tt) { + t = chronology.hours().add(tt, -hours); + } else { + t = tt; + } return t; } else @@ -214,8 +229,11 @@ public class PeriodGranularity extends BaseQueryGranularity m -= m % minutes; long tt = chronology.minutes().add(origin, m); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.minutes().add(tt, -minutes); - else t = tt; + if(t < tt) { + t = chronology.minutes().add(tt, -minutes); + } else { + t = tt; + } return t; } else @@ -235,8 +253,11 @@ public class PeriodGranularity extends BaseQueryGranularity s -= s % seconds; long tt = chronology.seconds().add(origin, s); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.seconds().add(tt, -seconds); - else t = tt; + if(t < tt) { + t = chronology.seconds().add(tt, -seconds); + } else { + t = tt; + } return t; } else @@ -254,8 +275,11 @@ public class PeriodGranularity extends BaseQueryGranularity ms -= ms % millis; long tt = chronology.millis().add(origin, ms); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.millis().add(tt, -millis); - else t = tt; + if(t < tt) { + t = chronology.millis().add(tt, -millis); + } else { + t = tt; + } return t; } else { @@ -274,7 +298,9 @@ public class PeriodGranularity extends BaseQueryGranularity { if(v > 0) { - if(single) return true; + if(single) { + return true; + } single = true; } } diff --git a/processing/src/main/java/io/druid/query/aggregation/DoubleMaxAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/DoubleMaxAggregatorFactory.java index 029bc86afaf..7918711ff48 100644 --- a/processing/src/main/java/io/druid/query/aggregation/DoubleMaxAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/DoubleMaxAggregatorFactory.java @@ -172,13 +172,21 @@ public class DoubleMaxAggregatorFactory extends AggregatorFactory @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } DoubleMaxAggregatorFactory that = (DoubleMaxAggregatorFactory) o; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/aggregation/DoubleMinAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/DoubleMinAggregatorFactory.java index 04f1de0ede3..8ed5036177b 100644 --- a/processing/src/main/java/io/druid/query/aggregation/DoubleMinAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/DoubleMinAggregatorFactory.java @@ -172,13 +172,21 @@ public class DoubleMinAggregatorFactory extends AggregatorFactory @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } DoubleMinAggregatorFactory that = (DoubleMinAggregatorFactory) o; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/aggregation/Histogram.java b/processing/src/main/java/io/druid/query/aggregation/Histogram.java index 40689ceb2b4..b77d2607f70 100644 --- a/processing/src/main/java/io/druid/query/aggregation/Histogram.java +++ b/processing/src/main/java/io/druid/query/aggregation/Histogram.java @@ -51,12 +51,18 @@ public class Histogram this.bins = bins; this.min = min; this.max = max; - for(long k : bins) this.count += k; + for(long k : bins) { + this.count += k; + } } public void offer(float d) { - if(d > max) max = d; - if(d < min) min = d; + if(d > max) { + max = d; + } + if(d < min) { + min = d; + } int index = Arrays.binarySearch(breaks, d); int pos = (index >= 0) ? index : -(index + 1); @@ -67,8 +73,12 @@ public class Histogram public Histogram fold(Histogram h) { Preconditions.checkArgument(Arrays.equals(breaks, h.breaks), "Cannot fold histograms with different breaks"); - if(h.min < min) min = h.min; - if(h.max > max) max = h.max; + if(h.min < min) { + min = h.min; + } + if(h.max > max) { + max = h.max; + } count += h.count; for (int i = 0; i < bins.length; ++i) { @@ -124,8 +134,12 @@ public class Histogram Longs.BYTES * bins.length + Floats.BYTES * 2); buf.putInt(breaks.length); - for(float b : breaks) buf.putFloat(b); - for(long c : bins ) buf.putLong(c); + for(float b : breaks) { + buf.putFloat(b); + } + for(long c : bins ) { + buf.putLong(c); + } buf.putFloat(min); buf.putFloat(max); @@ -141,7 +155,9 @@ public class Histogram */ public HistogramVisual asVisual() { float[] visualCounts = new float[bins.length - 2]; - for(int i = 0; i < visualCounts.length; ++i) visualCounts[i] = (float)bins[i + 1]; + for(int i = 0; i < visualCounts.length; ++i) { + visualCounts[i] = (float) bins[i + 1]; + } return new HistogramVisual(breaks, visualCounts, new float[]{min, max}); } @@ -155,8 +171,12 @@ public class Histogram float[] breaks = new float[n]; long[] bins = new long[n + 1]; - for (int i = 0; i < breaks.length; ++i) breaks[i] = buf.getFloat(); - for (int i = 0; i < bins.length ; ++i) bins[i] = buf.getLong(); + for (int i = 0; i < breaks.length; ++i) { + breaks[i] = buf.getFloat(); + } + for (int i = 0; i < bins.length ; ++i) { + bins[i] = buf.getLong(); + } float min = buf.getFloat(); float max = buf.getFloat(); diff --git a/processing/src/main/java/io/druid/query/aggregation/HistogramBufferAggregator.java b/processing/src/main/java/io/druid/query/aggregation/HistogramBufferAggregator.java index d41244e4c66..8ad856c33ab 100644 --- a/processing/src/main/java/io/druid/query/aggregation/HistogramBufferAggregator.java +++ b/processing/src/main/java/io/druid/query/aggregation/HistogramBufferAggregator.java @@ -60,8 +60,12 @@ public class HistogramBufferAggregator implements BufferAggregator final int minPos = position + minOffset; final int maxPos = position + maxOffset; - if(value < buf.getFloat(minPos)) buf.putFloat(minPos, value); - if(value > buf.getFloat(maxPos)) buf.putFloat(maxPos, value); + if(value < buf.getFloat(minPos)) { + buf.putFloat(minPos, value); + } + if(value > buf.getFloat(maxPos)) { + buf.putFloat(maxPos, value); + } int index = Arrays.binarySearch(breaks, value); index = (index >= 0) ? index : -(index + 1); diff --git a/processing/src/main/java/io/druid/query/aggregation/HistogramVisual.java b/processing/src/main/java/io/druid/query/aggregation/HistogramVisual.java index 3310096f8a7..0f7cf594972 100644 --- a/processing/src/main/java/io/druid/query/aggregation/HistogramVisual.java +++ b/processing/src/main/java/io/druid/query/aggregation/HistogramVisual.java @@ -62,9 +62,15 @@ public class HistogramVisual this.breaks = new double[breaks.length]; this.counts = new double[counts.length]; this.quantiles = new double[quantiles.length]; - for(int i = 0; i < breaks.length; ++i) this.breaks[i] = breaks[i]; - for(int i = 0; i < counts.length; ++i) this.counts[i] = counts[i]; - for(int i = 0; i < quantiles.length; ++i) this.quantiles[i] = quantiles[i]; + for(int i = 0; i < breaks.length; ++i) { + this.breaks[i] = breaks[i]; + } + for(int i = 0; i < counts.length; ++i) { + this.counts[i] = counts[i]; + } + for(int i = 0; i < quantiles.length; ++i) { + this.quantiles[i] = quantiles[i]; + } } @Override diff --git a/processing/src/main/java/io/druid/query/aggregation/LongMaxAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/LongMaxAggregatorFactory.java index 91f8c11fee3..b150763c682 100644 --- a/processing/src/main/java/io/druid/query/aggregation/LongMaxAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/LongMaxAggregatorFactory.java @@ -168,13 +168,21 @@ public class LongMaxAggregatorFactory extends AggregatorFactory @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } LongMaxAggregatorFactory that = (LongMaxAggregatorFactory) o; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/aggregation/LongMinAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/LongMinAggregatorFactory.java index 82f2111a43a..a4b6bf34af6 100644 --- a/processing/src/main/java/io/druid/query/aggregation/LongMinAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/LongMinAggregatorFactory.java @@ -168,13 +168,21 @@ public class LongMinAggregatorFactory extends AggregatorFactory @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } LongMinAggregatorFactory that = (LongMinAggregatorFactory) o; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java index 5744b762bd2..3670c015ca8 100644 --- a/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java @@ -227,13 +227,21 @@ public class HyperUniquesAggregatorFactory extends AggregatorFactory @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } HyperUniquesAggregatorFactory that = (HyperUniquesAggregatorFactory) o; - if (!fieldName.equals(that.fieldName)) return false; - if (!name.equals(that.name)) return false; + if (!fieldName.equals(that.fieldName)) { + return false; + } + if (!name.equals(that.name)) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/aggregation/post/FieldAccessPostAggregator.java b/processing/src/main/java/io/druid/query/aggregation/post/FieldAccessPostAggregator.java index 6ded9402282..64b36936649 100644 --- a/processing/src/main/java/io/druid/query/aggregation/post/FieldAccessPostAggregator.java +++ b/processing/src/main/java/io/druid/query/aggregation/post/FieldAccessPostAggregator.java @@ -88,13 +88,21 @@ public class FieldAccessPostAggregator implements PostAggregator @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } FieldAccessPostAggregator that = (FieldAccessPostAggregator) o; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java b/processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java index 4f1b6447db6..14f971c6202 100644 --- a/processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java +++ b/processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java @@ -128,14 +128,22 @@ public class DefaultDimensionSpec implements DimensionSpec @Override public boolean equals(Object o) { - if (this == o) return true; + if (this == o) { + return true; + } // LegacyDimensionSpec can be equal to DefaultDimensionSpec - if (!(o instanceof DefaultDimensionSpec)) return false; + if (!(o instanceof DefaultDimensionSpec)) { + return false; + } DefaultDimensionSpec that = (DefaultDimensionSpec) o; - if (dimension != null ? !dimension.equals(that.dimension) : that.dimension != null) return false; - if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) return false; + if (dimension != null ? !dimension.equals(that.dimension) : that.dimension != null) { + return false; + } + if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java b/processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java index 802f3776b91..da3bd4ae769 100644 --- a/processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java +++ b/processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java @@ -121,15 +121,24 @@ public class ExtractionDimensionSpec implements DimensionSpec @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } ExtractionDimensionSpec that = (ExtractionDimensionSpec) o; - if (extractionFn != null ? !extractionFn.equals(that.extractionFn) : that.extractionFn != null) + if (extractionFn != null ? !extractionFn.equals(that.extractionFn) : that.extractionFn != null) { return false; - if (dimension != null ? !dimension.equals(that.dimension) : that.dimension != null) return false; - if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) return false; + } + if (dimension != null ? !dimension.equals(that.dimension) : that.dimension != null) { + return false; + } + if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/search/SearchQueryRunner.java b/processing/src/main/java/io/druid/query/search/SearchQueryRunner.java index a690cfaf092..22d425f7043 100644 --- a/processing/src/main/java/io/druid/query/search/SearchQueryRunner.java +++ b/processing/src/main/java/io/druid/query/search/SearchQueryRunner.java @@ -256,11 +256,11 @@ public class SearchQueryRunner implements QueryRunner> int mid = (low + high) >>> 1; long midVal = timeValues.getLongSingleValueRow(mid); - if (midVal < time) + if (midVal < time) { low = mid + 1; - else if (midVal > time) + } else if (midVal > time) { high = mid - 1; - else { // key found + } else { // key found int i; // rewind the index of the same time values for (i = mid - 1; i >= 0; i--) { diff --git a/processing/src/main/java/io/druid/query/search/search/SearchQuery.java b/processing/src/main/java/io/druid/query/search/search/SearchQuery.java index 8f5cd64d7b0..7ca2884e39e 100644 --- a/processing/src/main/java/io/druid/query/search/search/SearchQuery.java +++ b/processing/src/main/java/io/druid/query/search/search/SearchQuery.java @@ -223,18 +223,36 @@ public class SearchQuery extends BaseQuery> @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } SearchQuery that = (SearchQuery) o; - if (limit != that.limit) return false; - if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) return false; - if (dimensions != null ? !dimensions.equals(that.dimensions) : that.dimensions != null) return false; - if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) return false; - if (querySpec != null ? !querySpec.equals(that.querySpec) : that.querySpec != null) return false; - if (sortSpec != null ? !sortSpec.equals(that.sortSpec) : that.sortSpec != null) return false; + if (limit != that.limit) { + return false; + } + if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) { + return false; + } + if (dimensions != null ? !dimensions.equals(that.dimensions) : that.dimensions != null) { + return false; + } + if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) { + return false; + } + if (querySpec != null ? !querySpec.equals(that.querySpec) : that.querySpec != null) { + return false; + } + if (sortSpec != null ? !sortSpec.equals(that.sortSpec) : that.sortSpec != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/select/SelectQuery.java b/processing/src/main/java/io/druid/query/select/SelectQuery.java index fb552447c43..e53aa36ad2c 100644 --- a/processing/src/main/java/io/druid/query/select/SelectQuery.java +++ b/processing/src/main/java/io/druid/query/select/SelectQuery.java @@ -227,17 +227,33 @@ public class SelectQuery extends BaseQuery> @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } SelectQuery that = (SelectQuery) o; - if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) return false; - if (dimensions != null ? !dimensions.equals(that.dimensions) : that.dimensions != null) return false; - if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) return false; - if (metrics != null ? !metrics.equals(that.metrics) : that.metrics != null) return false; - if (pagingSpec != null ? !pagingSpec.equals(that.pagingSpec) : that.pagingSpec != null) return false; + if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) { + return false; + } + if (dimensions != null ? !dimensions.equals(that.dimensions) : that.dimensions != null) { + return false; + } + if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) { + return false; + } + if (metrics != null ? !metrics.equals(that.metrics) : that.metrics != null) { + return false; + } + if (pagingSpec != null ? !pagingSpec.equals(that.pagingSpec) : that.pagingSpec != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java b/processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java index 61ae8286f0c..92a57cc4966 100644 --- a/processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java +++ b/processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java @@ -68,12 +68,18 @@ public class MultipleIntervalSegmentSpec implements QuerySegmentSpec @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } MultipleIntervalSegmentSpec that = (MultipleIntervalSegmentSpec) o; - if (intervals != null ? !intervals.equals(that.intervals) : that.intervals != null) return false; + if (intervals != null ? !intervals.equals(that.intervals) : that.intervals != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java b/processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java index 16c7aecd00c..01a05fb15c1 100644 --- a/processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java +++ b/processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java @@ -95,13 +95,21 @@ public class MultipleSpecificSegmentSpec implements QuerySegmentSpec @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } MultipleSpecificSegmentSpec that = (MultipleSpecificSegmentSpec) o; - if (descriptors != null ? !descriptors.equals(that.descriptors) : that.descriptors != null) return false; - if (intervals != null ? !intervals.equals(that.intervals) : that.intervals != null) return false; + if (descriptors != null ? !descriptors.equals(that.descriptors) : that.descriptors != null) { + return false; + } + if (intervals != null ? !intervals.equals(that.intervals) : that.intervals != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java b/processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java index e45b40e76de..fe69a048518 100644 --- a/processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java +++ b/processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java @@ -57,12 +57,18 @@ public class SpecificSegmentSpec implements QuerySegmentSpec @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } SpecificSegmentSpec that = (SpecificSegmentSpec) o; - if (descriptor != null ? !descriptor.equals(that.descriptor) : that.descriptor != null) return false; + if (descriptor != null ? !descriptor.equals(that.descriptor) : that.descriptor != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java b/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java index d5e729046ba..d6c1b9ba6d5 100644 --- a/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java +++ b/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java @@ -32,7 +32,6 @@ import io.druid.query.Result; import io.druid.query.filter.DimFilter; import io.druid.query.spec.MultipleIntervalSegmentSpec; import io.druid.query.spec.QuerySegmentSpec; -import io.druid.query.filter.DimFilter; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java b/processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java index 7e3af2167fc..964bf38fb9d 100644 --- a/processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java +++ b/processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java @@ -190,18 +190,30 @@ public class TimeseriesQuery extends BaseQuery> @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } TimeseriesQuery that = (TimeseriesQuery) o; - if (aggregatorSpecs != null ? !aggregatorSpecs.equals(that.aggregatorSpecs) : that.aggregatorSpecs != null) + if (aggregatorSpecs != null ? !aggregatorSpecs.equals(that.aggregatorSpecs) : that.aggregatorSpecs != null) { return false; - if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) return false; - if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) return false; - if (postAggregatorSpecs != null ? !postAggregatorSpecs.equals(that.postAggregatorSpecs) : that.postAggregatorSpecs != null) + } + if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) { return false; + } + if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) { + return false; + } + if (postAggregatorSpecs != null ? !postAggregatorSpecs.equals(that.postAggregatorSpecs) : that.postAggregatorSpecs != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/topn/NumericTopNMetricSpec.java b/processing/src/main/java/io/druid/query/topn/NumericTopNMetricSpec.java index 5beda3c2c2d..48f11a8e3db 100644 --- a/processing/src/main/java/io/druid/query/topn/NumericTopNMetricSpec.java +++ b/processing/src/main/java/io/druid/query/topn/NumericTopNMetricSpec.java @@ -174,12 +174,18 @@ public class NumericTopNMetricSpec implements TopNMetricSpec @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } NumericTopNMetricSpec that = (NumericTopNMetricSpec) o; - if (metric != null ? !metric.equals(that.metric) : that.metric != null) return false; + if (metric != null ? !metric.equals(that.metric) : that.metric != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/topn/TopNQuery.java b/processing/src/main/java/io/druid/query/topn/TopNQuery.java index 71f4c23d3bd..9231d0c6083 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNQuery.java +++ b/processing/src/main/java/io/druid/query/topn/TopNQuery.java @@ -282,23 +282,39 @@ public class TopNQuery extends BaseQuery> @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } TopNQuery topNQuery = (TopNQuery) o; - if (threshold != topNQuery.threshold) return false; - if (aggregatorSpecs != null ? !aggregatorSpecs.equals(topNQuery.aggregatorSpecs) : topNQuery.aggregatorSpecs != null) + if (threshold != topNQuery.threshold) { return false; - if (dimFilter != null ? !dimFilter.equals(topNQuery.dimFilter) : topNQuery.dimFilter != null) return false; - if (dimensionSpec != null ? !dimensionSpec.equals(topNQuery.dimensionSpec) : topNQuery.dimensionSpec != null) + } + if (aggregatorSpecs != null ? !aggregatorSpecs.equals(topNQuery.aggregatorSpecs) : topNQuery.aggregatorSpecs != null) { return false; - if (granularity != null ? !granularity.equals(topNQuery.granularity) : topNQuery.granularity != null) return false; - if (postAggregatorSpecs != null ? !postAggregatorSpecs.equals(topNQuery.postAggregatorSpecs) : topNQuery.postAggregatorSpecs != null) + } + if (dimFilter != null ? !dimFilter.equals(topNQuery.dimFilter) : topNQuery.dimFilter != null) { return false; - if (topNMetricSpec != null ? !topNMetricSpec.equals(topNQuery.topNMetricSpec) : topNQuery.topNMetricSpec != null) + } + if (dimensionSpec != null ? !dimensionSpec.equals(topNQuery.dimensionSpec) : topNQuery.dimensionSpec != null) { return false; + } + if (granularity != null ? !granularity.equals(topNQuery.granularity) : topNQuery.granularity != null) { + return false; + } + if (postAggregatorSpecs != null ? !postAggregatorSpecs.equals(topNQuery.postAggregatorSpecs) : topNQuery.postAggregatorSpecs != null) { + return false; + } + if (topNMetricSpec != null ? !topNMetricSpec.equals(topNQuery.topNMetricSpec) : topNQuery.topNMetricSpec != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/segment/StringDimensionMergerLegacy.java b/processing/src/main/java/io/druid/segment/StringDimensionMergerLegacy.java index dea98bb296f..ed00a449e96 100644 --- a/processing/src/main/java/io/druid/segment/StringDimensionMergerLegacy.java +++ b/processing/src/main/java/io/druid/segment/StringDimensionMergerLegacy.java @@ -213,4 +213,4 @@ public class StringDimensionMergerLegacy extends StringDimensionMergerV9 impleme spatialIoPeon.cleanup(); } } -} \ No newline at end of file +} diff --git a/processing/src/main/java/io/druid/segment/StringDimensionMergerV9.java b/processing/src/main/java/io/druid/segment/StringDimensionMergerV9.java index b50d50cc58a..fbb2e2c6bb0 100644 --- a/processing/src/main/java/io/druid/segment/StringDimensionMergerV9.java +++ b/processing/src/main/java/io/druid/segment/StringDimensionMergerV9.java @@ -615,4 +615,4 @@ public class StringDimensionMergerV9 implements DimensionMergerV9 } return true; } -} \ No newline at end of file +} diff --git a/processing/src/main/java/io/druid/segment/data/BlockLayoutLongSupplierSerializer.java b/processing/src/main/java/io/druid/segment/data/BlockLayoutLongSupplierSerializer.java index 753b4c58cc1..ae682fd738d 100644 --- a/processing/src/main/java/io/druid/segment/data/BlockLayoutLongSupplierSerializer.java +++ b/processing/src/main/java/io/druid/segment/data/BlockLayoutLongSupplierSerializer.java @@ -154,4 +154,4 @@ public class BlockLayoutLongSupplierSerializer implements LongSupplierSerializer ByteStreams.copy(from, channel); } } -} \ No newline at end of file +} diff --git a/processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java b/processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java index d683f87e248..d18b28517b4 100644 --- a/processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java +++ b/processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java @@ -324,7 +324,9 @@ public final class ProtoTestEventWrapper { private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; + if (isInitialized != -1) { + return isInitialized == 1; + } if (!hasEventType()) { memoizedIsInitialized = 0; @@ -378,7 +380,9 @@ public final class ProtoTestEventWrapper { private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; - if (size != -1) return size; + if (size != -1) { + return size; + } size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -649,7 +653,9 @@ public final class ProtoTestEventWrapper { } public Builder mergeFrom(ProtoTestEventWrapper.ProtoTestEvent other) { - if (other == ProtoTestEventWrapper.ProtoTestEvent.getDefaultInstance()) return this; + if (other == ProtoTestEventWrapper.ProtoTestEvent.getDefaultInstance()) { + return this; + } if (other.hasEventType()) { setEventType(other.getEventType()); } diff --git a/processing/src/test/java/io/druid/query/aggregation/HistogramTest.java b/processing/src/test/java/io/druid/query/aggregation/HistogramTest.java index c1757663584..169106b4aba 100644 --- a/processing/src/test/java/io/druid/query/aggregation/HistogramTest.java +++ b/processing/src/test/java/io/druid/query/aggregation/HistogramTest.java @@ -38,7 +38,9 @@ public class HistogramTest Histogram hExpected = new Histogram(breaks, new long[]{1,3,2,3,1,1}, -3f, 2f); Histogram h = new Histogram(breaks); - for(float v : values) h.offer(v); + for(float v : values) { + h.offer(v); + } Assert.assertEquals("histogram matches expected histogram", hExpected, h); } diff --git a/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorBenchmark.java b/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorBenchmark.java index b67af0686ac..647a1d533e0 100644 --- a/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorBenchmark.java +++ b/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorBenchmark.java @@ -83,7 +83,9 @@ public class HyperLogLogCollectorBenchmark extends SimpleBenchmark int pos = 0; for(int i = 0; i < count; ++i) { HyperLogLogCollector c = HyperLogLogCollector.makeLatestCollector(); - for(int k = 0; k < 40; ++k) c.add(fn.hashInt(++val).asBytes()); + for(int k = 0; k < 40; ++k) { + c.add(fn.hashInt(++val).asBytes()); + } final ByteBuffer sparseHeapCopy = c.toByteBuffer(); int size = sparseHeapCopy.remaining(); diff --git a/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnExpectationsTest.java b/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnExpectationsTest.java index 81d43d310cc..a363f760603 100644 --- a/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnExpectationsTest.java +++ b/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnExpectationsTest.java @@ -20,7 +20,6 @@ package io.druid.query.lookup; import com.google.common.collect.ImmutableMap; -import io.druid.query.lookup.LookupExtractionFn; import io.druid.query.extraction.MapLookupExtractor; import org.junit.Assert; import org.junit.Test; diff --git a/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnTest.java b/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnTest.java index 963b4052133..bf8edbc0553 100644 --- a/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnTest.java +++ b/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnTest.java @@ -30,7 +30,6 @@ import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.metamx.common.IAE; import io.druid.jackson.DefaultObjectMapper; -import io.druid.query.lookup.LookupExtractionFn; import io.druid.query.extraction.MapLookupExtractor; import org.junit.Assert; import org.junit.Test; diff --git a/processing/src/test/java/io/druid/query/lookup/LookupExtractorTest.java b/processing/src/test/java/io/druid/query/lookup/LookupExtractorTest.java index aa3cccfd78c..7adeb7c775d 100644 --- a/processing/src/test/java/io/druid/query/lookup/LookupExtractorTest.java +++ b/processing/src/test/java/io/druid/query/lookup/LookupExtractorTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import io.druid.jackson.DefaultObjectMapper; import io.druid.query.extraction.MapLookupExtractor; -import io.druid.query.lookup.LookupExtractor; import org.junit.Assert; import org.junit.Test; diff --git a/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java b/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java index b40f721f451..fb56b5828b6 100644 --- a/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java +++ b/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java @@ -32,7 +32,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import io.druid.jackson.DefaultObjectMapper; -import io.druid.query.ordering.StringComparator; public class StringComparatorsTest { diff --git a/server/src/main/java/io/druid/server/coordinator/rules/LoadRule.java b/server/src/main/java/io/druid/server/coordinator/rules/LoadRule.java index 3c39c54a740..683b5ac9820 100644 --- a/server/src/main/java/io/druid/server/coordinator/rules/LoadRule.java +++ b/server/src/main/java/io/druid/server/coordinator/rules/LoadRule.java @@ -244,13 +244,16 @@ public abstract class LoadRule implements Rule } protected void validateTieredReplicants(Map tieredReplicants){ - if(tieredReplicants.size() == 0) + if(tieredReplicants.size() == 0) { throw new IAE("A rule with empty tiered replicants is invalid"); + } for (Map.Entry entry: tieredReplicants.entrySet()) { - if (entry.getValue() == null) + if (entry.getValue() == null) { throw new IAE("Replicant value cannot be empty"); - if (entry.getValue() < 0) + } + if (entry.getValue() < 0) { throw new IAE("Replicant value [%d] is less than 0, which is not allowed", entry.getValue()); + } } } diff --git a/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerConfigTest.java b/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerConfigTest.java index 6ca87b650a7..859502b0b2d 100644 --- a/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerConfigTest.java +++ b/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerConfigTest.java @@ -19,7 +19,6 @@ package io.druid.server.lookup.cache; -import io.druid.server.lookup.cache.LookupCoordinatorManagerConfig; import org.joda.time.Duration; import org.junit.Assert; import org.junit.Test;