From 60cdf946778d0624db6ddce0366e5fdb131437b2 Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Mon, 17 Jul 2017 16:22:29 +0300 Subject: [PATCH] Add PMD and prohibit unnecessary fully qualified class names in code (#4350) * Add PMD and prohibit unnecessary fully qualified class names in code * Extra fixes * Remove extra unnecessary fully-qualified names * Remove qualifiers * Remove qualifier --- .idea/inspectionProfiles/Druid.xml | 6 +++++ .idea/scopes/NonGeneratedFiles.xml | 3 +++ .../io/druid/guice/JsonConfigProvider.java | 2 +- .../java/io/druid/guice/LifecycleModule.java | 18 +++++++-------- .../java/io/druid/guice/ManageLifecycle.java | 2 +- .../io/druid/guice/ManageLifecycleLast.java | 2 +- .../main/java/io/druid/guice/PolyBind.java | 2 +- .../io/druid/timeline/DataSegmentUtils.java | 3 +-- ...figDrivenAwsCredentialsConfigProvider.java | 5 ++-- .../LazyFileSessionCredentialsProvider.java | 3 ++- .../spatial/split/GutmanSplitStrategy.java | 4 ++-- .../io/druid/collections/TestIntegerSet.java | 2 +- .../io/druid/common/config/Log4jShutdown.java | 3 ++- .../java/io/druid/common/utils/VMUtils.java | 5 ++-- .../druid/extendedset/intset/ConciseSet.java | 3 ++- .../intset/ImmutableConciseSet.java | 3 ++- .../SendAllTimelineEventConverter.java | 2 +- .../cassandra/CassandraDruidModule.java | 5 ++-- .../SendAllGraphiteEventConverter.java | 2 +- .../input/orc/OrcIndexGeneratorJobTest.java | 3 ++- .../storage/sqlserver/SQLServerConnector.java | 4 ++-- .../SQLServerMetadataStorageModule.java | 3 ++- .../input/AvroStreamInputRowParserTest.java | 3 ++- .../io/druid/client/cache/CaffeineCache.java | 2 +- .../lookup/KafkaLookupExtractorFactory.java | 3 ++- .../lookup/TestKafkaExtractionCluster.java | 3 ++- .../namespace/cache/CacheScheduler.java | 4 ++-- .../mysql/MySQLMetadataStorageModule.java | 3 ++- .../PostgreSQLMetadataStorageModule.java | 3 ++- .../storage/s3/S3StorageDruidModule.java | 3 ++- .../hadoop/DatasourceInputFormatTest.java | 12 +++++----- .../common/actions/SegmentInsertAction.java | 3 +-- .../io/druid/indexing/common/task/Task.java | 6 ++--- .../druid/indexing/overlord/TaskLockbox.java | 4 ++-- .../io/druid/indexing/overlord/TaskQueue.java | 2 +- .../druid/indexing/overlord/TaskRunner.java | 2 +- .../druid/indexing/overlord/TaskStorage.java | 2 +- .../overlord/setup/WorkerSelectStrategy.java | 2 +- .../config/ForkingTaskRunnerConfigTest.java | 7 +++--- .../src/main/java/org/testng/TestNG.java | 10 ++++---- .../java/util/common/CompressionUtils.java | 2 +- .../io/druid/java/util/common/FileUtils.java | 4 ++-- .../util/common/CompressionUtilsTest.java | 2 +- .../java/util/common/StringUtilsTest.java | 7 +++--- .../common/parsers/JavaScriptParserTest.java | 3 ++- pom.xml | 23 +++++++++++++++++++ .../io/druid/query/BitmapResultFactory.java | 6 ++--- .../src/main/java/io/druid/query/Druids.java | 12 +++++----- .../druid/query/extraction/ExtractionFn.java | 3 +-- .../query/filter/ExtractionDimFilter.java | 2 +- .../io/druid/query/topn/TopNQueryBuilder.java | 2 +- .../io/druid/query/topn/TopNQueryMetrics.java | 4 +--- .../java/io/druid/segment/IndexMerger.java | 2 +- .../java/io/druid/segment/QueryableIndex.java | 2 +- .../segment/data/CompressionFactory.java | 2 +- .../io/druid/guice/GuiceInjectorsTest.java | 3 ++- .../StringFormatExtractionFnTest.java | 4 +++- .../spec/SpecificSegmentQueryRunnerTest.java | 3 ++- .../druid/segment/MergeIntIteratorTest.java | 2 +- .../druid/client/HttpServerInventoryView.java | 2 +- .../discovery/CuratorServiceUtils.java | 4 ++-- .../guice/LocalDataStorageDruidModule.java | 5 ++-- .../java/io/druid/guice/ServerModule.java | 3 ++- .../druid/initialization/Initialization.java | 4 ++-- .../EventReceiverFirehoseFactory.java | 4 ++-- .../announcer/ListenerDiscoverer.java | 2 +- .../druid/client/cache/CacheConfigTest.java | 11 +++++---- .../selector/TierSelectorStrategyTest.java | 3 ++- .../CuratorInventoryManagerTest.java | 3 ++- .../AsyncQueryForwardingServletTest.java | 3 ++- .../io/druid/server/QueryResourceTest.java | 3 ++- .../server/log/LoggingRequestLoggerTest.java | 5 ++-- .../cache/LookupCoordinatorManagerTest.java | 3 ++- .../io/druid/sql/calcite/rel/QueryMaker.java | 5 ++-- 74 files changed, 182 insertions(+), 125 deletions(-) create mode 100644 .idea/scopes/NonGeneratedFiles.xml diff --git a/.idea/inspectionProfiles/Druid.xml b/.idea/inspectionProfiles/Druid.xml index 5d889a5af5d..d4aeeb2afd8 100644 --- a/.idea/inspectionProfiles/Druid.xml +++ b/.idea/inspectionProfiles/Druid.xml @@ -104,6 +104,12 @@ + + + + diff --git a/.idea/scopes/NonGeneratedFiles.xml b/.idea/scopes/NonGeneratedFiles.xml new file mode 100644 index 00000000000..22375373e96 --- /dev/null +++ b/.idea/scopes/NonGeneratedFiles.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/api/src/main/java/io/druid/guice/JsonConfigProvider.java b/api/src/main/java/io/druid/guice/JsonConfigProvider.java index f9017af2ff9..f91e7ca0fc1 100644 --- a/api/src/main/java/io/druid/guice/JsonConfigProvider.java +++ b/api/src/main/java/io/druid/guice/JsonConfigProvider.java @@ -48,7 +48,7 @@ import java.util.Properties; *

Implementation

*
* The state of {@code } is defined by the value of the property {@code propertyBase}. - * This value is a json structure, decoded via {@link JsonConfigurator#configurate(java.util.Properties, String, Class)}. + * This value is a json structure, decoded via {@link JsonConfigurator#configurate(Properties, String, Class)}. *
* * An example might be if DruidServerConfig.class were diff --git a/api/src/main/java/io/druid/guice/LifecycleModule.java b/api/src/main/java/io/druid/guice/LifecycleModule.java index eb65d7c2e28..36af8ede809 100644 --- a/api/src/main/java/io/druid/guice/LifecycleModule.java +++ b/api/src/main/java/io/druid/guice/LifecycleModule.java @@ -49,8 +49,8 @@ public class LifecycleModule implements Module * scope. That is, they are generally eagerly loaded because the loading operation will produce some beneficial * side-effect even if nothing actually directly depends on the instance. * - * This mechanism exists to allow the {@link io.druid.java.util.common.lifecycle.Lifecycle} to be the primary entry point from the injector, not to - * auto-register things with the {@link io.druid.java.util.common.lifecycle.Lifecycle}. It is also possible to just bind things eagerly with Guice, + * This mechanism exists to allow the {@link Lifecycle} to be the primary entry point from the injector, not to + * auto-register things with the {@link Lifecycle}. It is also possible to just bind things eagerly with Guice, * it is not clear which is actually the best approach. This is more explicit, but eager bindings inside of modules * is less error-prone. * @@ -70,8 +70,8 @@ public class LifecycleModule implements Module * scope. That is, they are generally eagerly loaded because the loading operation will produce some beneficial * side-effect even if nothing actually directly depends on the instance. * - * This mechanism exists to allow the {@link io.druid.java.util.common.lifecycle.Lifecycle} to be the primary entry point from the injector, not to - * auto-register things with the {@link io.druid.java.util.common.lifecycle.Lifecycle}. It is also possible to just bind things eagerly with Guice, + * This mechanism exists to allow the {@link Lifecycle} to be the primary entry point from the injector, not to + * auto-register things with the {@link Lifecycle}. It is also possible to just bind things eagerly with Guice, * it is not clear which is actually the best approach. This is more explicit, but eager bindings inside of modules * is less error-prone. * @@ -92,8 +92,8 @@ public class LifecycleModule implements Module * scope. That is, they are generally eagerly loaded because the loading operation will produce some beneficial * side-effect even if nothing actually directly depends on the instance. * - * This mechanism exists to allow the {@link io.druid.java.util.common.lifecycle.Lifecycle} to be the primary entry point from the injector, not to - * auto-register things with the {@link io.druid.java.util.common.lifecycle.Lifecycle}. It is also possible to just bind things eagerly with Guice, + * This mechanism exists to allow the {@link Lifecycle} to be the primary entry point from the injector, not to + * auto-register things with the {@link Lifecycle}. It is also possible to just bind things eagerly with Guice, * it is not clear which is actually the best approach. This is more explicit, but eager bindings inside of modules * is less error-prone. * @@ -107,15 +107,15 @@ public class LifecycleModule implements Module } /** - * Registers a key to instantiate eagerly. {@link com.google.inject.Key}s mentioned here will be pulled out of + * Registers a key to instantiate eagerly. {@link Key}s mentioned here will be pulled out of * the injector with an injector.getInstance() call when the lifecycle is created. * * Eagerly loaded classes will *not* be automatically added to the Lifecycle unless they are bound to the proper * scope. That is, they are generally eagerly loaded because the loading operation will produce some beneficial * side-effect even if nothing actually directly depends on the instance. * - * This mechanism exists to allow the {@link io.druid.java.util.common.lifecycle.Lifecycle} to be the primary entry point - * from the injector, not to auto-register things with the {@link io.druid.java.util.common.lifecycle.Lifecycle}. It is + * This mechanism exists to allow the {@link Lifecycle} to be the primary entry point + * from the injector, not to auto-register things with the {@link Lifecycle}. It is * also possible to just bind things eagerly with Guice, it is not clear which is actually the best approach. * This is more explicit, but eager bindings inside of modules is less error-prone. * diff --git a/api/src/main/java/io/druid/guice/ManageLifecycle.java b/api/src/main/java/io/druid/guice/ManageLifecycle.java index 4256467d7f6..e062aa3994b 100644 --- a/api/src/main/java/io/druid/guice/ManageLifecycle.java +++ b/api/src/main/java/io/druid/guice/ManageLifecycle.java @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Marks the object to be managed by {@link io.druid.java.util.common.lifecycle.Lifecycle} * - * This Scope gets defined by {@link io.druid.guice.LifecycleModule} + * This Scope gets defined by {@link LifecycleModule} */ @Target({ ElementType.TYPE, ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) diff --git a/api/src/main/java/io/druid/guice/ManageLifecycleLast.java b/api/src/main/java/io/druid/guice/ManageLifecycleLast.java index e542ad10c5e..ff88784898a 100644 --- a/api/src/main/java/io/druid/guice/ManageLifecycleLast.java +++ b/api/src/main/java/io/druid/guice/ManageLifecycleLast.java @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Marks the object to be managed by {@link io.druid.java.util.common.lifecycle.Lifecycle} and set to be on Stage.LAST * - * This Scope gets defined by {@link io.druid.guice.LifecycleModule} + * This Scope gets defined by {@link LifecycleModule} */ @Target({ ElementType.TYPE, ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) diff --git a/api/src/main/java/io/druid/guice/PolyBind.java b/api/src/main/java/io/druid/guice/PolyBind.java index f6466e69365..76991f248d9 100644 --- a/api/src/main/java/io/druid/guice/PolyBind.java +++ b/api/src/main/java/io/druid/guice/PolyBind.java @@ -69,7 +69,7 @@ public class PolyBind } /** - * @deprecated use {@link #createChoiceWithDefault(com.google.inject.Binder, String, com.google.inject.Key, String)} + * @deprecated use {@link #createChoiceWithDefault(Binder, String, Key, String)} * instead. {@code defaultKey} argument is ignored. */ @Deprecated diff --git a/api/src/main/java/io/druid/timeline/DataSegmentUtils.java b/api/src/main/java/io/druid/timeline/DataSegmentUtils.java index 357892a776d..242c432bc18 100644 --- a/api/src/main/java/io/druid/timeline/DataSegmentUtils.java +++ b/api/src/main/java/io/druid/timeline/DataSegmentUtils.java @@ -67,8 +67,7 @@ public class DataSegmentUtils * * @param dataSource the dataSource corresponding to this identifier * @param identifier segment identifier - * @return a {@link io.druid.timeline.DataSegmentUtils.SegmentIdentifierParts} object if the identifier could be - * parsed, null otherwise + * @return a {@link DataSegmentUtils.SegmentIdentifierParts} object if the identifier could be parsed, null otherwise */ public static SegmentIdentifierParts valueOf(String dataSource, String identifier) { diff --git a/aws-common/src/main/java/io/druid/common/aws/ConfigDrivenAwsCredentialsConfigProvider.java b/aws-common/src/main/java/io/druid/common/aws/ConfigDrivenAwsCredentialsConfigProvider.java index f0553c5003c..8ec52378078 100644 --- a/aws-common/src/main/java/io/druid/common/aws/ConfigDrivenAwsCredentialsConfigProvider.java +++ b/aws-common/src/main/java/io/druid/common/aws/ConfigDrivenAwsCredentialsConfigProvider.java @@ -20,6 +20,7 @@ package io.druid.common.aws; import com.amazonaws.AmazonClientException; +import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; import com.google.common.base.Strings; @@ -32,10 +33,10 @@ public class ConfigDrivenAwsCredentialsConfigProvider implements AWSCredentialsP } @Override - public com.amazonaws.auth.AWSCredentials getCredentials() + public AWSCredentials getCredentials() { if (!Strings.isNullOrEmpty(config.getAccessKey()) && !Strings.isNullOrEmpty(config.getSecretKey())) { - return new com.amazonaws.auth.AWSCredentials() { + return new AWSCredentials() { @Override public String getAWSAccessKeyId() { return config.getAccessKey(); diff --git a/aws-common/src/main/java/io/druid/common/aws/LazyFileSessionCredentialsProvider.java b/aws-common/src/main/java/io/druid/common/aws/LazyFileSessionCredentialsProvider.java index 297efae8e89..ccab7ed3145 100644 --- a/aws-common/src/main/java/io/druid/common/aws/LazyFileSessionCredentialsProvider.java +++ b/aws-common/src/main/java/io/druid/common/aws/LazyFileSessionCredentialsProvider.java @@ -19,6 +19,7 @@ package io.druid.common.aws; +import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; public class LazyFileSessionCredentialsProvider implements AWSCredentialsProvider @@ -42,7 +43,7 @@ public class LazyFileSessionCredentialsProvider implements AWSCredentialsProvide } @Override - public com.amazonaws.auth.AWSCredentials getCredentials() + public AWSCredentials getCredentials() { return getUnderlyingProvider().getCredentials(); } diff --git a/bytebuffer-collections/src/main/java/io/druid/collections/spatial/split/GutmanSplitStrategy.java b/bytebuffer-collections/src/main/java/io/druid/collections/spatial/split/GutmanSplitStrategy.java index fb425f46e10..5dbdb2742d7 100755 --- a/bytebuffer-collections/src/main/java/io/druid/collections/spatial/split/GutmanSplitStrategy.java +++ b/bytebuffer-collections/src/main/java/io/druid/collections/spatial/split/GutmanSplitStrategy.java @@ -53,13 +53,13 @@ public abstract class GutmanSplitStrategy implements SplitStrategy * * Algorithm Split. Divide a set of M+1 index entries into two groups. * - * S1. [Pick first entry for each group]. Apply Algorithm {@link #pickSeeds(java.util.List)} to choose + * S1. [Pick first entry for each group]. Apply Algorithm {@link #pickSeeds(List)} to choose * two entries to be the first elements of the groups. Assign each to a group. * * S2. [Check if done]. If all entries have been assigned, stop. If one group has so few entries that all the rest * must be assigned to it in order for it to have the minimum number m, assign them and stop. * - * S3. [Select entry to assign]. Invoke Algorithm {@link #pickNext(java.util.List, Node[])} + * S3. [Select entry to assign]. Invoke Algorithm {@link #pickNext(List, Node[])} * to choose the next entry to assign. Add it to the group whose covering rectangle will have to be enlarged least to * accommodate it. Resolve ties by adding the entry to the group smaller area, then to the one with fewer entries, then * to either. Repeat from S2. diff --git a/bytebuffer-collections/src/test/java/io/druid/collections/TestIntegerSet.java b/bytebuffer-collections/src/test/java/io/druid/collections/TestIntegerSet.java index a837bd972b2..1bdfbe284b4 100755 --- a/bytebuffer-collections/src/test/java/io/druid/collections/TestIntegerSet.java +++ b/bytebuffer-collections/src/test/java/io/druid/collections/TestIntegerSet.java @@ -189,7 +189,7 @@ public class TestIntegerSet IntegerSet integerSet = IntegerSet.wrap(wrappedBitmap); integerSet.add(Integer.MAX_VALUE + 1); } - catch (java.lang.IllegalArgumentException ex) { + catch (IllegalArgumentException ex) { e = ex; } Assert.assertNotNull(e); diff --git a/common/src/main/java/io/druid/common/config/Log4jShutdown.java b/common/src/main/java/io/druid/common/config/Log4jShutdown.java index fc30acfe572..a7a2b550737 100644 --- a/common/src/main/java/io/druid/common/config/Log4jShutdown.java +++ b/common/src/main/java/io/druid/common/config/Log4jShutdown.java @@ -21,6 +21,7 @@ package io.druid.common.config; import com.google.common.base.Throwables; import io.druid.java.util.common.ISE; +import org.apache.logging.log4j.core.LifeCycle; import org.apache.logging.log4j.core.util.Cancellable; import org.apache.logging.log4j.core.util.ShutdownCallbackRegistry; @@ -29,7 +30,7 @@ import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicBoolean; -public class Log4jShutdown implements ShutdownCallbackRegistry, org.apache.logging.log4j.core.LifeCycle +public class Log4jShutdown implements ShutdownCallbackRegistry, LifeCycle { private static final long SHUTDOWN_WAIT_TIMEOUT = 60000; diff --git a/common/src/main/java/io/druid/common/utils/VMUtils.java b/common/src/main/java/io/druid/common/utils/VMUtils.java index 1f09ede3bf7..530f56a2381 100644 --- a/common/src/main/java/io/druid/common/utils/VMUtils.java +++ b/common/src/main/java/io/druid/common/utils/VMUtils.java @@ -49,9 +49,8 @@ public class VMUtils * * @return total CPU time for the current thread in nanoseconds. * - * @throws java.lang.UnsupportedOperationException if the Java - * virtual machine does not support CPU time measurement for - * the current thread. + * @throws UnsupportedOperationException if the Java virtual machine does not support CPU time measurement for + * the current thread. */ public static long getCurrentThreadCpuTime() { diff --git a/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSet.java b/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSet.java index d859c77e74c..4f28892e725 100755 --- a/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSet.java +++ b/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSet.java @@ -25,6 +25,7 @@ import io.druid.java.util.common.StringUtils; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.io.Serializable; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; @@ -61,7 +62,7 @@ import java.util.SortedSet; * @author Alessandro Colantonio * @version $Id$ */ -public class ConciseSet extends AbstractIntSet implements java.io.Serializable +public class ConciseSet extends AbstractIntSet implements Serializable { /** * generated serial ID diff --git a/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java b/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java index 34e82974a77..6347c53f30d 100755 --- a/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java +++ b/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java @@ -21,6 +21,7 @@ import com.google.common.collect.Iterators; import com.google.common.collect.UnmodifiableIterator; import com.google.common.primitives.Ints; import io.druid.extendedset.utilities.IntList; +import org.roaringbitmap.IntIterator; import java.nio.ByteBuffer; import java.nio.IntBuffer; @@ -1000,7 +1001,7 @@ public class ImmutableConciseSet return new WordIterator(); } - public class WordIterator implements org.roaringbitmap.IntIterator, Cloneable + public class WordIterator implements IntIterator, Cloneable { private int startIndex; private int wordsWalked; diff --git a/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java b/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java index 219bc04ec37..8d7a02f2c40 100644 --- a/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java +++ b/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java @@ -30,7 +30,7 @@ import com.metamx.emitter.service.ServiceMetricEvent; import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric; /** - * Emits all the events instance of {@link com.metamx.emitter.service.ServiceMetricEvent}. + * Emits all the events instance of {@link ServiceMetricEvent}. *

* All the dimensions will be retained and lexicographically order using dimensions name. *

diff --git a/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDruidModule.java b/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDruidModule.java index 5597e384f54..a3f61a07f9d 100644 --- a/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDruidModule.java +++ b/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDruidModule.java @@ -20,6 +20,7 @@ package io.druid.storage.cassandra; import com.fasterxml.jackson.core.Version; +import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Key; @@ -54,10 +55,10 @@ public class CassandraDruidModule implements DruidModule } @Override - public List getJacksonModules() + public List getJacksonModules() { return ImmutableList.of( - new com.fasterxml.jackson.databind.Module() + new Module() { @Override public String getModuleName() diff --git a/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/SendAllGraphiteEventConverter.java b/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/SendAllGraphiteEventConverter.java index 5b91cb8266d..c443b220d12 100644 --- a/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/SendAllGraphiteEventConverter.java +++ b/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/SendAllGraphiteEventConverter.java @@ -31,7 +31,7 @@ import com.metamx.emitter.service.ServiceMetricEvent; import java.util.concurrent.TimeUnit; /** - * Emits all the events instance of {@link com.metamx.emitter.service.ServiceMetricEvent}. + * Emits all the events instance of {@link ServiceMetricEvent}. *

* All the dimensions will be retained and lexicographically order using dimensions name. *

diff --git a/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java b/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java index ffb058eac76..114a8924682 100644 --- a/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java +++ b/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java @@ -59,6 +59,7 @@ import org.apache.hadoop.mapreduce.JobContext; import org.apache.orc.CompressionKind; import org.apache.orc.OrcFile; import org.apache.orc.TypeDescription; +import org.apache.orc.Writer; import org.joda.time.DateTime; import org.joda.time.DateTimeComparator; import org.joda.time.Interval; @@ -141,7 +142,7 @@ public class OrcIndexGeneratorJobTest .addField("host", TypeDescription.createString()) .addField("visited_num", TypeDescription.createInt()); Configuration conf = new Configuration(); - org.apache.orc.Writer writer = OrcFile.createWriter( + Writer writer = OrcFile.createWriter( new Path(outputFile.getPath()), OrcFile.writerOptions(conf) .setSchema(schema) diff --git a/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerConnector.java b/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerConnector.java index c7eae0893eb..920620acaf6 100644 --- a/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerConnector.java +++ b/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerConnector.java @@ -126,7 +126,7 @@ public class SQLServerConnector extends SQLMetadataConnector *

* * @see Spring Framework SQLStateSQLExceptionTranslator - * @see java.sql.SQLException#getSQLState() + * @see SQLException#getSQLState() */ private final Set TRANSIENT_SQL_CLASS_CODES = new HashSet<>(Arrays.asList( "08", "53", "54", "57", "58", // Resource Failures @@ -265,7 +265,7 @@ public class SQLServerConnector extends SQLMetadataConnector * * {@inheritDoc} * - * @see java.sql.SQLException#getSQLState() + * @see SQLException#getSQLState() * */ @Override diff --git a/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java b/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java index 0f27099dccc..cc79abb5c7b 100644 --- a/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java +++ b/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java @@ -18,6 +18,7 @@ */ package io.druid.metadata.storage.sqlserver; +import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Key; @@ -44,7 +45,7 @@ public class SQLServerMetadataStorageModule extends SQLMetadataStorageDruidModul } @Override - public List getJacksonModules() + public List getJacksonModules() { return ImmutableList.of(); } diff --git a/extensions-core/avro-extensions/src/test/java/io/druid/data/input/AvroStreamInputRowParserTest.java b/extensions-core/avro-extensions/src/test/java/io/druid/data/input/AvroStreamInputRowParserTest.java index e8d24e76012..003c59261c5 100644 --- a/extensions-core/avro-extensions/src/test/java/io/druid/data/input/AvroStreamInputRowParserTest.java +++ b/extensions-core/avro-extensions/src/test/java/io/druid/data/input/AvroStreamInputRowParserTest.java @@ -19,6 +19,7 @@ package io.druid.data.input; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.google.common.base.Function; @@ -121,7 +122,7 @@ public class AvroStreamInputRowParserTest { jsonMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); jsonMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - for (com.fasterxml.jackson.databind.Module jacksonModule : new AvroExtensionsModule().getJacksonModules()) { + for (Module jacksonModule : new AvroExtensionsModule().getJacksonModules()) { jsonMapper.registerModule(jacksonModule); } } diff --git a/extensions-core/caffeine-cache/src/main/java/io/druid/client/cache/CaffeineCache.java b/extensions-core/caffeine-cache/src/main/java/io/druid/client/cache/CaffeineCache.java index fa9ca149358..ba4688a3ef4 100644 --- a/extensions-core/caffeine-cache/src/main/java/io/druid/client/cache/CaffeineCache.java +++ b/extensions-core/caffeine-cache/src/main/java/io/druid/client/cache/CaffeineCache.java @@ -118,7 +118,7 @@ public class CaffeineCache implements io.druid.client.cache.Cache @Override public io.druid.client.cache.CacheStats getStats() { - final com.github.benmanes.caffeine.cache.stats.CacheStats stats = cache.stats(); + final CacheStats stats = cache.stats(); final long size = cache .policy().eviction() .map(eviction -> eviction.isWeighted() ? eviction.weightedSize() : OptionalLong.empty()) diff --git a/extensions-core/kafka-extraction-namespace/src/main/java/io/druid/query/lookup/KafkaLookupExtractorFactory.java b/extensions-core/kafka-extraction-namespace/src/main/java/io/druid/query/lookup/KafkaLookupExtractorFactory.java index ebd99c430ad..8e1d8bd38c9 100644 --- a/extensions-core/kafka-extraction-namespace/src/main/java/io/druid/query/lookup/KafkaLookupExtractorFactory.java +++ b/extensions-core/kafka-extraction-namespace/src/main/java/io/druid/query/lookup/KafkaLookupExtractorFactory.java @@ -43,6 +43,7 @@ import kafka.consumer.ConsumerConfig; import kafka.consumer.KafkaStream; import kafka.consumer.Whitelist; import kafka.javaapi.consumer.ConsumerConnector; +import kafka.javaapi.consumer.ZookeeperConsumerConnector; import kafka.message.MessageAndMetadata; import kafka.serializer.Decoder; @@ -294,7 +295,7 @@ public class KafkaLookupExtractorFactory implements LookupExtractorFactory // Overridden in tests ConsumerConnector buildConnector(Properties properties) { - return new kafka.javaapi.consumer.ZookeeperConsumerConnector( + return new ZookeeperConsumerConnector( new ConsumerConfig(properties) ); } diff --git a/extensions-core/kafka-extraction-namespace/src/test/java/io/druid/query/lookup/TestKafkaExtractionCluster.java b/extensions-core/kafka-extraction-namespace/src/test/java/io/druid/query/lookup/TestKafkaExtractionCluster.java index ca7b94a2fc0..6c9ad105417 100644 --- a/extensions-core/kafka-extraction-namespace/src/test/java/io/druid/query/lookup/TestKafkaExtractionCluster.java +++ b/extensions-core/kafka-extraction-namespace/src/test/java/io/druid/query/lookup/TestKafkaExtractionCluster.java @@ -42,6 +42,7 @@ import kafka.server.KafkaServer; import kafka.utils.Time; import kafka.utils.ZKStringSerializer$; import org.I0Itec.zkclient.ZkClient; +import org.I0Itec.zkclient.exception.ZkException; import org.apache.curator.test.TestingServer; import org.apache.zookeeper.CreateMode; import org.joda.time.DateTime; @@ -199,7 +200,7 @@ public class TestKafkaExtractionCluster try { zkClient.deleteRecursive(zkKafkaPath); } - catch (org.I0Itec.zkclient.exception.ZkException ex) { + catch (ZkException ex) { log.warn(ex, "error deleting %s zk node", zkKafkaPath); } } diff --git a/extensions-core/lookups-cached-global/src/main/java/io/druid/server/lookup/namespace/cache/CacheScheduler.java b/extensions-core/lookups-cached-global/src/main/java/io/druid/server/lookup/namespace/cache/CacheScheduler.java index 652c0d91df4..d135b0e4883 100644 --- a/extensions-core/lookups-cached-global/src/main/java/io/druid/server/lookup/namespace/cache/CacheScheduler.java +++ b/extensions-core/lookups-cached-global/src/main/java/io/druid/server/lookup/namespace/cache/CacheScheduler.java @@ -453,8 +453,8 @@ public final class CacheScheduler } /** - * This method should be used from {@link io.druid.query.lookup.namespace.CacheGenerator#generateCache} implementations, to obtain - * a {@link VersionedCache} to be returned. + * This method should be used from {@link CacheGenerator#generateCache} implementations, to obtain a {@link + * VersionedCache} to be returned. * * @param entryId an object uniquely corresponding to the {@link CacheScheduler.Entry}, for which VersionedCache is * created diff --git a/extensions-core/mysql-metadata-storage/src/main/java/io/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java b/extensions-core/mysql-metadata-storage/src/main/java/io/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java index 4a86dd627bd..1aad097dc77 100644 --- a/extensions-core/mysql-metadata-storage/src/main/java/io/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java +++ b/extensions-core/mysql-metadata-storage/src/main/java/io/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java @@ -19,6 +19,7 @@ package io.druid.metadata.storage.mysql; +import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Key; @@ -43,7 +44,7 @@ public class MySQLMetadataStorageModule extends SQLMetadataStorageDruidModule im } @Override - public List getJacksonModules() + public List getJacksonModules() { return ImmutableList.of(); } diff --git a/extensions-core/postgresql-metadata-storage/src/main/java/io/druid/metadata/storage/postgresql/PostgreSQLMetadataStorageModule.java b/extensions-core/postgresql-metadata-storage/src/main/java/io/druid/metadata/storage/postgresql/PostgreSQLMetadataStorageModule.java index e815682d4d0..161022b3e10 100644 --- a/extensions-core/postgresql-metadata-storage/src/main/java/io/druid/metadata/storage/postgresql/PostgreSQLMetadataStorageModule.java +++ b/extensions-core/postgresql-metadata-storage/src/main/java/io/druid/metadata/storage/postgresql/PostgreSQLMetadataStorageModule.java @@ -19,6 +19,7 @@ package io.druid.metadata.storage.postgresql; +import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Key; @@ -44,7 +45,7 @@ public class PostgreSQLMetadataStorageModule extends SQLMetadataStorageDruidModu } @Override - public List getJacksonModules() + public List getJacksonModules() { return ImmutableList.of(); } diff --git a/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/S3StorageDruidModule.java b/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/S3StorageDruidModule.java index 301aae0494a..c9c0568f088 100644 --- a/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/S3StorageDruidModule.java +++ b/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/S3StorageDruidModule.java @@ -20,6 +20,7 @@ package io.druid.storage.s3; import com.amazonaws.auth.AWSCredentialsProvider; +import com.amazonaws.auth.AWSSessionCredentials; import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; @@ -103,7 +104,7 @@ public class S3StorageDruidModule implements DruidModule @LazySingleton public RestS3Service getRestS3Service(AWSCredentialsProvider provider) { - if (provider.getCredentials() instanceof com.amazonaws.auth.AWSSessionCredentials) { + if (provider.getCredentials() instanceof AWSSessionCredentials) { return new RestS3Service(new AWSSessionCredentialsAdapter(provider)); } else { return new RestS3Service(new AWSCredentials( diff --git a/indexing-hadoop/src/test/java/io/druid/indexer/hadoop/DatasourceInputFormatTest.java b/indexing-hadoop/src/test/java/io/druid/indexer/hadoop/DatasourceInputFormatTest.java index 616d364a045..59843aaa9bd 100644 --- a/indexing-hadoop/src/test/java/io/druid/indexer/hadoop/DatasourceInputFormatTest.java +++ b/indexing-hadoop/src/test/java/io/druid/indexer/hadoop/DatasourceInputFormatTest.java @@ -357,8 +357,8 @@ public class DatasourceInputFormatTest @Test public void testGetLocationsInputFormatException() throws IOException { - final org.apache.hadoop.mapred.InputFormat fio = EasyMock.mock( - org.apache.hadoop.mapred.InputFormat.class + final InputFormat fio = EasyMock.mock( + InputFormat.class ); EasyMock.expect(fio.getSplits(config, 1)).andThrow(new IOException("testing")); @@ -373,8 +373,8 @@ public class DatasourceInputFormatTest @Test public void testGetLocationsSplitException() throws IOException { - final org.apache.hadoop.mapred.InputFormat fio = EasyMock.mock( - org.apache.hadoop.mapred.InputFormat.class + final InputFormat fio = EasyMock.mock( + InputFormat.class ); final org.apache.hadoop.mapred.InputSplit split = EasyMock.mock( @@ -397,8 +397,8 @@ public class DatasourceInputFormatTest @Test public void testGetLocations() throws IOException { - final org.apache.hadoop.mapred.InputFormat fio = EasyMock.mock( - org.apache.hadoop.mapred.InputFormat.class + final InputFormat fio = EasyMock.mock( + InputFormat.class ); final org.apache.hadoop.mapred.InputSplit split = EasyMock.mock( diff --git a/indexing-service/src/main/java/io/druid/indexing/common/actions/SegmentInsertAction.java b/indexing-service/src/main/java/io/druid/indexing/common/actions/SegmentInsertAction.java index d73c073c9dd..87294023c0b 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/actions/SegmentInsertAction.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/actions/SegmentInsertAction.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.collect.ImmutableSet; import io.druid.indexing.common.task.Task; -import io.druid.indexing.overlord.DataSourceMetadata; import io.druid.timeline.DataSegment; import java.io.IOException; @@ -66,7 +65,7 @@ public class SegmentInsertAction implements TaskAction> /** * Behaves similarly to - * {@link io.druid.indexing.overlord.IndexerMetadataStorageCoordinator#announceHistoricalSegments(Set, DataSourceMetadata, DataSourceMetadata)}, + * {@link io.druid.indexing.overlord.IndexerMetadataStorageCoordinator#announceHistoricalSegments}, * with startMetadata and endMetadata both null. */ @Override diff --git a/indexing-service/src/main/java/io/druid/indexing/common/task/Task.java b/indexing-service/src/main/java/io/druid/indexing/common/task/Task.java index 7f57c0e7662..39210ad9122 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/task/Task.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/task/Task.java @@ -79,10 +79,10 @@ public interface Task public String getGroupId(); /** - * Returns a {@link io.druid.indexing.common.task.TaskResource} for this task. Task resources define specific - * worker requirements a task may require. + * Returns a {@link TaskResource} for this task. Task resources define specific worker requirements a task may + * require. * - * @return {@link io.druid.indexing.common.task.TaskResource} for this task + * @return {@link TaskResource} for this task */ public TaskResource getTaskResource(); diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java index 7d00532d1f7..eae79c8add1 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java @@ -97,7 +97,7 @@ public class TaskLockbox } /** - * Wipe out our current in-memory state and resync it from our bundled {@link io.druid.indexing.overlord.TaskStorage}. + * Wipe out our current in-memory state and resync it from our bundled {@link TaskStorage}. */ public void syncFromStorage() { @@ -196,7 +196,7 @@ public class TaskLockbox * @param interval interval to lock * @return acquired TaskLock * - * @throws java.lang.InterruptedException if the lock cannot be acquired + * @throws InterruptedException if the lock cannot be acquired */ public TaskLock lock(final Task task, final Interval interval) throws InterruptedException { diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskQueue.java b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskQueue.java index ef4fafabcfe..1fabf2bf719 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskQueue.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskQueue.java @@ -305,7 +305,7 @@ public class TaskQueue * * @return true * - * @throws io.druid.metadata.EntryExistsException if the task already exists + * @throws EntryExistsException if the task already exists */ public boolean add(final Task task) throws EntryExistsException { diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskRunner.java b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskRunner.java index 168b0d85207..51b4e45de1a 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskRunner.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskRunner.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.concurrent.Executor; /** - * Interface for handing off tasks. Managed by a {@link io.druid.indexing.overlord.TaskQueue}. + * Interface for handing off tasks. Managed by a {@link TaskQueue}. * Holds state */ public interface TaskRunner diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskStorage.java b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskStorage.java index dc5986092e0..8e662bab130 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskStorage.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskStorage.java @@ -35,7 +35,7 @@ public interface TaskStorage * * @param task task to add * @param status task status - * @throws io.druid.metadata.EntryExistsException if the task ID already exists + * @throws EntryExistsException if the task ID already exists */ public void insert(Task task, TaskStatus status) throws EntryExistsException; diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/setup/WorkerSelectStrategy.java b/indexing-service/src/main/java/io/druid/indexing/overlord/setup/WorkerSelectStrategy.java index 87fcfb69c5b..d58de1d6b7b 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/setup/WorkerSelectStrategy.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/setup/WorkerSelectStrategy.java @@ -47,7 +47,7 @@ public interface WorkerSelectStrategy * @param zkWorkers An immutable map of workers to choose from. * @param task The task to assign. * - * @return A {@link io.druid.indexing.overlord.ImmutableWorkerInfo} to run the task if one is available. + * @return A {@link ImmutableWorkerInfo} to run the task if one is available. */ Optional findWorkerForTask( final WorkerTaskRunnerConfig config, diff --git a/indexing-service/src/test/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfigTest.java b/indexing-service/src/test/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfigTest.java index 73fb9742184..5b311761468 100644 --- a/indexing-service/src/test/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfigTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfigTest.java @@ -26,6 +26,7 @@ import com.google.inject.Binder; import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.Module; +import com.google.inject.ProvisionException; import com.google.inject.name.Names; import io.druid.guice.GuiceInjectors; import io.druid.guice.IndexingServiceModuleHelper; @@ -144,19 +145,19 @@ public class ForkingTaskRunnerConfigTest ); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testExceptionalJavaOptArray() throws JsonProcessingException { buildFromProperties(ForkingTaskRunnerConfig.JAVA_OPTS_ARRAY_PROPERTY, "not an array"); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testExceptionalJavaOpt() throws JsonProcessingException { buildFromProperties(ForkingTaskRunnerConfig.JAVA_OPTS_PROPERTY, "[\"not a string\"]"); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testExceptionalJavaOpt2() throws JsonProcessingException { buildFromProperties(ForkingTaskRunnerConfig.JAVA_OPTS_PROPERTY, "{\"not a string\":\"someVal\"}"); diff --git a/integration-tests/src/main/java/org/testng/TestNG.java b/integration-tests/src/main/java/org/testng/TestNG.java index 170382b4e32..9535883b772 100644 --- a/integration-tests/src/main/java/org/testng/TestNG.java +++ b/integration-tests/src/main/java/org/testng/TestNG.java @@ -283,7 +283,7 @@ public class TestNG * * @see org.testng.reporters.TestHTMLReporter * @see org.testng.reporters.JUnitXMLReporter - * @see org.testng.reporters.XMLReporter + * @see XMLReporter */ public void setUseDefaultListeners(boolean useDefaultListeners) { @@ -701,7 +701,7 @@ public class TestNG * * @param suites * - * @see org.testng.xml.XmlSuite + * @see XmlSuite */ public void setXmlSuites(List suites) { @@ -2116,7 +2116,7 @@ public class TestNG } /** - * @see org.testng.IConfigurationListener#onConfigurationFailure(org.testng.ITestResult) + * @see IConfigurationListener#onConfigurationFailure(ITestResult) */ @Override public void onConfigurationFailure(ITestResult itr) @@ -2125,7 +2125,7 @@ public class TestNG } /** - * @see org.testng.IConfigurationListener#onConfigurationSkip(org.testng.ITestResult) + * @see IConfigurationListener#onConfigurationSkip(ITestResult) */ @Override public void onConfigurationSkip(ITestResult itr) @@ -2134,7 +2134,7 @@ public class TestNG } /** - * @see org.testng.IConfigurationListener#onConfigurationSuccess(org.testng.ITestResult) + * @see IConfigurationListener#onConfigurationSuccess(ITestResult) */ @Override public void onConfigurationSuccess(ITestResult itr) diff --git a/java-util/src/main/java/io/druid/java/util/common/CompressionUtils.java b/java-util/src/main/java/io/druid/java/util/common/CompressionUtils.java index eb4360da0f2..a031ed06891 100644 --- a/java-util/src/main/java/io/druid/java/util/common/CompressionUtils.java +++ b/java-util/src/main/java/io/druid/java/util/common/CompressionUtils.java @@ -489,7 +489,7 @@ public class CompressionUtils * * @return fname without the ".gz" extension * - * @throws io.druid.java.util.common.IAE if fname is not a valid "*.gz" file name + * @throws IAE if fname is not a valid "*.gz" file name */ public static String getGzBaseName(String fname) { diff --git a/java-util/src/main/java/io/druid/java/util/common/FileUtils.java b/java-util/src/main/java/io/druid/java/util/common/FileUtils.java index a79cb13f8a6..72be3a57e18 100644 --- a/java-util/src/main/java/io/druid/java/util/common/FileUtils.java +++ b/java-util/src/main/java/io/druid/java/util/common/FileUtils.java @@ -54,7 +54,7 @@ public class FileUtils * @param shouldRetry Predicate indicating if an error is recoverable and should be retried. * @param maxAttempts The maximum number of assumed recoverable attempts to try before completely failing. * - * @throws java.lang.RuntimeException wrapping the inner exception on failure. + * @throws RuntimeException wrapping the inner exception on failure. */ public static FileCopyResult retryCopy( final ByteSource byteSource, @@ -135,7 +135,7 @@ public class FileUtils /** * Fully maps a file read-only in to memory as per - * {@link FileChannel#map(java.nio.channels.FileChannel.MapMode, long, long)}. + * {@link FileChannel#map(FileChannel.MapMode, long, long)}. * *

Files are mapped from offset 0 to its length. * diff --git a/java-util/src/test/java/io/druid/java/util/common/CompressionUtilsTest.java b/java-util/src/test/java/io/druid/java/util/common/CompressionUtilsTest.java index f43c50e2f76..27cc850abf3 100644 --- a/java-util/src/test/java/io/druid/java/util/common/CompressionUtilsTest.java +++ b/java-util/src/test/java/io/druid/java/util/common/CompressionUtilsTest.java @@ -308,7 +308,7 @@ public class CompressionUtilsTest } // If this ever passes, er... fails to fail... then the bug is fixed - @Test(expected = java.lang.AssertionError.class) + @Test(expected = AssertionError.class) // http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7036144 public void testGunzipBug() throws IOException { diff --git a/java-util/src/test/java/io/druid/java/util/common/StringUtilsTest.java b/java-util/src/test/java/io/druid/java/util/common/StringUtilsTest.java index 2ba4875ee9a..30cea273b72 100644 --- a/java-util/src/test/java/io/druid/java/util/common/StringUtilsTest.java +++ b/java-util/src/test/java/io/druid/java/util/common/StringUtilsTest.java @@ -23,6 +23,7 @@ import junit.framework.Assert; import org.junit.Test; import java.io.UnsupportedEncodingException; +import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; /** @@ -70,7 +71,7 @@ public class StringUtilsTest } - @Test(expected = java.nio.BufferUnderflowException.class) + @Test(expected = BufferUnderflowException.class) public void testOutOfBounds() { ByteBuffer bytes = ByteBuffer.wrap(new byte[]{'a', 'b', 'c', 'd'}); @@ -78,13 +79,13 @@ public class StringUtilsTest StringUtils.fromUtf8(bytes, 3); } - @Test(expected = java.lang.NullPointerException.class) + @Test(expected = NullPointerException.class) public void testNullPointerByteBuffer() { StringUtils.fromUtf8((ByteBuffer) null); } - @Test(expected = java.lang.NullPointerException.class) + @Test(expected = NullPointerException.class) public void testNullPointerByteArray() { StringUtils.fromUtf8((byte[]) null); diff --git a/java-util/src/test/java/io/druid/java/util/common/parsers/JavaScriptParserTest.java b/java-util/src/test/java/io/druid/java/util/common/parsers/JavaScriptParserTest.java index dd9099ec026..a0bf7d6346e 100644 --- a/java-util/src/test/java/io/druid/java/util/common/parsers/JavaScriptParserTest.java +++ b/java-util/src/test/java/io/druid/java/util/common/parsers/JavaScriptParserTest.java @@ -23,6 +23,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import junit.framework.Assert; import org.junit.Test; +import org.mozilla.javascript.EvaluatorException; import java.util.Map; @@ -71,7 +72,7 @@ public class JavaScriptParserTest ); } - @Test(expected = org.mozilla.javascript.EvaluatorException.class) + @Test(expected = EvaluatorException.class) public void testFailure() { final String function = "i am bad javascript"; diff --git a/pom.xml b/pom.xml index 4405e7f9b41..52b59b26d57 100644 --- a/pom.xml +++ b/pom.xml @@ -890,6 +890,29 @@ + + org.apache.maven.plugins + maven-pmd-plugin + 3.8 + + true + + /rulesets/java/imports.xml + + + target/generated-sources/ + + + + + validate + validate + + check + + + + org.codehaus.mojo animal-sniffer-maven-plugin diff --git a/processing/src/main/java/io/druid/query/BitmapResultFactory.java b/processing/src/main/java/io/druid/query/BitmapResultFactory.java index 2eade4ef782..13235f9bed8 100644 --- a/processing/src/main/java/io/druid/query/BitmapResultFactory.java +++ b/processing/src/main/java/io/druid/query/BitmapResultFactory.java @@ -24,9 +24,9 @@ import io.druid.collections.bitmap.ImmutableBitmap; /** * BitmapResultFactory is an abstraction that allows to record something along with preFilter bitmap construction, and - * emit this information as dimension(s) of query metrics. BitmapResultFactory is similar to {@link - * io.druid.collections.bitmap.BitmapFactory}: it has the same methods with the exception that it accepts generic type - * T (bitmap wrapper type) instead of {@link ImmutableBitmap}. + * emit this information as dimension(s) of query metrics. BitmapResultFactory is similar to {@link BitmapFactory}: it + * has the same methods with the exception that it accepts generic type T (bitmap wrapper type) instead of {@link + * ImmutableBitmap}. * * {@link DefaultBitmapResultFactory} is a no-op implementation, where "wrapper" type is {@code ImmutableBitmap} itself. * diff --git a/processing/src/main/java/io/druid/query/Druids.java b/processing/src/main/java/io/druid/query/Druids.java index da81fa9a80a..0c942a7a3cc 100644 --- a/processing/src/main/java/io/druid/query/Druids.java +++ b/processing/src/main/java/io/druid/query/Druids.java @@ -325,7 +325,7 @@ public class Druids * .build(); * * - * @see io.druid.query.timeseries.TimeseriesQuery + * @see TimeseriesQuery */ public static class TimeseriesQueryBuilder { @@ -544,7 +544,7 @@ public class Druids * .build(); * * - * @see io.druid.query.search.search.SearchQuery + * @see SearchQuery */ public static class SearchQueryBuilder { @@ -766,7 +766,7 @@ public class Druids * .build(); * * - * @see io.druid.query.timeboundary.TimeBoundaryQuery + * @see TimeBoundaryQuery */ public static class TimeBoundaryQueryBuilder { @@ -951,7 +951,7 @@ public class Druids * .build(); * * - * @see io.druid.query.metadata.metadata.SegmentMetadataQuery + * @see SegmentMetadataQuery */ public static class SegmentMetadataQueryBuilder { @@ -1091,7 +1091,7 @@ public class Druids * .build(); * * - * @see io.druid.query.select.SelectQuery + * @see SelectQuery */ public static class SelectQueryBuilder { @@ -1281,7 +1281,7 @@ public class Druids * .build(); * * - * @see io.druid.query.datasourcemetadata.DataSourceMetadataQuery + * @see DataSourceMetadataQuery */ public static class DataSourceMetadataQueryBuilder { diff --git a/processing/src/main/java/io/druid/query/extraction/ExtractionFn.java b/processing/src/main/java/io/druid/query/extraction/ExtractionFn.java index 4518a4cf8ef..3a8820a4e5b 100644 --- a/processing/src/main/java/io/druid/query/extraction/ExtractionFn.java +++ b/processing/src/main/java/io/druid/query/extraction/ExtractionFn.java @@ -116,8 +116,7 @@ public interface ExtractionFn * modified into another unique value. In the `MANY_TO_ONE` case, there is no longer a 1:1 relation between old dimension * value and new dimension value * - * @return {@link io.druid.query.extraction.ExtractionFn.ExtractionType} declaring what kind of manipulation this - * function does + * @return {@link ExtractionFn.ExtractionType} declaring what kind of manipulation this function does */ public ExtractionType getExtractionType(); diff --git a/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java b/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java index 3741f40f9a8..c60e6b022bc 100644 --- a/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java @@ -29,7 +29,7 @@ import io.druid.query.extraction.ExtractionFn; import java.nio.ByteBuffer; /** - * This class is deprecated, use SelectorDimFilter instead: {@link io.druid.query.filter.SelectorDimFilter} + * This class is deprecated, use SelectorDimFilter instead: {@link SelectorDimFilter} */ @Deprecated public class ExtractionDimFilter implements DimFilter diff --git a/processing/src/main/java/io/druid/query/topn/TopNQueryBuilder.java b/processing/src/main/java/io/druid/query/topn/TopNQueryBuilder.java index 4a06a486f39..1821a502687 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNQueryBuilder.java +++ b/processing/src/main/java/io/druid/query/topn/TopNQueryBuilder.java @@ -61,7 +61,7 @@ import java.util.Map; * .build(); * * - * @see io.druid.query.topn.TopNQuery + * @see TopNQuery */ public class TopNQueryBuilder { diff --git a/processing/src/main/java/io/druid/query/topn/TopNQueryMetrics.java b/processing/src/main/java/io/druid/query/topn/TopNQueryMetrics.java index aedb47d6eeb..6a70b8dcf44 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNQueryMetrics.java +++ b/processing/src/main/java/io/druid/query/topn/TopNQueryMetrics.java @@ -23,8 +23,6 @@ import io.druid.query.QueryMetrics; import io.druid.segment.ColumnValueSelector; import io.druid.segment.Cursor; -import java.util.List; - /** * Specialization of {@link QueryMetrics} for {@link TopNQuery}. */ @@ -74,7 +72,7 @@ public interface TopNQueryMetrics extends QueryMetrics /** * Called with the number of rows, processed via each cursor, processed for the query within the segment. The total * number of processed rows, reported via this method for a TopNQueryMetrics instance, is smaller or equal to - * {@link #reportPreFilteredRows(long)}, because {@link #postFilters(List)} are additionally applied. If there + * {@link #reportPreFilteredRows(long)}, because {@link #postFilters} are additionally applied. If there * are no postFilters, preFilteredRows and processedRows are equal. */ TopNQueryMetrics addProcessedRows(long numRows); diff --git a/processing/src/main/java/io/druid/segment/IndexMerger.java b/processing/src/main/java/io/druid/segment/IndexMerger.java index 88b33b381be..0be3ba8b2e8 100644 --- a/processing/src/main/java/io/druid/segment/IndexMerger.java +++ b/processing/src/main/java/io/druid/segment/IndexMerger.java @@ -167,7 +167,7 @@ public interface IndexMerger * * @return the index output directory * - * @throws java.io.IOException if an IO error occurs persisting the index + * @throws IOException if an IO error occurs persisting the index */ File persist(IncrementalIndex index, Interval dataInterval, File outDir, IndexSpec indexSpec) throws IOException; diff --git a/processing/src/main/java/io/druid/segment/QueryableIndex.java b/processing/src/main/java/io/druid/segment/QueryableIndex.java index 52a5b3c1765..ee50675f4b8 100644 --- a/processing/src/main/java/io/druid/segment/QueryableIndex.java +++ b/processing/src/main/java/io/druid/segment/QueryableIndex.java @@ -40,7 +40,7 @@ public interface QueryableIndex extends ColumnSelector, Closeable /** * The close method shouldn't actually be here as this is nasty. We will adjust it in the future. - * @throws java.io.IOException if an exception was thrown closing the index + * @throws IOException if an exception was thrown closing the index */ //@Deprecated // This is still required for SimpleQueryableIndex. It should not go away unitl SimpleQueryableIndex is fixed @Override diff --git a/processing/src/main/java/io/druid/segment/data/CompressionFactory.java b/processing/src/main/java/io/druid/segment/data/CompressionFactory.java index a84a77bb61f..7792a71d4cc 100644 --- a/processing/src/main/java/io/druid/segment/data/CompressionFactory.java +++ b/processing/src/main/java/io/druid/segment/data/CompressionFactory.java @@ -34,7 +34,7 @@ import java.nio.ByteOrder; import java.util.Map; /** - * Compression of metrics is done by using a combination of {@link io.druid.segment.data.CompressedObjectStrategy.CompressionStrategy} + * Compression of metrics is done by using a combination of {@link CompressedObjectStrategy.CompressionStrategy} * and Encoding(such as {@link LongEncodingStrategy} for type Long). CompressionStrategy is unaware of the data type * and is based on byte operations. It must compress and decompress in block of bytes. Encoding refers to compression * method relies on data format, so a different set of Encodings exist for each data type. diff --git a/processing/src/test/java/io/druid/guice/GuiceInjectorsTest.java b/processing/src/test/java/io/druid/guice/GuiceInjectorsTest.java index 10352d14293..6be450b11b5 100644 --- a/processing/src/test/java/io/druid/guice/GuiceInjectorsTest.java +++ b/processing/src/test/java/io/druid/guice/GuiceInjectorsTest.java @@ -22,6 +22,7 @@ package io.druid.guice; import com.fasterxml.jackson.annotation.JacksonInject; import com.google.inject.Binder; import com.google.inject.Guice; +import com.google.inject.Inject; import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.Provider; @@ -68,7 +69,7 @@ public class GuiceInjectorsTest private Emitter emitter; private Injector injector; - @com.google.inject.Inject + @Inject public void configure(Injector injector) { this.injector = injector; emitter = injector.getInstance(Emitter.class); diff --git a/processing/src/test/java/io/druid/query/extraction/StringFormatExtractionFnTest.java b/processing/src/test/java/io/druid/query/extraction/StringFormatExtractionFnTest.java index d6f52fc8582..f82c07feb2f 100644 --- a/processing/src/test/java/io/druid/query/extraction/StringFormatExtractionFnTest.java +++ b/processing/src/test/java/io/druid/query/extraction/StringFormatExtractionFnTest.java @@ -25,6 +25,8 @@ import io.druid.jackson.DefaultObjectMapper; import org.junit.Assert; import org.junit.Test; +import java.io.IOException; + /** * */ @@ -85,7 +87,7 @@ public class StringFormatExtractionFnTest return new StringFormatExtractionFn(format, StringFormatExtractionFn.NullHandling.forValue(nullHandling)); } - private void validateSerde(String json) throws java.io.IOException + private void validateSerde(String json) throws IOException { final ObjectMapper objectMapper = new DefaultObjectMapper(); StringFormatExtractionFn extractionFn = (StringFormatExtractionFn) objectMapper.readValue(json, ExtractionFn.class); diff --git a/processing/src/test/java/io/druid/query/spec/SpecificSegmentQueryRunnerTest.java b/processing/src/test/java/io/druid/query/spec/SpecificSegmentQueryRunnerTest.java index 26adab13fb8..76564445abc 100644 --- a/processing/src/test/java/io/druid/query/spec/SpecificSegmentQueryRunnerTest.java +++ b/processing/src/test/java/io/druid/query/spec/SpecificSegmentQueryRunnerTest.java @@ -48,6 +48,7 @@ import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; +import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Map; @@ -202,7 +203,7 @@ public class SpecificSegmentQueryRunnerTest } private void validate(ObjectMapper mapper, SegmentDescriptor descriptor, Map responseContext) - throws java.io.IOException + throws IOException { Object missingSegments = responseContext.get(Result.MISSING_SEGMENTS_KEY); diff --git a/processing/src/test/java/io/druid/segment/MergeIntIteratorTest.java b/processing/src/test/java/io/druid/segment/MergeIntIteratorTest.java index 9c0562ff7ff..41b7fa8a4e1 100644 --- a/processing/src/test/java/io/druid/segment/MergeIntIteratorTest.java +++ b/processing/src/test/java/io/druid/segment/MergeIntIteratorTest.java @@ -71,7 +71,7 @@ public class MergeIntIteratorTest } /** - * Check for some possible corner cases, because {@link io.druid.segment.IntIteratorUtils.MergeIntIterator} is + * Check for some possible corner cases, because {@link IntIteratorUtils.MergeIntIterator} is * implemented using packing ints within longs, that is prone to some overflow or sign bit extension bugs */ @Test diff --git a/server/src/main/java/io/druid/client/HttpServerInventoryView.java b/server/src/main/java/io/druid/client/HttpServerInventoryView.java index 06e3009d3ef..68c7cac3d71 100644 --- a/server/src/main/java/io/druid/client/HttpServerInventoryView.java +++ b/server/src/main/java/io/druid/client/HttpServerInventoryView.java @@ -288,7 +288,7 @@ public class HttpServerInventoryView implements ServerInventoryView, FilteredSer { synchronized (servers) { return Iterables.transform( - servers.values(), new com.google.common.base.Function() + servers.values(), new Function() { @Override public DruidServer apply(DruidServerHolder input) diff --git a/server/src/main/java/io/druid/curator/discovery/CuratorServiceUtils.java b/server/src/main/java/io/druid/curator/discovery/CuratorServiceUtils.java index 21b8d42411d..225111b1f5a 100644 --- a/server/src/main/java/io/druid/curator/discovery/CuratorServiceUtils.java +++ b/server/src/main/java/io/druid/curator/discovery/CuratorServiceUtils.java @@ -30,8 +30,8 @@ public class CuratorServiceUtils * Mapping the actual service name to the name used within curator should be left to {@link CuratorServiceAnnouncer} * and {@link ServerDiscoveryFactory} * - * @see io.druid.curator.discovery.CuratorServiceAnnouncer - * @see io.druid.curator.discovery.ServerDiscoveryFactory + * @see CuratorServiceAnnouncer + * @see ServerDiscoveryFactory * * @param serviceName * @return diff --git a/server/src/main/java/io/druid/guice/LocalDataStorageDruidModule.java b/server/src/main/java/io/druid/guice/LocalDataStorageDruidModule.java index 3d5afaba111..e96c1046507 100644 --- a/server/src/main/java/io/druid/guice/LocalDataStorageDruidModule.java +++ b/server/src/main/java/io/druid/guice/LocalDataStorageDruidModule.java @@ -20,6 +20,7 @@ package io.druid.guice; import com.fasterxml.jackson.core.Version; +import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Key; @@ -96,10 +97,10 @@ public class LocalDataStorageDruidModule implements DruidModule } @Override - public List getJacksonModules() + public List getJacksonModules() { return ImmutableList.of( - new com.fasterxml.jackson.databind.Module() + new Module() { @Override public String getModuleName() diff --git a/server/src/main/java/io/druid/guice/ServerModule.java b/server/src/main/java/io/druid/guice/ServerModule.java index 44c5f73b289..b787092953a 100644 --- a/server/src/main/java/io/druid/guice/ServerModule.java +++ b/server/src/main/java/io/druid/guice/ServerModule.java @@ -19,6 +19,7 @@ package io.druid.guice; +import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.jsontype.NamedType; import com.fasterxml.jackson.databind.module.SimpleModule; import com.google.inject.Binder; @@ -58,7 +59,7 @@ public class ServerModule implements DruidModule } @Override - public List getJacksonModules() + public List getJacksonModules() { return Collections.singletonList( new SimpleModule() diff --git a/server/src/main/java/io/druid/initialization/Initialization.java b/server/src/main/java/io/druid/initialization/Initialization.java index 843b5c4e345..6c92dac3c8c 100644 --- a/server/src/main/java/io/druid/initialization/Initialization.java +++ b/server/src/main/java/io/druid/initialization/Initialization.java @@ -122,8 +122,8 @@ public class Initialization /** * Look for implementations for the given class from both classpath and extensions directory, using {@link - * java.util.ServiceLoader}. A user should never put the same two extensions in classpath and extensions directory, if - * he/she does that, the one that is in the classpath will be loaded, the other will be ignored. + * ServiceLoader}. A user should never put the same two extensions in classpath and extensions directory, if he/she + * does that, the one that is in the classpath will be loaded, the other will be ignored. * * @param config Extensions configuration * @param serviceClass The class to look the implementations of (e.g., DruidModule) diff --git a/server/src/main/java/io/druid/segment/realtime/firehose/EventReceiverFirehoseFactory.java b/server/src/main/java/io/druid/segment/realtime/firehose/EventReceiverFirehoseFactory.java index 1cf9911c7c2..6e462f6b309 100644 --- a/server/src/main/java/io/druid/segment/realtime/firehose/EventReceiverFirehoseFactory.java +++ b/server/src/main/java/io/druid/segment/realtime/firehose/EventReceiverFirehoseFactory.java @@ -68,8 +68,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; /** - * Builds firehoses that accept events through the {@link io.druid.segment.realtime.firehose.EventReceiver} interface. Can also register these - * firehoses with an {@link io.druid.segment.realtime.firehose.ServiceAnnouncingChatHandlerProvider}. + * Builds firehoses that accept events through the {@link EventReceiver} interface. Can also register these + * firehoses with an {@link ServiceAnnouncingChatHandlerProvider}. */ public class EventReceiverFirehoseFactory implements FirehoseFactory { diff --git a/server/src/main/java/io/druid/server/listener/announcer/ListenerDiscoverer.java b/server/src/main/java/io/druid/server/listener/announcer/ListenerDiscoverer.java index e32669e1fe1..63243c14a7a 100644 --- a/server/src/main/java/io/druid/server/listener/announcer/ListenerDiscoverer.java +++ b/server/src/main/java/io/druid/server/listener/announcer/ListenerDiscoverer.java @@ -109,7 +109,7 @@ public class ListenerDiscoverer try { children = cf.getChildren().forPath(zkPath); } - catch (org.apache.zookeeper.KeeperException.NoNodeException e) { + catch (KeeperException.NoNodeException e) { LOG.debug(e, "No path found at [%s]", zkPath); return ImmutableMap.of(); } diff --git a/server/src/test/java/io/druid/client/cache/CacheConfigTest.java b/server/src/test/java/io/druid/client/cache/CacheConfigTest.java index 1da321851d0..cd143816777 100644 --- a/server/src/test/java/io/druid/client/cache/CacheConfigTest.java +++ b/server/src/test/java/io/druid/client/cache/CacheConfigTest.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Injector; +import com.google.inject.ProvisionException; import io.druid.guice.GuiceInjectors; import io.druid.guice.JsonConfigProvider; import io.druid.guice.JsonConfigurator; @@ -105,7 +106,7 @@ public class CacheConfigTest Assert.assertEquals(false, config.isUseCache()); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testValidationError() { properties.put(propertyPrefix + ".numBackgroundThreads", "-1"); @@ -116,7 +117,7 @@ public class CacheConfigTest } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testValidationInsaneError() { properties.put(propertyPrefix + ".numBackgroundThreads", "BABBA YAGA"); @@ -125,7 +126,7 @@ public class CacheConfigTest throw new IllegalStateException("Should have already failed"); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testTRUE() { properties.put(propertyPrefix + ".populateCache", "TRUE"); @@ -134,7 +135,7 @@ public class CacheConfigTest throw new IllegalStateException("Should have already failed"); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testFALSE() { properties.put(propertyPrefix + ".populateCache", "FALSE"); @@ -144,7 +145,7 @@ public class CacheConfigTest } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testFaLse() { properties.put(propertyPrefix + ".populateCache", "FaLse"); diff --git a/server/src/test/java/io/druid/client/selector/TierSelectorStrategyTest.java b/server/src/test/java/io/druid/client/selector/TierSelectorStrategyTest.java index 6787b79c307..0fb821ca0e1 100644 --- a/server/src/test/java/io/druid/client/selector/TierSelectorStrategyTest.java +++ b/server/src/test/java/io/druid/client/selector/TierSelectorStrategyTest.java @@ -20,6 +20,7 @@ package io.druid.client.selector; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import io.druid.client.DirectDruidClient; import io.druid.client.DruidServer; import io.druid.server.coordination.DruidServerMetadata; @@ -119,7 +120,7 @@ public class TierSelectorStrategyTest "test", new Interval("2013-01-01/2013-01-02"), new DateTime("2013-01-01").toString(), - com.google.common.collect.Maps.newHashMap(), + Maps.newHashMap(), Lists.newArrayList(), Lists.newArrayList(), NoneShardSpec.instance(), diff --git a/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java b/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java index 4cb6899c7a1..9acd78599bd 100644 --- a/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java +++ b/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java @@ -23,6 +23,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Maps; import com.google.common.primitives.Ints; import io.druid.concurrent.Execs; +import io.druid.curator.CuratorTestBase; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.api.CuratorEvent; import org.apache.curator.framework.api.CuratorEventType; @@ -40,7 +41,7 @@ import java.util.concurrent.ExecutorService; /** */ -public class CuratorInventoryManagerTest extends io.druid.curator.CuratorTestBase +public class CuratorInventoryManagerTest extends CuratorTestBase { private ExecutorService exec; diff --git a/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java b/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java index 40965203838..60b5ffd28b8 100644 --- a/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java +++ b/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java @@ -52,6 +52,7 @@ import io.druid.server.initialization.jetty.JettyServerInitializer; import io.druid.server.log.RequestLogger; import io.druid.server.metrics.NoopServiceEmitter; import io.druid.server.router.QueryHostFinder; +import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.HandlerList; @@ -225,7 +226,7 @@ public class AsyncQueryForwardingServletTest extends BaseJettyTest jsonMapper, injector.getInstance(Key.get(ObjectMapper.class, Smile.class)), hostFinder, - injector.getProvider(org.eclipse.jetty.client.HttpClient.class), + injector.getProvider(HttpClient.class), injector.getInstance(DruidHttpClientConfig.class), new NoopServiceEmitter(), new RequestLogger() diff --git a/server/src/test/java/io/druid/server/QueryResourceTest.java b/server/src/test/java/io/druid/server/QueryResourceTest.java index 3a4573f7cc9..f3d6a6c10e5 100644 --- a/server/src/test/java/io/druid/server/QueryResourceTest.java +++ b/server/src/test/java/io/druid/server/QueryResourceTest.java @@ -24,6 +24,7 @@ import com.google.common.base.Throwables; import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; +import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceEmitter; import io.druid.concurrent.Execs; import io.druid.jackson.DefaultObjectMapper; @@ -120,7 +121,7 @@ public class QueryResourceTest @BeforeClass public static void staticSetup() { - com.metamx.emitter.EmittingLogger.registerEmitter(noopServiceEmitter); + EmittingLogger.registerEmitter(noopServiceEmitter); } @Before diff --git a/server/src/test/java/io/druid/server/log/LoggingRequestLoggerTest.java b/server/src/test/java/io/druid/server/log/LoggingRequestLoggerTest.java index 18e330fcb02..aa8f8a51cac 100644 --- a/server/src/test/java/io/druid/server/log/LoggingRequestLoggerTest.java +++ b/server/src/test/java/io/druid/server/log/LoggingRequestLoggerTest.java @@ -37,6 +37,7 @@ import io.druid.server.QueryStats; import io.druid.server.RequestLogLine; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.Appender; +import org.apache.logging.log4j.core.Logger; import org.apache.logging.log4j.core.appender.OutputStreamAppender; import org.apache.logging.log4j.core.layout.JsonLayout; import org.joda.time.DateTime; @@ -98,7 +99,7 @@ public class LoggingRequestLoggerTest .setTarget(baos) .setLayout(JsonLayout.createLayout(false, true, false, true, true, Charsets.UTF_8)) .build(); - final org.apache.logging.log4j.core.Logger logger = (org.apache.logging.log4j.core.Logger) + final Logger logger = (Logger) LogManager.getLogger(LoggingRequestLogger.class); appender.start(); logger.addAppender(appender); @@ -113,7 +114,7 @@ public class LoggingRequestLoggerTest @AfterClass public static void tearDownStatic() { - final org.apache.logging.log4j.core.Logger logger = (org.apache.logging.log4j.core.Logger) LogManager.getLogger( + final Logger logger = (Logger) LogManager.getLogger( LoggingRequestLogger.class); logger.removeAppender(appender); appender.stop(); diff --git a/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerTest.java b/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerTest.java index e2fad952dcc..7194bce4c69 100644 --- a/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerTest.java +++ b/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerTest.java @@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.net.HostAndPort; import com.google.common.util.concurrent.SettableFuture; +import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.core.Event; import com.metamx.emitter.core.LoggingEmitter; import com.metamx.emitter.service.ServiceEmitter; @@ -129,7 +130,7 @@ public class LookupCoordinatorManagerTest super.emit(event); } }; - com.metamx.emitter.EmittingLogger.registerEmitter(SERVICE_EMITTER); + EmittingLogger.registerEmitter(SERVICE_EMITTER); } @Before diff --git a/sql/src/main/java/io/druid/sql/calcite/rel/QueryMaker.java b/sql/src/main/java/io/druid/sql/calcite/rel/QueryMaker.java index 4e6f091dd2c..c7a59b12513 100644 --- a/sql/src/main/java/io/druid/sql/calcite/rel/QueryMaker.java +++ b/sql/src/main/java/io/druid/sql/calcite/rel/QueryMaker.java @@ -27,6 +27,7 @@ import com.google.common.primitives.Doubles; import com.google.common.primitives.Ints; import io.druid.client.DirectDruidClient; import io.druid.common.guava.GuavaUtils; +import io.druid.data.input.Row; import io.druid.java.util.common.ISE; import io.druid.java.util.common.guava.Sequence; import io.druid.java.util.common.guava.Sequences; @@ -355,10 +356,10 @@ public class QueryMaker walker, DirectDruidClient.makeResponseContextForQuery(query, plannerContext.getQueryStartTimeMillis()) ), - new Function() + new Function() { @Override - public Object[] apply(final io.druid.data.input.Row row) + public Object[] apply(final Row row) { final Object[] retVal = new Object[fieldList.size()]; for (RelDataTypeField field : fieldList) {