From 712f2a5d000c1362ddce4748842d190d55b826df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Wed, 16 Jun 2021 12:55:34 -0700 Subject: [PATCH] upgrade error-prone to 2.7.1 and support checks with Java 11+ (#11363) * upgrade error-prone to 2.7.1 and support checks with Java 11+ - upgrade error-prone to 2.7.1 - support running error-prone with Java 11 and above using -Xplugin instead of custom compiler - add compiler arguments to ignore warnings/errors in Java 15/16 - introduce strictCompile property to enable strict profiles since we now need multiple strict profiles for Java 8 - properly exclude all generated source files from error-prone - fix druid-processing overriding annotation processors from parent pom - fix druid-core disabling most non-default checks - align plugin and annotation errorprone versions - fix / suppress additional issues found by error-prone: * fix bug in SeekableStreamSupervisor initializing ArrayList size with the taskGroupdId * fix missing @Override annotations - remove outdated compiler plugin in benchmarks - remove deleted ParameterPackage error-prone rule - re-enable checks on benchmark module as well * fix IntelliJ inspections * disable LongFloatConversion due to bug in error-prone with JDK 8 * add comment about InsecureCrypto --- .travis.yml | 4 +- benchmarks/pom.xml | 10 - core/pom.xml | 20 -- .../apache/druid/crypto/CryptoService.java | 7 + .../math/expr/BinaryLogicalOperatorExpr.java | 8 +- .../math/expr/BinaryMathOperatorExpr.java | 6 + .../druid/math/expr/BinaryOperatorExpr.java | 2 + .../druid/math/expr/FunctionalExpr.java | 3 + .../druid/math/expr/UnaryOperatorExpr.java | 3 + .../common/parsers/TimestampParserTest.java | 4 +- .../lookup/LoadingLookupFactoryTest.java | 1 + .../lookup/PollingLookupSerDeserTest.java | 1 + .../server/lookup/PollingLookupTest.java | 1 + .../input/protobuf/ProtoTestEventWrapper.java | 228 ++++++++++-------- .../supervisor/SeekableStreamSupervisor.java | 2 +- licenses.yaml | 2 +- pom.xml | 129 ++++++---- processing/pom.xml | 6 +- .../druid/query/filter/InDimFilter.java | 3 +- .../groupby/orderby/DefaultLimitSpec.java | 2 +- .../apache/druid/query/scan/ScanQuery.java | 2 +- .../LookupExtractorFactoryContainerTest.java | 1 + .../appenderator/SinkQuerySegmentWalker.java | 6 +- .../server/coordinator/HttpLoadQueuePeon.java | 2 +- .../segment/loading/StorageLocationTest.java | 3 + 25 files changed, 256 insertions(+), 200 deletions(-) diff --git a/.travis.yml b/.travis.yml index b0accff55aa..2d2c304d91c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -114,8 +114,8 @@ jobs: install: skip # Strict compilation requires more than 2 GB script: > - ./check_test_suite.py && travis_terminate 0 || MAVEN_OPTS='-Xmx3000m' ${MVN} clean -Pstrict compile test-compile --fail-at-end - -pl '!benchmarks' ${MAVEN_SKIP} ${MAVEN_SKIP_TESTS} + ./check_test_suite.py && travis_terminate 0 || MAVEN_OPTS='-Xmx3000m' ${MVN} clean -DstrictCompile compile test-compile --fail-at-end + ${MAVEN_SKIP} ${MAVEN_SKIP_TESTS} - name: "analyze dependencies" script: |- diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index db7925c91c1..f5d894e7df9 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -192,16 +192,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - ${javac.target} - ${javac.target} - ${javac.target} - - org.apache.maven.plugins maven-assembly-plugin diff --git a/core/pom.xml b/core/pom.xml index 757012dcbd9..70ca83866ff 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -429,24 +429,4 @@ - - - - strict - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - -Xep:MissingOverride:WARN - - - - - - - diff --git a/core/src/main/java/org/apache/druid/crypto/CryptoService.java b/core/src/main/java/org/apache/druid/crypto/CryptoService.java index 306ae7038dc..cd4b3279636 100644 --- a/core/src/main/java/org/apache/druid/crypto/CryptoService.java +++ b/core/src/main/java/org/apache/druid/crypto/CryptoService.java @@ -113,6 +113,10 @@ public class CryptoService SecretKey tmp = getKeyFromPassword(passPhrase, salt); SecretKey secret = new SecretKeySpec(tmp.getEncoded(), cipherAlgName); + + // error-prone warns if the transformation is not a compile-time constant + // since it cannot check it for insecure combinations. + @SuppressWarnings("InsecureCryptoUsage") Cipher ecipher = Cipher.getInstance(transformation); ecipher.init(Cipher.ENCRYPT_MODE, secret); return new EncryptedData( @@ -134,6 +138,9 @@ public class CryptoService SecretKey tmp = getKeyFromPassword(passPhrase, encryptedData.getSalt()); SecretKey secret = new SecretKeySpec(tmp.getEncoded(), cipherAlgName); + // error-prone warns if the transformation is not a compile-time constant + // since it cannot check it for insecure combinations. + @SuppressWarnings("InsecureCryptoUsage") Cipher dcipher = Cipher.getInstance(transformation); dcipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(encryptedData.getIv())); return dcipher.doFinal(encryptedData.getCipher()); diff --git a/core/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java b/core/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java index 8ff150fdf04..12f1a8b0ee5 100644 --- a/core/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java +++ b/core/src/main/java/org/apache/druid/math/expr/BinaryLogicalOperatorExpr.java @@ -27,7 +27,7 @@ import javax.annotation.Nullable; import java.util.Objects; // logical operators live here - +@SuppressWarnings("ClassName") class BinLtExpr extends BinaryEvalOpExprBase { BinLtExpr(String op, Expr left, Expr right) @@ -84,6 +84,7 @@ class BinLtExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") class BinLeqExpr extends BinaryEvalOpExprBase { BinLeqExpr(String op, Expr left, Expr right) @@ -140,6 +141,7 @@ class BinLeqExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") class BinGtExpr extends BinaryEvalOpExprBase { BinGtExpr(String op, Expr left, Expr right) @@ -195,6 +197,7 @@ class BinGtExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") class BinGeqExpr extends BinaryEvalOpExprBase { BinGeqExpr(String op, Expr left, Expr right) @@ -251,6 +254,7 @@ class BinGeqExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") class BinEqExpr extends BinaryEvalOpExprBase { BinEqExpr(String op, Expr left, Expr right) @@ -306,6 +310,7 @@ class BinEqExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") class BinNeqExpr extends BinaryEvalOpExprBase { BinNeqExpr(String op, Expr left, Expr right) @@ -361,6 +366,7 @@ class BinNeqExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") class BinAndExpr extends BinaryOpExprBase { BinAndExpr(String op, Expr left, Expr right) diff --git a/core/src/main/java/org/apache/druid/math/expr/BinaryMathOperatorExpr.java b/core/src/main/java/org/apache/druid/math/expr/BinaryMathOperatorExpr.java index 384249bbeaa..14a613696c2 100644 --- a/core/src/main/java/org/apache/druid/math/expr/BinaryMathOperatorExpr.java +++ b/core/src/main/java/org/apache/druid/math/expr/BinaryMathOperatorExpr.java @@ -30,6 +30,7 @@ import javax.annotation.Nullable; // math operators live here +@SuppressWarnings("ClassName") final class BinPlusExpr extends BinaryEvalOpExprBase { BinPlusExpr(String op, Expr left, Expr right) @@ -81,6 +82,7 @@ final class BinPlusExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") final class BinMinusExpr extends BinaryEvalOpExprBase { BinMinusExpr(String op, Expr left, Expr right) @@ -119,6 +121,7 @@ final class BinMinusExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") final class BinMulExpr extends BinaryEvalOpExprBase { BinMulExpr(String op, Expr left, Expr right) @@ -157,6 +160,7 @@ final class BinMulExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") final class BinDivExpr extends BinaryEvalOpExprBase { BinDivExpr(String op, Expr left, Expr right) @@ -195,6 +199,7 @@ final class BinDivExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") class BinPowExpr extends BinaryEvalOpExprBase { BinPowExpr(String op, Expr left, Expr right) @@ -233,6 +238,7 @@ class BinPowExpr extends BinaryEvalOpExprBase } } +@SuppressWarnings("ClassName") class BinModuloExpr extends BinaryEvalOpExprBase { BinModuloExpr(String op, Expr left, Expr right) diff --git a/core/src/main/java/org/apache/druid/math/expr/BinaryOperatorExpr.java b/core/src/main/java/org/apache/druid/math/expr/BinaryOperatorExpr.java index 280d99b9d09..a8dd08bd682 100644 --- a/core/src/main/java/org/apache/druid/math/expr/BinaryOperatorExpr.java +++ b/core/src/main/java/org/apache/druid/math/expr/BinaryOperatorExpr.java @@ -33,6 +33,7 @@ import java.util.Objects; * Note: all concrete subclass of this should have constructor with the form of (String, Expr, Expr) * if it's not possible, just be sure Evals.binaryOp() can handle that */ +@SuppressWarnings("ClassName") abstract class BinaryOpExprBase implements Expr { protected final String op; @@ -112,6 +113,7 @@ abstract class BinaryOpExprBase implements Expr * Base class for numerical binary operators, with additional methods defined to evaluate primitive values directly * instead of wrapped with {@link ExprEval} */ +@SuppressWarnings("ClassName") abstract class BinaryEvalOpExprBase extends BinaryOpExprBase { BinaryEvalOpExprBase(String op, Expr left, Expr right) diff --git a/core/src/main/java/org/apache/druid/math/expr/FunctionalExpr.java b/core/src/main/java/org/apache/druid/math/expr/FunctionalExpr.java index 00f381b6456..5e164e1bc08 100644 --- a/core/src/main/java/org/apache/druid/math/expr/FunctionalExpr.java +++ b/core/src/main/java/org/apache/druid/math/expr/FunctionalExpr.java @@ -30,6 +30,7 @@ import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; +@SuppressWarnings("ClassName") class LambdaExpr implements Expr { private final ImmutableList args; @@ -150,6 +151,7 @@ class LambdaExpr implements Expr * list of arguments that are passed to the {@link Function} along with the {@link Expr.ObjectBinding} when it is * evaluated. */ +@SuppressWarnings("ClassName") class FunctionExpr implements Expr { final Function function; @@ -247,6 +249,7 @@ class FunctionExpr implements Expr * {@link LambdaExpr} and the list of {@link Expr} arguments that are combined with {@link Expr.ObjectBinding} to * evaluate the {@link LambdaExpr}. */ +@SuppressWarnings("ClassName") class ApplyFunctionExpr implements Expr { final ApplyFunction function; diff --git a/core/src/main/java/org/apache/druid/math/expr/UnaryOperatorExpr.java b/core/src/main/java/org/apache/druid/math/expr/UnaryOperatorExpr.java index 6993ed75c12..a0d16ebc7e0 100644 --- a/core/src/main/java/org/apache/druid/math/expr/UnaryOperatorExpr.java +++ b/core/src/main/java/org/apache/druid/math/expr/UnaryOperatorExpr.java @@ -32,6 +32,7 @@ import java.util.Objects; /** * Base type for all single argument operators, with a single {@link Expr} child for the operand. */ +@SuppressWarnings("ClassName") abstract class UnaryExpr implements Expr { final String op; @@ -102,6 +103,7 @@ abstract class UnaryExpr implements Expr } } +@SuppressWarnings("ClassName") class UnaryMinusExpr extends UnaryExpr { UnaryMinusExpr(String op, Expr expr) @@ -144,6 +146,7 @@ class UnaryMinusExpr extends UnaryExpr } } +@SuppressWarnings("ClassName") class UnaryNotExpr extends UnaryExpr { UnaryNotExpr(String op, Expr expr) diff --git a/core/src/test/java/org/apache/druid/java/util/common/parsers/TimestampParserTest.java b/core/src/test/java/org/apache/druid/java/util/common/parsers/TimestampParserTest.java index a5622d51511..d94ec8f0bcc 100644 --- a/core/src/test/java/org/apache/druid/java/util/common/parsers/TimestampParserTest.java +++ b/core/src/test/java/org/apache/druid/java/util/common/parsers/TimestampParserTest.java @@ -204,7 +204,7 @@ public class TimestampParserTest expectedDt, parser.apply(yearMonth)); // Friday, May 15, 2020 8:20:40 PM GMT - long millis = 1589574040000l; + long millis = 1589574040000L; expectedDt = DateTimes.of("2020-05-15T20:20:40.000Z"); parser = TimestampParser.createObjectTimestampParser("millis"); @@ -219,7 +219,7 @@ public class TimestampParserTest Assert.assertEquals("Timestamp of format posix not parsed correctly", expectedDt, parser.apply(posix)); - long micro = 1589574040000000l; + long micro = 1589574040000000L; parser = TimestampParser.createObjectTimestampParser("micro"); Assert.assertEquals("Timestamp of format micro not parsed correctly", expectedDt, parser.apply(micro)); diff --git a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupFactoryTest.java b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupFactoryTest.java index adda834f60b..be6acd56139 100644 --- a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupFactoryTest.java +++ b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupFactoryTest.java @@ -165,6 +165,7 @@ public class LoadingLookupFactoryTest } @Override + @SuppressWarnings("EqualsHashCode") public boolean equals(Object obj) { return obj instanceof MockDataFetcher; diff --git a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupSerDeserTest.java b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupSerDeserTest.java index eef78c0002d..fed973ad3af 100644 --- a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupSerDeserTest.java +++ b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupSerDeserTest.java @@ -103,6 +103,7 @@ public class PollingLookupSerDeserTest } @Override + @SuppressWarnings("EqualsHashCode") public boolean equals(Object obj) { return obj instanceof MockDataFetcher; diff --git a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java index 715100d359d..2aabe93ce22 100644 --- a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java +++ b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java @@ -102,6 +102,7 @@ public class PollingLookupTest extends InitializedNullHandlingTest } @Override + @SuppressWarnings("EqualsHashCode") public boolean equals(Object obj) { return obj instanceof MockDataFetcher; diff --git a/extensions-core/protobuf-extensions/src/test/java/org/apache/druid/data/input/protobuf/ProtoTestEventWrapper.java b/extensions-core/protobuf-extensions/src/test/java/org/apache/druid/data/input/protobuf/ProtoTestEventWrapper.java index 0b370c2d972..80c69877d71 100644 --- a/extensions-core/protobuf-extensions/src/test/java/org/apache/druid/data/input/protobuf/ProtoTestEventWrapper.java +++ b/extensions-core/protobuf-extensions/src/test/java/org/apache/druid/data/input/protobuf/ProtoTestEventWrapper.java @@ -410,6 +410,7 @@ public final class ProtoTestEventWrapper { public static final int CATEGORY_TWO_VALUE = 2; + @Override public final int getNumber() { return value; } @@ -444,15 +445,18 @@ public final class ProtoTestEventWrapper { private static final com.google.protobuf.Internal.EnumLiteMap< EventCategory> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + @Override public EventCategory findValueByNumber(int number) { return EventCategory.forNumber(number); } }; + @Override public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(ordinal()); } + @Override public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); @@ -519,14 +523,14 @@ public final class ProtoTestEventWrapper { bar_ = ""; } - @java.lang.Override + @Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new Foo(); } - @java.lang.Override + @Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -595,7 +599,7 @@ public final class ProtoTestEventWrapper { * required string bar = 1; * @return Whether the bar field is set. */ - @java.lang.Override + @Override public boolean hasBar() { return ((bitField0_ & 0x00000001) != 0); } @@ -603,7 +607,7 @@ public final class ProtoTestEventWrapper { * required string bar = 1; * @return The bar. */ - @java.lang.Override + @Override public java.lang.String getBar() { java.lang.Object ref = bar_; if (ref instanceof java.lang.String) { @@ -622,7 +626,7 @@ public final class ProtoTestEventWrapper { * required string bar = 1; * @return The bytes for bar. */ - @java.lang.Override + @Override public com.google.protobuf.ByteString getBarBytes() { java.lang.Object ref = bar_; @@ -652,7 +656,7 @@ public final class ProtoTestEventWrapper { return true; } - @java.lang.Override + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) != 0)) { @@ -661,7 +665,7 @@ public final class ProtoTestEventWrapper { unknownFields.writeTo(output); } - @java.lang.Override + @Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; @@ -675,7 +679,7 @@ public final class ProtoTestEventWrapper { return size; } - @java.lang.Override + @Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; @@ -694,7 +698,7 @@ public final class ProtoTestEventWrapper { return true; } - @java.lang.Override + @Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; @@ -835,7 +839,7 @@ public final class ProtoTestEventWrapper { .alwaysUseFieldBuilders) { } } - @java.lang.Override + @Override public Builder clear() { super.clear(); bar_ = ""; @@ -843,18 +847,18 @@ public final class ProtoTestEventWrapper { return this; } - @java.lang.Override + @Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_Foo_descriptor; } - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo getDefaultInstanceForType() { return org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo.getDefaultInstance(); } - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo build() { org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo result = buildPartial(); if (!result.isInitialized()) { @@ -863,7 +867,7 @@ public final class ProtoTestEventWrapper { return result; } - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo buildPartial() { org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo result = new org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo(this); int from_bitField0_ = bitField0_; @@ -877,39 +881,39 @@ public final class ProtoTestEventWrapper { return result; } - @java.lang.Override + @Override public Builder clone() { return super.clone(); } - @java.lang.Override + @Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } - @java.lang.Override + @Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } - @java.lang.Override + @Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } - @java.lang.Override + @Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } - @java.lang.Override + @Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } - @java.lang.Override + @Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo) { return mergeFrom((org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo)other); @@ -931,7 +935,7 @@ public final class ProtoTestEventWrapper { return this; } - @java.lang.Override + @Override public final boolean isInitialized() { if (!hasBar()) { return false; @@ -939,7 +943,7 @@ public final class ProtoTestEventWrapper { return true; } - @java.lang.Override + @Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -964,6 +968,7 @@ public final class ProtoTestEventWrapper { * required string bar = 1; * @return Whether the bar field is set. */ + @Override public boolean hasBar() { return ((bitField0_ & 0x00000001) != 0); } @@ -971,6 +976,7 @@ public final class ProtoTestEventWrapper { * required string bar = 1; * @return The bar. */ + @Override public java.lang.String getBar() { java.lang.Object ref = bar_; if (!(ref instanceof java.lang.String)) { @@ -989,6 +995,7 @@ public final class ProtoTestEventWrapper { * required string bar = 1; * @return The bytes for bar. */ + @Override public com.google.protobuf.ByteString getBarBytes() { java.lang.Object ref = bar_; @@ -1042,13 +1049,13 @@ public final class ProtoTestEventWrapper { onChanged(); return this; } - @java.lang.Override + @Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } - @java.lang.Override + @Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); @@ -1070,7 +1077,7 @@ public final class ProtoTestEventWrapper { @java.lang.Deprecated public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override + @Override public Foo parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1083,12 +1090,12 @@ public final class ProtoTestEventWrapper { return PARSER; } - @java.lang.Override + @Override public com.google.protobuf.Parser getParserForType() { return PARSER; } - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -1102,14 +1109,14 @@ public final class ProtoTestEventWrapper { * required .prototest.ProtoTestEvent.EventCategory eventType = 1; * @return Whether the eventType field is set. */ - @java.lang.Override public boolean hasEventType() { + @Override public boolean hasEventType() { return ((bitField0_ & 0x00000001) != 0); } /** * required .prototest.ProtoTestEvent.EventCategory eventType = 1; * @return The eventType. */ - @java.lang.Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.EventCategory getEventType() { + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.EventCategory getEventType() { @SuppressWarnings("deprecation") org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.EventCategory result = org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.valueOf(eventType_); return result == null ? org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.CATEGORY_ZERO : result; @@ -1121,7 +1128,7 @@ public final class ProtoTestEventWrapper { * required uint64 id = 2; * @return Whether the id field is set. */ - @java.lang.Override + @Override public boolean hasId() { return ((bitField0_ & 0x00000002) != 0); } @@ -1129,7 +1136,7 @@ public final class ProtoTestEventWrapper { * required uint64 id = 2; * @return The id. */ - @java.lang.Override + @Override public long getId() { return id_; } @@ -1140,7 +1147,7 @@ public final class ProtoTestEventWrapper { * required string timestamp = 3; * @return Whether the timestamp field is set. */ - @java.lang.Override + @Override public boolean hasTimestamp() { return ((bitField0_ & 0x00000004) != 0); } @@ -1148,7 +1155,7 @@ public final class ProtoTestEventWrapper { * required string timestamp = 3; * @return The timestamp. */ - @java.lang.Override + @Override public java.lang.String getTimestamp() { java.lang.Object ref = timestamp_; if (ref instanceof java.lang.String) { @@ -1167,7 +1174,7 @@ public final class ProtoTestEventWrapper { * required string timestamp = 3; * @return The bytes for timestamp. */ - @java.lang.Override + @Override public com.google.protobuf.ByteString getTimestampBytes() { java.lang.Object ref = timestamp_; @@ -1188,7 +1195,7 @@ public final class ProtoTestEventWrapper { * optional uint32 someOtherId = 4; * @return Whether the someOtherId field is set. */ - @java.lang.Override + @Override public boolean hasSomeOtherId() { return ((bitField0_ & 0x00000008) != 0); } @@ -1196,7 +1203,7 @@ public final class ProtoTestEventWrapper { * optional uint32 someOtherId = 4; * @return The someOtherId. */ - @java.lang.Override + @Override public int getSomeOtherId() { return someOtherId_; } @@ -1207,7 +1214,7 @@ public final class ProtoTestEventWrapper { * optional bool isValid = 5; * @return Whether the isValid field is set. */ - @java.lang.Override + @Override public boolean hasIsValid() { return ((bitField0_ & 0x00000010) != 0); } @@ -1215,7 +1222,7 @@ public final class ProtoTestEventWrapper { * optional bool isValid = 5; * @return The isValid. */ - @java.lang.Override + @Override public boolean getIsValid() { return isValid_; } @@ -1226,7 +1233,7 @@ public final class ProtoTestEventWrapper { * optional string description = 6; * @return Whether the description field is set. */ - @java.lang.Override + @Override public boolean hasDescription() { return ((bitField0_ & 0x00000020) != 0); } @@ -1234,7 +1241,7 @@ public final class ProtoTestEventWrapper { * optional string description = 6; * @return The description. */ - @java.lang.Override + @Override public java.lang.String getDescription() { java.lang.Object ref = description_; if (ref instanceof java.lang.String) { @@ -1253,7 +1260,7 @@ public final class ProtoTestEventWrapper { * optional string description = 6; * @return The bytes for description. */ - @java.lang.Override + @Override public com.google.protobuf.ByteString getDescriptionBytes() { java.lang.Object ref = description_; @@ -1274,7 +1281,7 @@ public final class ProtoTestEventWrapper { * optional float someFloatColumn = 7; * @return Whether the someFloatColumn field is set. */ - @java.lang.Override + @Override public boolean hasSomeFloatColumn() { return ((bitField0_ & 0x00000040) != 0); } @@ -1282,7 +1289,7 @@ public final class ProtoTestEventWrapper { * optional float someFloatColumn = 7; * @return The someFloatColumn. */ - @java.lang.Override + @Override public float getSomeFloatColumn() { return someFloatColumn_; } @@ -1293,7 +1300,7 @@ public final class ProtoTestEventWrapper { * optional uint32 someIntColumn = 8; * @return Whether the someIntColumn field is set. */ - @java.lang.Override + @Override public boolean hasSomeIntColumn() { return ((bitField0_ & 0x00000080) != 0); } @@ -1301,7 +1308,7 @@ public final class ProtoTestEventWrapper { * optional uint32 someIntColumn = 8; * @return The someIntColumn. */ - @java.lang.Override + @Override public int getSomeIntColumn() { return someIntColumn_; } @@ -1312,7 +1319,7 @@ public final class ProtoTestEventWrapper { * optional uint64 someLongColumn = 9; * @return Whether the someLongColumn field is set. */ - @java.lang.Override + @Override public boolean hasSomeLongColumn() { return ((bitField0_ & 0x00000100) != 0); } @@ -1320,7 +1327,7 @@ public final class ProtoTestEventWrapper { * optional uint64 someLongColumn = 9; * @return The someLongColumn. */ - @java.lang.Override + @Override public long getSomeLongColumn() { return someLongColumn_; } @@ -1331,7 +1338,7 @@ public final class ProtoTestEventWrapper { * optional .prototest.ProtoTestEvent.Foo foo = 10; * @return Whether the foo field is set. */ - @java.lang.Override + @Override public boolean hasFoo() { return ((bitField0_ & 0x00000200) != 0); } @@ -1339,14 +1346,14 @@ public final class ProtoTestEventWrapper { * optional .prototest.ProtoTestEvent.Foo foo = 10; * @return The foo. */ - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo getFoo() { return foo_ == null ? org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo.getDefaultInstance() : foo_; } /** * optional .prototest.ProtoTestEvent.Foo foo = 10; */ - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.FooOrBuilder getFooOrBuilder() { return foo_ == null ? org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo.getDefaultInstance() : foo_; } @@ -1356,14 +1363,14 @@ public final class ProtoTestEventWrapper { /** * repeated .prototest.ProtoTestEvent.Foo bar = 11; */ - @java.lang.Override + @Override public java.util.List getBarList() { return bar_; } /** * repeated .prototest.ProtoTestEvent.Foo bar = 11; */ - @java.lang.Override + @Override public java.util.List getBarOrBuilderList() { return bar_; @@ -1371,21 +1378,21 @@ public final class ProtoTestEventWrapper { /** * repeated .prototest.ProtoTestEvent.Foo bar = 11; */ - @java.lang.Override + @Override public int getBarCount() { return bar_.size(); } /** * repeated .prototest.ProtoTestEvent.Foo bar = 11; */ - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo getBar(int index) { return bar_.get(index); } /** * repeated .prototest.ProtoTestEvent.Foo bar = 11; */ - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.FooOrBuilder getBarOrBuilder( int index) { return bar_.get(index); @@ -1397,7 +1404,7 @@ public final class ProtoTestEventWrapper { * optional .google.protobuf.Timestamp otherTimestamp = 12; * @return Whether the otherTimestamp field is set. */ - @java.lang.Override + @Override public boolean hasOtherTimestamp() { return ((bitField0_ & 0x00000400) != 0); } @@ -1405,20 +1412,20 @@ public final class ProtoTestEventWrapper { * optional .google.protobuf.Timestamp otherTimestamp = 12; * @return The otherTimestamp. */ - @java.lang.Override + @Override public com.google.protobuf.Timestamp getOtherTimestamp() { return otherTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : otherTimestamp_; } /** * optional .google.protobuf.Timestamp otherTimestamp = 12; */ - @java.lang.Override + @Override public com.google.protobuf.TimestampOrBuilder getOtherTimestampOrBuilder() { return otherTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : otherTimestamp_; } private byte memoizedIsInitialized = -1; - @java.lang.Override + @Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -1452,7 +1459,7 @@ public final class ProtoTestEventWrapper { return true; } - @java.lang.Override + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) != 0)) { @@ -1494,7 +1501,7 @@ public final class ProtoTestEventWrapper { unknownFields.writeTo(output); } - @java.lang.Override + @Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; @@ -1551,7 +1558,7 @@ public final class ProtoTestEventWrapper { return size; } - @java.lang.Override + @Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; @@ -1622,7 +1629,7 @@ public final class ProtoTestEventWrapper { return true; } - @java.lang.Override + @Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; @@ -1756,7 +1763,7 @@ public final class ProtoTestEventWrapper { .parseWithIOException(PARSER, input, extensionRegistry); } - @java.lang.Override + @Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -1764,13 +1771,13 @@ public final class ProtoTestEventWrapper { public static Builder newBuilder(org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - @java.lang.Override + @Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - @java.lang.Override + @Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); @@ -1788,7 +1795,7 @@ public final class ProtoTestEventWrapper { return org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_descriptor; } - @java.lang.Override + @Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_fieldAccessorTable @@ -1814,7 +1821,7 @@ public final class ProtoTestEventWrapper { getOtherTimestampFieldBuilder(); } } - @java.lang.Override + @Override public Builder clear() { super.clear(); eventType_ = 0; @@ -1856,18 +1863,18 @@ public final class ProtoTestEventWrapper { return this; } - @java.lang.Override + @Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.internal_static_prototest_ProtoTestEvent_descriptor; } - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent getDefaultInstanceForType() { return org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.getDefaultInstance(); } - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent build() { org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent result = buildPartial(); if (!result.isInitialized()) { @@ -1876,7 +1883,7 @@ public final class ProtoTestEventWrapper { return result; } - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent buildPartial() { org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent result = new org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent(this); int from_bitField0_ = bitField0_; @@ -1947,39 +1954,39 @@ public final class ProtoTestEventWrapper { return result; } - @java.lang.Override + @Override public Builder clone() { return super.clone(); } - @java.lang.Override + @Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } - @java.lang.Override + @Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } - @java.lang.Override + @Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } - @java.lang.Override + @Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } - @java.lang.Override + @Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } - @java.lang.Override + @Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent) { return mergeFrom((org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent)other); @@ -2059,7 +2066,7 @@ public final class ProtoTestEventWrapper { return this; } - @java.lang.Override + @Override public final boolean isInitialized() { if (!hasEventType()) { return false; @@ -2083,7 +2090,7 @@ public final class ProtoTestEventWrapper { return true; } - @java.lang.Override + @Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2108,14 +2115,14 @@ public final class ProtoTestEventWrapper { * required .prototest.ProtoTestEvent.EventCategory eventType = 1; * @return Whether the eventType field is set. */ - @java.lang.Override public boolean hasEventType() { + @Override public boolean hasEventType() { return ((bitField0_ & 0x00000001) != 0); } /** * required .prototest.ProtoTestEvent.EventCategory eventType = 1; * @return The eventType. */ - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.EventCategory getEventType() { @SuppressWarnings("deprecation") org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.EventCategory result = org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.EventCategory.valueOf(eventType_); @@ -2151,7 +2158,7 @@ public final class ProtoTestEventWrapper { * required uint64 id = 2; * @return Whether the id field is set. */ - @java.lang.Override + @Override public boolean hasId() { return ((bitField0_ & 0x00000002) != 0); } @@ -2159,7 +2166,7 @@ public final class ProtoTestEventWrapper { * required uint64 id = 2; * @return The id. */ - @java.lang.Override + @Override public long getId() { return id_; } @@ -2190,6 +2197,7 @@ public final class ProtoTestEventWrapper { * required string timestamp = 3; * @return Whether the timestamp field is set. */ + @Override public boolean hasTimestamp() { return ((bitField0_ & 0x00000004) != 0); } @@ -2197,6 +2205,7 @@ public final class ProtoTestEventWrapper { * required string timestamp = 3; * @return The timestamp. */ + @Override public java.lang.String getTimestamp() { java.lang.Object ref = timestamp_; if (!(ref instanceof java.lang.String)) { @@ -2215,6 +2224,7 @@ public final class ProtoTestEventWrapper { * required string timestamp = 3; * @return The bytes for timestamp. */ + @Override public com.google.protobuf.ByteString getTimestampBytes() { java.lang.Object ref = timestamp_; @@ -2274,7 +2284,7 @@ public final class ProtoTestEventWrapper { * optional uint32 someOtherId = 4; * @return Whether the someOtherId field is set. */ - @java.lang.Override + @Override public boolean hasSomeOtherId() { return ((bitField0_ & 0x00000008) != 0); } @@ -2282,7 +2292,7 @@ public final class ProtoTestEventWrapper { * optional uint32 someOtherId = 4; * @return The someOtherId. */ - @java.lang.Override + @Override public int getSomeOtherId() { return someOtherId_; } @@ -2313,7 +2323,7 @@ public final class ProtoTestEventWrapper { * optional bool isValid = 5; * @return Whether the isValid field is set. */ - @java.lang.Override + @Override public boolean hasIsValid() { return ((bitField0_ & 0x00000010) != 0); } @@ -2321,7 +2331,7 @@ public final class ProtoTestEventWrapper { * optional bool isValid = 5; * @return The isValid. */ - @java.lang.Override + @Override public boolean getIsValid() { return isValid_; } @@ -2352,6 +2362,7 @@ public final class ProtoTestEventWrapper { * optional string description = 6; * @return Whether the description field is set. */ + @Override public boolean hasDescription() { return ((bitField0_ & 0x00000020) != 0); } @@ -2359,6 +2370,7 @@ public final class ProtoTestEventWrapper { * optional string description = 6; * @return The description. */ + @Override public java.lang.String getDescription() { java.lang.Object ref = description_; if (!(ref instanceof java.lang.String)) { @@ -2377,6 +2389,7 @@ public final class ProtoTestEventWrapper { * optional string description = 6; * @return The bytes for description. */ + @Override public com.google.protobuf.ByteString getDescriptionBytes() { java.lang.Object ref = description_; @@ -2436,7 +2449,7 @@ public final class ProtoTestEventWrapper { * optional float someFloatColumn = 7; * @return Whether the someFloatColumn field is set. */ - @java.lang.Override + @Override public boolean hasSomeFloatColumn() { return ((bitField0_ & 0x00000040) != 0); } @@ -2444,7 +2457,7 @@ public final class ProtoTestEventWrapper { * optional float someFloatColumn = 7; * @return The someFloatColumn. */ - @java.lang.Override + @Override public float getSomeFloatColumn() { return someFloatColumn_; } @@ -2475,7 +2488,7 @@ public final class ProtoTestEventWrapper { * optional uint32 someIntColumn = 8; * @return Whether the someIntColumn field is set. */ - @java.lang.Override + @Override public boolean hasSomeIntColumn() { return ((bitField0_ & 0x00000080) != 0); } @@ -2483,7 +2496,7 @@ public final class ProtoTestEventWrapper { * optional uint32 someIntColumn = 8; * @return The someIntColumn. */ - @java.lang.Override + @Override public int getSomeIntColumn() { return someIntColumn_; } @@ -2514,7 +2527,7 @@ public final class ProtoTestEventWrapper { * optional uint64 someLongColumn = 9; * @return Whether the someLongColumn field is set. */ - @java.lang.Override + @Override public boolean hasSomeLongColumn() { return ((bitField0_ & 0x00000100) != 0); } @@ -2522,7 +2535,7 @@ public final class ProtoTestEventWrapper { * optional uint64 someLongColumn = 9; * @return The someLongColumn. */ - @java.lang.Override + @Override public long getSomeLongColumn() { return someLongColumn_; } @@ -2555,6 +2568,7 @@ public final class ProtoTestEventWrapper { * optional .prototest.ProtoTestEvent.Foo foo = 10; * @return Whether the foo field is set. */ + @Override public boolean hasFoo() { return ((bitField0_ & 0x00000200) != 0); } @@ -2562,6 +2576,7 @@ public final class ProtoTestEventWrapper { * optional .prototest.ProtoTestEvent.Foo foo = 10; * @return The foo. */ + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo getFoo() { if (fooBuilder_ == null) { return foo_ == null ? org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo.getDefaultInstance() : foo_; @@ -2643,6 +2658,7 @@ public final class ProtoTestEventWrapper { /** * optional .prototest.ProtoTestEvent.Foo foo = 10; */ + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.FooOrBuilder getFooOrBuilder() { if (fooBuilder_ != null) { return fooBuilder_.getMessageOrBuilder(); @@ -2683,6 +2699,7 @@ public final class ProtoTestEventWrapper { /** * repeated .prototest.ProtoTestEvent.Foo bar = 11; */ + @Override public java.util.List getBarList() { if (barBuilder_ == null) { return java.util.Collections.unmodifiableList(bar_); @@ -2693,6 +2710,7 @@ public final class ProtoTestEventWrapper { /** * repeated .prototest.ProtoTestEvent.Foo bar = 11; */ + @Override public int getBarCount() { if (barBuilder_ == null) { return bar_.size(); @@ -2703,6 +2721,7 @@ public final class ProtoTestEventWrapper { /** * repeated .prototest.ProtoTestEvent.Foo bar = 11; */ + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.Foo getBar(int index) { if (barBuilder_ == null) { return bar_.get(index); @@ -2853,6 +2872,7 @@ public final class ProtoTestEventWrapper { /** * repeated .prototest.ProtoTestEvent.Foo bar = 11; */ + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent.FooOrBuilder getBarOrBuilder( int index) { if (barBuilder_ == null) { @@ -2863,7 +2883,8 @@ public final class ProtoTestEventWrapper { /** * repeated .prototest.ProtoTestEvent.Foo bar = 11; */ - public java.util.List + @Override + public java.util.List getBarOrBuilderList() { if (barBuilder_ != null) { return barBuilder_.getMessageOrBuilderList(); @@ -2915,6 +2936,7 @@ public final class ProtoTestEventWrapper { * optional .google.protobuf.Timestamp otherTimestamp = 12; * @return Whether the otherTimestamp field is set. */ + @Override public boolean hasOtherTimestamp() { return ((bitField0_ & 0x00000800) != 0); } @@ -2922,6 +2944,7 @@ public final class ProtoTestEventWrapper { * optional .google.protobuf.Timestamp otherTimestamp = 12; * @return The otherTimestamp. */ + @Override public com.google.protobuf.Timestamp getOtherTimestamp() { if (otherTimestampBuilder_ == null) { return otherTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : otherTimestamp_; @@ -3003,6 +3026,7 @@ public final class ProtoTestEventWrapper { /** * optional .google.protobuf.Timestamp otherTimestamp = 12; */ + @Override public com.google.protobuf.TimestampOrBuilder getOtherTimestampOrBuilder() { if (otherTimestampBuilder_ != null) { return otherTimestampBuilder_.getMessageOrBuilder(); @@ -3027,13 +3051,13 @@ public final class ProtoTestEventWrapper { } return otherTimestampBuilder_; } - @java.lang.Override + @Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } - @java.lang.Override + @Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); @@ -3055,7 +3079,7 @@ public final class ProtoTestEventWrapper { @java.lang.Deprecated public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override + @Override public ProtoTestEvent parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -3068,12 +3092,12 @@ public final class ProtoTestEventWrapper { return PARSER; } - @java.lang.Override + @Override public com.google.protobuf.Parser getParserForType() { return PARSER; } - @java.lang.Override + @Override public org.apache.druid.data.input.protobuf.ProtoTestEventWrapper.ProtoTestEvent getDefaultInstanceForType() { return DEFAULT_INSTANCE; } diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java b/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java index 11339d4f4ae..f593f7c68b4 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java @@ -2186,7 +2186,7 @@ public abstract class SeekableStreamSupervisor new ArrayList<>()).add(partitionId); } } diff --git a/licenses.yaml b/licenses.yaml index 87b8b76ac7e..6afc386119b 100644 --- a/licenses.yaml +++ b/licenses.yaml @@ -350,7 +350,7 @@ name: Error Prone Annotations license_category: binary module: java-core license_name: Apache License version 2.0 -version: 2.3.2 +version: 2.7.1 libraries: - com.google.errorprone: error_prone_annotations diff --git a/pom.xml b/pom.xml index 30220697fdf..70ce5cce53c 100644 --- a/pom.xml +++ b/pom.xml @@ -87,6 +87,7 @@ 1.3.0 10.14.2.0 4.0.0 + 2.7.1 8.5.4 16.0.1 4.1.0 @@ -420,7 +421,7 @@ com.google.errorprone error_prone_annotations - 2.3.2 + ${errorprone.version} com.ibm.icu @@ -1777,17 +1778,20 @@ - - + + strict + + + strictCompile + + org.apache.maven.plugins maven-compiler-plugin - javac-with-errorprone - true true 1024m 3000m @@ -1795,57 +1799,80 @@ ${maven.compiler.target} false - -XepDisableWarningsInGeneratedCode - - -Xep:ClassCanBeStatic:ERROR - -Xep:PreconditionsInvalidPlaceholder:ERROR - -Xep:MissingOverride:ERROR - -Xep:DefaultCharset:ERROR - -Xep:QualifierOrScopeOnInjectMethod:ERROR - - -Xep:AssistedInjectAndInjectOnSameConstructor - -Xep:AutoFactoryAtInject - -Xep:ClassName - -Xep:ComparisonContractViolated - -Xep:DepAnn - -Xep:DivZero - -Xep:EmptyIf - -Xep:InjectInvalidTargetingOnScopingAnnotation - -Xep:InjectMoreThanOneQualifier - -Xep:InjectScopeAnnotationOnInterfaceOrAbstractClass - -Xep:InjectScopeOrQualifierAnnotationRetention - -Xep:InjectedConstructorAnnotations - -Xep:InsecureCryptoUsage - -Xep:JMockTestWithoutRunWithOrRuleAnnotation - -Xep:JavaxInjectOnFinalField - -Xep:LockMethodChecker - -Xep:LongLiteralLowerCaseSuffix - -Xep:NoAllocation - -Xep:NonRuntimeAnnotation - -Xep:NumericEquality - -Xep:ParameterPackage - -Xep:ProtoStringFieldReferenceEquality - -Xep:UnlockMethod - + -XDcompilePolicy=simple + + -Xplugin:ErrorProne -XepExcludedPaths:.*/target/generated-(test-)?sources/.* -XepDisableWarningsInGeneratedCode -Xep:ClassCanBeStatic:ERROR -Xep:PreconditionsInvalidPlaceholder:ERROR -Xep:MissingOverride:ERROR -Xep:DefaultCharset:ERROR -Xep:QualifierOrScopeOnInjectMethod:ERROR -Xep:AssistedInjectAndInjectOnSameConstructor -Xep:AutoFactoryAtInject -Xep:ClassName -Xep:ComparisonContractViolated -Xep:DepAnn -Xep:DivZero -Xep:EmptyIf -Xep:InjectInvalidTargetingOnScopingAnnotation -Xep:InjectMoreThanOneQualifier -Xep:InjectScopeAnnotationOnInterfaceOrAbstractClass -Xep:InjectScopeOrQualifierAnnotationRetention -Xep:InjectedConstructorAnnotations -Xep:InsecureCryptoUsage -Xep:JMockTestWithoutRunWithOrRuleAnnotation -Xep:JavaxInjectOnFinalField -Xep:LockMethodChecker -Xep:LongLiteralLowerCaseSuffix -Xep:NoAllocation -Xep:NonRuntimeAnnotation -Xep:NumericEquality -Xep:ProtoStringFieldReferenceEquality -Xep:UnlockMethod -Xep:LongFloatConversion:OFF + + + + com.google.errorprone + error_prone_core + ${errorprone.version} + + - - - org.codehaus.plexus - plexus-compiler-javac-errorprone - 2.8.5 - - - - com.google.errorprone - error_prone_core - 2.3.2 - - + + strict-java-15+ + + [15,) + + strictCompile + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.version} + + + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + + + + + + + + + strict-java-8 + + 1.8 + + strictCompile + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + true + + -J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/9+181-r4173-1/javac-9+181-r4173-1.jar + + + + + + parallel-test diff --git a/processing/pom.xml b/processing/pom.xml index 646857eb97c..4f05d4f69ba 100644 --- a/processing/pom.xml +++ b/processing/pom.xml @@ -257,14 +257,16 @@ org.apache.maven.plugins maven-compiler-plugin - + + org.apache.druid druid-core ${project.parent.version} - + + org.apache.druid.annotations.SubclassesMustBePublicAnnotationProcessor diff --git a/processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java b/processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java index adba7f85935..0cae9809a8c 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java +++ b/processing/src/main/java/org/apache/druid/query/filter/InDimFilter.java @@ -526,6 +526,7 @@ public class InDimFilter extends AbstractOptimizableDimFilter implements Filter }; } + @SuppressWarnings("ReturnValueIgnored") private static Predicate createStringPredicate(final Set values) { Preconditions.checkNotNull(values, "values"); @@ -536,8 +537,6 @@ public class InDimFilter extends AbstractOptimizableDimFilter implements Filter // programmatically as a result of optimizations like rewriting inner joins as filters, the passed-in Set may // not be able to accept nulls. We don't want to copy the Sets (since they may be large) so instead we'll wrap // it in a null-checking lambda if needed. - - //noinspection ResultOfMethodCallIgnored values.contains(null); // Safe to do values.contains(null). diff --git a/processing/src/main/java/org/apache/druid/query/groupby/orderby/DefaultLimitSpec.java b/processing/src/main/java/org/apache/druid/query/groupby/orderby/DefaultLimitSpec.java index da6fea65cb9..a9fc3fe91b1 100644 --- a/processing/src/main/java/org/apache/druid/query/groupby/orderby/DefaultLimitSpec.java +++ b/processing/src/main/java/org/apache/druid/query/groupby/orderby/DefaultLimitSpec.java @@ -520,7 +520,7 @@ public class DefaultLimitSpec implements LimitSpec * This API works by "creative" use of equals. It requires warnings to be suppressed and also requires spotbugs * exclusions (see spotbugs-exclude.xml). */ - @SuppressWarnings("EqualsAndHashcode") + @SuppressWarnings({"EqualsAndHashcode", "EqualsHashCode"}) static class LimitJsonIncludeFilter // lgtm [java/inconsistent-equals-and-hashcode] { @Override diff --git a/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java b/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java index 067bdfff913..b339a899179 100644 --- a/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java +++ b/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java @@ -427,7 +427,7 @@ public class ScanQuery extends BaseQuery * This API works by "creative" use of equals. It requires warnings to be suppressed and also requires spotbugs * exclusions (see spotbugs-exclude.xml). */ - @SuppressWarnings({"EqualsAndHashcode"}) + @SuppressWarnings({"EqualsAndHashcode", "EqualsHashCode"}) static class ScanRowsLimitJsonIncludeFilter // lgtm [java/inconsistent-equals-and-hashcode] { @Override diff --git a/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainerTest.java b/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainerTest.java index 875af6a676b..500093fbd36 100644 --- a/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainerTest.java +++ b/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainerTest.java @@ -111,6 +111,7 @@ public class LookupExtractorFactoryContainerTest } @Override + @SuppressWarnings("EqualsHashCode") public boolean equals(Object other) { return other instanceof TestLookupExtractorFactory; diff --git a/server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java b/server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java index 783a327c00b..6097857cff8 100644 --- a/server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java +++ b/server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java @@ -152,9 +152,9 @@ public class SinkQuerySegmentWalker implements QuerySegmentWalker final DataSourceAnalysis analysis = DataSourceAnalysis.forDataSource(query.getDataSource()); // Sanity check: make sure the query is based on the table we're meant to handle. - analysis.getBaseTableDataSource() - .filter(ds -> dataSource.equals(ds.getName())) - .orElseThrow(() -> new ISE("Cannot handle datasource: %s", analysis.getDataSource())); + if (!analysis.getBaseTableDataSource().filter(ds -> dataSource.equals(ds.getName())).isPresent()) { + throw new ISE("Cannot handle datasource: %s", analysis.getDataSource()); + } final QueryRunnerFactory> factory = conglomerate.findFactory(query); if (factory == null) { diff --git a/server/src/main/java/org/apache/druid/server/coordinator/HttpLoadQueuePeon.java b/server/src/main/java/org/apache/druid/server/coordinator/HttpLoadQueuePeon.java index f00e5aaf075..4a171e51a13 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/HttpLoadQueuePeon.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/HttpLoadQueuePeon.java @@ -324,7 +324,7 @@ public class HttpLoadQueuePeon extends LoadQueuePeon ScheduledExecutors.scheduleAtFixedRate( processingExecutor, - new Duration(config.getHttpLoadQueuePeonRepeatDelay()), + config.getHttpLoadQueuePeonRepeatDelay(), () -> { if (!stopped) { doSegmentManagement(); diff --git a/server/src/test/java/org/apache/druid/segment/loading/StorageLocationTest.java b/server/src/test/java/org/apache/druid/segment/loading/StorageLocationTest.java index b50498b7a84..5048f7775d3 100644 --- a/server/src/test/java/org/apache/druid/segment/loading/StorageLocationTest.java +++ b/server/src/test/java/org/apache/druid/segment/loading/StorageLocationTest.java @@ -47,6 +47,7 @@ public class StorageLocationTest public TemporaryFolder temporaryFolder = new TemporaryFolder(); @Test + @SuppressWarnings("GuardedBy") public void testStorageLocationFreePercent() { // free space ignored only maxSize matters @@ -66,6 +67,7 @@ public class StorageLocationTest } @Test + @SuppressWarnings("GuardedBy") public void testStorageLocationRealFileSystem() throws IOException { File file = temporaryFolder.newFolder(); @@ -181,6 +183,7 @@ public class StorageLocationTest Assert.assertFalse(loc.release("testPath", 100L)); } + @SuppressWarnings("GuardedBy") private void verifyLoc(long maxSize, StorageLocation loc) { Assert.assertEquals(maxSize, loc.availableSizeBytes());