From dd05c70b70ec83e71f8749c76c59b17ad21cdc8e Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Thu, 9 Nov 2017 12:08:01 -0800 Subject: [PATCH] HBASE-12350 Backport error-prone build support to branch-1 --- hbase-error-prone/pom.xml | 68 ++++++++++++++++++++++ .../hadoop/hbase/errorprone/AlwaysPasses.java | 44 ++++++++++++++ pom.xml | 65 ++++++++++++++++++++- 3 files changed, 175 insertions(+), 2 deletions(-) create mode 100644 hbase-error-prone/pom.xml create mode 100644 hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java diff --git a/hbase-error-prone/pom.xml b/hbase-error-prone/pom.xml new file mode 100644 index 0000000000..48442644df --- /dev/null +++ b/hbase-error-prone/pom.xml @@ -0,0 +1,68 @@ + + + + 4.0.0 + + hbase + org.apache.hbase + 1.5.0-SNAPSHOT + .. + + hbase-error-prone + 1.5.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.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 + + + diff --git a/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java b/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java new file mode 100644 index 0000000000..5778f2df8e --- /dev/null +++ b/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java @@ -0,0 +1,44 @@ +/** + * + * 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.fixes.Fix; +import com.google.errorprone.fixes.SuggestedFix; +import com.google.errorprone.matchers.Description; +import com.google.errorprone.matchers.Matcher; +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.tree.ImportTree; + +@AutoService(BugChecker.class) +@BugPattern(name = "AlwaysPasses", + category = BugPattern.Category.JDK, + summary = "A placeholder rule that never matches.", + severity = BugPattern.SeverityLevel.ERROR, + suppressibility = BugPattern.Suppressibility.UNSUPPRESSIBLE, + linkType = BugPattern.LinkType.NONE) +public class AlwaysPasses extends BugChecker implements BugChecker.CompilationUnitTreeMatcher { + @Override + public Description matchCompilationUnit(CompilationUnitTree tree, VisitorState state) { + return Description.NO_MATCH; + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 83a0ae5814..f1c629889c 100644 --- a/pom.xml +++ b/pom.xml @@ -485,7 +485,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.5.1 + ${maven.compiler.version} ${compileSource} ${compileSource} @@ -1288,13 +1288,16 @@ 1.46 1.0.0-RC2 + 2.1.1 2.4 1.6 + 3.6.1 2.4.1 1.3.9-1 6.18 2.10.3 1.5.3 + 2.8.2 3.1.0-RC1 3.0.1 3.0.0-M1 @@ -1372,6 +1375,11 @@ org.apache.hbase + hbase-error-prone + ${project.version} + + + org.apache.hbase hbase-common ${project.version} @@ -2510,8 +2518,8 @@ - + @@ -2698,6 +2706,59 @@ + + + errorProne + + false + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compiler.version} + + javac-with-errorprone + true + true + + -XepDisableWarningsInGeneratedCode + -Xep:FallThrough:OFF + + + + org.apache.hbase + hbase-error-prone + ${project.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} + + + + + + + -- 2.13.4