From c144c814b0ddd82a194f56f7836bd1dc8d06c353 Mon Sep 17 00:00:00 2001 From: Kevin Risden Date: Fri, 15 Mar 2019 15:04:30 -0400 Subject: [PATCH] HBASE-21895 - Error prone upgrade * Upgrades to error prone 2.3.3 * Moves to error prone plugin to support 9+ JDKs * Removes custom error prone plugin due to no usage Signed-off-by: zhangduo --- hbase-build-configuration/pom.xml | 65 ++++++++------ hbase-build-support/hbase-error-prone/pom.xml | 86 ------------------- .../hadoop/hbase/errorprone/AlwaysPasses.java | 40 --------- hbase-build-support/pom.xml | 78 ----------------- ...TestMultiTableSnapshotInputFormatImpl.java | 5 ++ .../hbase/procedure2/util/DelayedUtil.java | 5 ++ hbase-protocol-shaded/pom.xml | 2 - .../hbase/client/TestMultipleTimestamps.java | 1 - pom.xml | 9 +- 9 files changed, 48 insertions(+), 243 deletions(-) delete mode 100644 hbase-build-support/hbase-error-prone/pom.xml delete mode 100644 hbase-build-support/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java delete mode 100644 hbase-build-support/pom.xml diff --git a/hbase-build-configuration/pom.xml b/hbase-build-configuration/pom.xml index a617083e486..044022778b8 100644 --- a/hbase-build-configuration/pom.xml +++ b/hbase-build-configuration/pom.xml @@ -68,6 +68,31 @@ false + + + + 9+181-r4173-1 + + + + com.google.errorprone + error_prone_core + ${error-prone.version} + provided + + + com.google.code.findbugs + jsr305 + + + + + com.google.errorprone + javac + ${javac.version} + provided + + @@ -76,42 +101,26 @@ maven-compiler-plugin ${maven.compiler.version} - javac-with-errorprone - true + ${compileSource} + ${compileSource} + + true true - -XepDisableWarningsInGeneratedCode - -Xep:FallThrough:OFF - -Xep:ClassNewInstance:ERROR - -Xep:MissingDefault:ERROR + -XDcompilePolicy=simple + + -Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode -Xep:FallThrough:OFF -Xep:ClassNewInstance:ERROR -Xep:MissingDefault:ERROR + + -J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar - org.apache.hbase - hbase-error-prone - ${project.version} + com.google.errorprone + error_prone_core + ${error-prone.version} - - - org.codehaus.plexus - plexus-compiler-javac-errorprone - ${plexus.errorprone.javac.version} - - - - com.google.errorprone - error_prone_core - ${error-prone.version} - - - org.apache.hbase - hbase-error-prone - ${project.version} - - diff --git a/hbase-build-support/hbase-error-prone/pom.xml b/hbase-build-support/hbase-error-prone/pom.xml deleted file mode 100644 index 161ed24383b..00000000000 --- a/hbase-build-support/hbase-error-prone/pom.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - 4.0.0 - - hbase-build-support - org.apache.hbase - 3.0.0-SNAPSHOT - .. - - hbase-error-prone - 3.0.0-SNAPSHOT - Apache HBase - Error Prone Rules - Module to hold error prone custom rules for HBase. - - - - com.google.errorprone - error_prone_annotation - ${error-prone.version} - provided - - - com.google.guava - guava - - - - - - com.google.auto.service - auto-service - 1.0-rc3 - true - - - com.google.errorprone - error_prone_check_api - ${error-prone.version} - provided - - - com.google.code.findbugs - jsr305 - - - - - com.google.errorprone - javac - 9-dev-r4023-3 - provided - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - true - - - - - \ No newline at end of file diff --git a/hbase-build-support/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java b/hbase-build-support/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java deleted file mode 100644 index 9962835758b..00000000000 --- a/hbase-build-support/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.hadoop.hbase.errorprone; - -import com.google.auto.service.AutoService; -import com.google.errorprone.BugPattern; -import com.google.errorprone.VisitorState; -import com.google.errorprone.bugpatterns.BugChecker; -import com.google.errorprone.matchers.Description; -import com.sun.source.tree.CompilationUnitTree; - -@AutoService(BugChecker.class) -@BugPattern(name = "AlwaysPasses", - category = BugPattern.Category.JDK, - summary = "A placeholder rule that never matches.", - severity = BugPattern.SeverityLevel.ERROR, - suppressionAnnotations = {}, - linkType = BugPattern.LinkType.NONE) -public class AlwaysPasses extends BugChecker implements BugChecker.CompilationUnitTreeMatcher { - @Override - public Description matchCompilationUnit(CompilationUnitTree tree, VisitorState state) { - return Description.NO_MATCH; - } -} diff --git a/hbase-build-support/pom.xml b/hbase-build-support/pom.xml deleted file mode 100644 index f13c3f18814..00000000000 --- a/hbase-build-support/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - 4.0.0 - - hbase - org.apache.hbase - 3.0.0-SNAPSHOT - .. - - - hbase-build-support - Apache HBase - Build Support - Parent module for build-support artifacts - - pom - - - true - - true - - true - - - hbase-error-prone - - - - - - - org.codehaus.mojo - findbugs-maven-plugin - - ${project.basedir}/../../dev-support/findbugs-exclude.xml - - - - - maven-assembly-plugin - - true - - - - - - - - maven-assembly-plugin - - true - - - - - diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormatImpl.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormatImpl.java index 685e5194e36..9fec1b57b5c 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormatImpl.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormatImpl.java @@ -133,6 +133,11 @@ public class TestMultiTableSnapshotInputFormatImpl { .equals(this.stopRow, otherScan.stopRow); } + @Override + public int hashCode() { + return Objects.hash(startRow, stopRow); + } + @Override public String toString() { return org.apache.hbase.thirdparty.com.google.common.base.MoreObjects. diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/util/DelayedUtil.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/util/DelayedUtil.java index 009f421cb2d..471e0569b5a 100644 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/util/DelayedUtil.java +++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/util/DelayedUtil.java @@ -64,6 +64,11 @@ public final class DelayedUtil { return this == other; } + @Override + public int hashCode() { + return Objects.hash(this); + } + @Override public String toString() { return getClass().getSimpleName() + "(POISON)"; diff --git a/hbase-protocol-shaded/pom.xml b/hbase-protocol-shaded/pom.xml index f5a1cabe804..2d4a7b3e102 100644 --- a/hbase-protocol-shaded/pom.xml +++ b/hbase-protocol-shaded/pom.xml @@ -169,10 +169,8 @@ org.apache.hbase.thirdparty:* com.google.protobuf:protobuf-java com.google.code.findbugs:* - com.google.errorprone:error_prone_annotations com.google.j2objc:j2objc-annotations org.codehaus.mojo:animal-sniffer-annotations - org.codehaus.mojo:animal-sniffer-annotations junit:junit log4j:log4j commons-logging:commons-logging diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java index ac6b9d12c13..116aa9bf75b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java @@ -448,7 +448,6 @@ public class TestMultipleTimestamps { Integer[] rowIndexes, Integer[] columnIndexes, Long[] versions, int maxVersions) throws IOException { - Arrays.asList(rowIndexes); byte startRow[] = Bytes.toBytes("row:" + Collections.min( Arrays.asList(rowIndexes))); byte endRow[] = Bytes.toBytes("row:" + diff --git a/pom.xml b/pom.xml index f408fc48774..d3b9fd30a15 100755 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,6 @@ - hbase-build-support hbase-build-configuration hbase-replication hbase-mapreduce @@ -1568,7 +1567,7 @@ 1.4 8.11 1.6.0 - 2.2.0 + 2.3.3 1.3.9-1 3.0.4 2.4.2 @@ -1580,7 +1579,6 @@ 2.10 1.1.0 1.5.0.Final - 2.8.2 3.1.11 2.12 1.0.1 @@ -1664,11 +1662,6 @@ org.apache.hbase ${project.version} - - org.apache.hbase - hbase-error-prone - ${project.version} - org.apache.hbase hbase-common