From 1d9158c04abf1f2d38bfafdb804216f8007756a3 Mon Sep 17 00:00:00 2001 From: zhangduo Date: Thu, 28 Mar 2019 13:29:27 +0800 Subject: [PATCH] HBASE-22099 Backport HBASE-21895 "Error prone upgrade" to branch-2 Signed-off-by: Michael Stack --- 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 | 30 +------ 9 files changed, 48 insertions(+), 264 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 7e6f3eecd73..459113cd1da 100644 --- a/hbase-build-configuration/pom.xml +++ b/hbase-build-configuration/pom.xml @@ -69,6 +69,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 @@ org.apache.maven.plugins maven-compiler-plugin - 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 4d853a63080..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 - 2.1.5-SNAPSHOT - .. - - hbase-error-prone - 2.1.5-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 - - - - - 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 5185a7e30ee..00000000000 --- a/hbase-build-support/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - 4.0.0 - - hbase - org.apache.hbase - 2.1.5-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 8f7b8f14622..fb053f964eb 100644 --- a/hbase-protocol-shaded/pom.xml +++ b/hbase-protocol-shaded/pom.xml @@ -167,10 +167,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 70341872c6a..bd10d5c9c5d 100755 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,6 @@ - hbase-build-support hbase-build-configuration hbase-replication hbase-mapreduce @@ -1431,7 +1430,7 @@ 1.4 8.11 1.6.0 - 2.2.0 + 2.3.3 1.3.9-1 3.0.4 2.4.2 @@ -1442,7 +1441,6 @@ 2.10 1.1.0 1.5.0.Final - 2.8.2 3.1.11 2.12 1.0.1 @@ -3470,32 +3468,6 @@ - - errorProne - - false - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - javac-with-errorprone - true - - - - org.codehaus.plexus - plexus-compiler-javac-errorprone - 2.5 - - - - - -