diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml index 7fc46723915..b78f19828c4 100644 --- a/hbase-client/pom.xml +++ b/hbase-client/pom.xml @@ -247,8 +247,8 @@ - com.google.code.findbugs - jsr305 + com.github.stephenc.findbugs + findbugs-annotations true @@ -259,10 +259,6 @@ org.apache.hadoop hadoop-common - - com.github.stephenc.findbugs - findbugs-annotations - net.java.dev.jets3t jets3t diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java index 3d40c70505a..a5dbc941457 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java @@ -17,8 +17,6 @@ */ package org.apache.hadoop.hbase; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.io.Closeable; import java.io.IOException; import java.io.InterruptedIOException; @@ -34,6 +32,8 @@ import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; import com.google.common.annotations.VisibleForTesting; import com.google.protobuf.ServiceException; import org.apache.commons.logging.Log; @@ -795,10 +795,10 @@ public class MetaTableAccessor { * @return Get closest metatable region row to passed row * @throws java.io.IOException */ - @Nonnull + @NonNull public static HRegionInfo getClosestRegionInfo(Connection connection, - @Nonnull final TableName tableName, - @Nonnull final byte[] row) + @NonNull final TableName tableName, + @NonNull final byte[] row) throws IOException { byte[] searchRow = HRegionInfo.createRegionName(tableName, row, HConstants.NINES, false); Scan scan = getMetaScan(connection, 1); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java index bb5c996deb0..8dcda13f841 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java @@ -43,7 +43,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import javax.annotation.Nullable; +import edu.umd.cs.findbugs.annotations.Nullable; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java index 421907d965a..76b4ccf8f47 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java @@ -17,13 +17,13 @@ */ package org.apache.hadoop.hbase.protobuf; -import javax.annotation.Nullable; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import edu.umd.cs.findbugs.annotations.Nullable; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.Cell; diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseDecoder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseDecoder.java index 86f86789506..485b88a0e39 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseDecoder.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/codec/BaseDecoder.java @@ -22,8 +22,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.PushbackInputStream; -import javax.annotation.Nonnull; - +import edu.umd.cs.findbugs.annotations.NonNull; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.Cell; @@ -99,7 +98,7 @@ public abstract class BaseDecoder implements Codec.Decoder { * thrown if EOF is reached prematurely. Does not return null. * @throws IOException */ - @Nonnull + @NonNull protected abstract Cell parseCell() throws IOException; @Override diff --git a/hbase-rsgroup/pom.xml b/hbase-rsgroup/pom.xml index aff49b720d9..d216263f4f2 100644 --- a/hbase-rsgroup/pom.xml +++ b/hbase-rsgroup/pom.xml @@ -259,8 +259,8 @@ - com.google.code.findbugs - jsr305 + com.github.stephenc.findbugs + findbugs-annotations true @@ -271,10 +271,6 @@ org.apache.hadoop hadoop-common - - com.github.stephenc.findbugs - findbugs-annotations - net.java.dev.jets3t jets3t @@ -311,6 +307,10 @@ tomcat jasper-runtime + + com.google.code.findbugs + jsr305 + diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml index ff001b75fe2..6cf1bb69b88 100644 --- a/hbase-server/pom.xml +++ b/hbase-server/pom.xml @@ -430,8 +430,8 @@ - com.google.code.findbugs - jsr305 + com.github.stephenc.findbugs + findbugs-annotations true diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ObserverContext.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ObserverContext.java index d522ce9d03d..52f2b95a111 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ObserverContext.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ObserverContext.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.coprocessor; +import edu.umd.cs.findbugs.annotations.Nullable; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.CoprocessorEnvironment; @@ -26,8 +27,6 @@ import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.ipc.RpcServer; import org.apache.hadoop.hbase.security.User; -import javax.annotation.Nullable; - /** * Carries the execution state for a given invocation of an Observer coprocessor * ({@link RegionObserver}, {@link MasterObserver}, or {@link WALObserver}) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java index 5d6be9e808e..d7111c3a8bb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java @@ -18,10 +18,10 @@ */ package org.apache.hadoop.hbase.master; -import javax.annotation.Nullable; import java.util.List; import java.util.Map; +import edu.umd.cs.findbugs.annotations.Nullable; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.conf.ConfigurationObserver; import org.apache.hadoop.conf.Configurable; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableStateManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableStateManager.java index cc257d079e2..1499788a5e1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableStateManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableStateManager.java @@ -17,8 +17,6 @@ */ package org.apache.hadoop.hbase.master; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -27,6 +25,8 @@ import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; import com.google.common.collect.Sets; +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.HTableDescriptor; @@ -167,7 +167,7 @@ public class TableStateManager { return rv; } - @Nonnull + @NonNull public TableState.State getTableState(TableName tableName) throws IOException { TableState currentState = readMetaState(tableName); if (currentState == null) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java index d0aeb6c8a6b..1c59a44b2c6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java @@ -17,7 +17,6 @@ */ package org.apache.hadoop.hbase.util; -import javax.annotation.Nullable; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Comparator; @@ -30,6 +29,7 @@ import java.util.regex.Pattern; import com.google.common.annotations.VisibleForTesting; import com.google.common.primitives.Ints; +import edu.umd.cs.findbugs.annotations.Nullable; import org.apache.commons.lang.NotImplementedException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index a6dc59fe5f5..04afb014e35 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -47,8 +47,7 @@ import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import javax.annotation.Nullable; - +import edu.umd.cs.findbugs.annotations.Nullable; import org.apache.commons.lang.RandomStringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java index 8e87ceb243e..73e5abb5399 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java @@ -29,8 +29,7 @@ import java.util.Collection; import java.util.List; import java.util.concurrent.ExecutorService; -import javax.annotation.Nullable; - +import edu.umd.cs.findbugs.annotations.Nullable; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -459,4 +458,4 @@ public class TestMetaWithReplicas { hbck = doFsck(TEST_UTIL.getConfiguration(), false); assertErrors(hbck, new ERROR_CODE[]{}); } -} \ No newline at end of file +} diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java index 6285ca18997..19e7a18b83c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java @@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.mapreduce; import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.Multimaps; +import edu.umd.cs.findbugs.annotations.Nullable; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Scan; @@ -35,7 +36,6 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.experimental.categories.Category; -import javax.annotation.Nullable; import java.io.IOException; import java.util.Collection; import java.util.List; diff --git a/hbase-spark/pom.xml b/hbase-spark/pom.xml index 89ed18607ed..842ff21970e 100644 --- a/hbase-spark/pom.xml +++ b/hbase-spark/pom.xml @@ -62,6 +62,10 @@ ${scala.version} provided + org.apache.spark spark-core_${scala.binary.version} @@ -78,8 +82,19 @@ org.scala-lang scalap + + com.google.code.findbugs + jsr305 + + + com.google.code.findbugs + jsr305 + 1.3.9 + provided + true + org.apache.spark spark-sql_${scala.binary.version} @@ -181,6 +196,10 @@ io.netty netty + + com.google.code.findbugs + jsr305 + @@ -215,6 +234,10 @@ io.netty netty + + com.google.code.findbugs + jsr305 + @@ -646,6 +669,22 @@ + + + org.apache.maven.plugins + maven-enforcer-plugin + + + banned-jsr305 + + enforce + + + false + + + + diff --git a/pom.xml b/pom.xml index b116ae49c98..c4f1b0508fc 100644 --- a/pom.xml +++ b/pom.xml @@ -931,36 +931,52 @@ - - - - - [${maven.min.version},) - Maven is out of date. + + + min-maven-and-java + + enforce + + + + + + [${maven.min.version},) + Maven is out of date. HBase requires at least version ${maven.min.version} of Maven to properly build from source. You appear to be using an older version. You can use either "mvn -version" or "mvn enforcer:display-info" to verify what version is active. See the reference guide on building for more information: http://hbase.apache.org/book.html#build - - - - - [${java.min.version},) - Java is out of date. + + + + + [${java.min.version},) + Java is out of date. HBase requirs at least version ${java.min.version} of the JDK to properly build from source. You appear to be using an older version. You can use either "mvn -version" or "mvn enforcer:display-info" to verify what version is active. See the reference guide on building for more information: http://hbase.apache.org/book.html#build - - - - - + + + + + - enforce + banned-jsr305 enforce + + + + + com.google.code.findbugs:jsr305 + + We don't allow the JSR305 jar from the Findbugs project, see HBASE-16321. + + + @@ -1257,7 +1273,6 @@ 4.4.4 3.1.2 12.0.1 - 1.3.9 1.9.13 5.5.23 2.2.2 @@ -1507,6 +1522,12 @@ ${project.version} + + com.github.stephenc.findbugs + findbugs-annotations + ${findbugs-annotations} + + org.codehaus.jettison jettison @@ -1533,11 +1554,12 @@ com.google.guava guava ${guava.version} - - - com.google.code.findbugs - jsr305 - ${jsr305.version} + + + com.google.code.findbugs + jsr305 + + commons-collections @@ -1853,7 +1875,6 @@ com.github.stephenc.findbugs findbugs-annotations - ${findbugs-annotations} compile @@ -2213,6 +2234,10 @@ io.netty netty + + com.google.code.findbugs + jsr305 + @@ -2247,6 +2272,10 @@ io.netty netty + + com.google.code.findbugs + jsr305 + @@ -2387,6 +2416,10 @@ io.netty netty + + com.google.code.findbugs + jsr305 + @@ -2426,6 +2459,10 @@ io.netty netty + + com.google.code.findbugs + jsr305 + diff --git a/src/main/asciidoc/_chapters/developer.adoc b/src/main/asciidoc/_chapters/developer.adoc index 56aa5577f44..0a298649586 100644 --- a/src/main/asciidoc/_chapters/developer.adoc +++ b/src/main/asciidoc/_chapters/developer.adoc @@ -1591,7 +1591,9 @@ value="HE_EQUALS_USE_HASHCODE", justification="I know what I'm doing") ---- -It is important to use the Apache-licensed version of the annotations. +It is important to use the Apache-licensed version of the annotations. That generally means using +annotations in the `edu.umd.cs.findbugs.annotations` package so that we can rely on the cleanroom +reimplementation rather than annotations in the `javax.annotations` package. [[common.patch.feedback.javadoc.defaults]] ===== Javadoc - Useless Defaults