HBASE-19987 error-prone 2.2.0

This commit is contained in:
Mike Drob 2018-02-12 17:13:32 -06:00
parent 37d91cdfbb
commit 641e870e11
14 changed files with 19 additions and 4 deletions

View File

@ -37,6 +37,12 @@
<artifactId>error_prone_annotation</artifactId>
<version>${error-prone.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<!--mvn dependency:analyze says this is not used but compile fails

View File

@ -30,7 +30,7 @@ import com.sun.source.tree.CompilationUnitTree;
category = BugPattern.Category.JDK,
summary = "A placeholder rule that never matches.",
severity = BugPattern.SeverityLevel.ERROR,
suppressibility = BugPattern.Suppressibility.UNSUPPRESSIBLE,
suppressionAnnotations = {},
linkType = BugPattern.LinkType.NONE)
public class AlwaysPasses extends BugChecker implements BugChecker.CompilationUnitTreeMatcher {
@Override

View File

@ -448,7 +448,7 @@ public class ServerLoad implements ServerMetrics {
.collect(Collectors.toMap(Map.Entry::getKey, e -> new RegionLoad(e.getValue()),
(v1, v2) -> {
throw new RuntimeException("key collisions?");
}, () -> new TreeMap(Bytes.BYTES_COMPARATOR)));
}, () -> new TreeMap<>(Bytes.BYTES_COMPARATOR)));
}
/**

View File

@ -118,7 +118,7 @@ public abstract class Mutation extends OperationWithAttributes implements Row, C
.collect(Collectors.toMap(e -> e.getKey(), e -> new ArrayList<>(e.getValue()),
(k, v) -> {
throw new RuntimeException("collisions!!!");
}, () -> new TreeMap(Bytes.BYTES_COMPARATOR)));
}, () -> new TreeMap<>(Bytes.BYTES_COMPARATOR)));
}
/**

View File

@ -36,6 +36,7 @@ import org.apache.yetus.audience.InterfaceAudience;
* A BigDecimal comparator which numerical compares against the specified byte array
*/
@InterfaceAudience.Public
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public class BigDecimalComparator extends ByteArrayComparable {
private BigDecimal bigDecimal;

View File

@ -36,6 +36,7 @@ import org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferExce
* @since 2.0.0
*/
@InterfaceAudience.Public
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public class BinaryComparator extends org.apache.hadoop.hbase.filter.ByteArrayComparable {
/**
* Constructor

View File

@ -36,6 +36,7 @@ import org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferExce
* {@link BinaryComparator}.
*/
@InterfaceAudience.Public
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public class BinaryPrefixComparator extends ByteArrayComparable {
/**

View File

@ -33,6 +33,7 @@ import org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferExce
* with the specified byte array. Then returns whether the result is non-zero.
*/
@InterfaceAudience.Public
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public class BitComparator extends ByteArrayComparable {
/** Bit operators. */

View File

@ -34,6 +34,7 @@ import org.apache.hadoop.hbase.util.Bytes;
* A long comparator which numerical compares against the specified byte array
*/
@InterfaceAudience.Public
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public class LongComparator extends ByteArrayComparable {
private long longValue;

View File

@ -32,6 +32,7 @@ import org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferExce
* byte array using {@link org.apache.hadoop.hbase.util.Bytes#compareTo(byte[], byte[])}.
*/
@InterfaceAudience.Public
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public class NullComparator extends ByteArrayComparable {
public NullComparator() {

View File

@ -69,6 +69,7 @@ import org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferExce
* @see java.util.regex.Pattern
*/
@InterfaceAudience.Public
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public class RegexStringComparator extends ByteArrayComparable {
private static final Logger LOG = LoggerFactory.getLogger(RegexStringComparator.class);

View File

@ -43,6 +43,7 @@ import org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferExce
* </pre>
*/
@InterfaceAudience.Public
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public class SubstringComparator extends ByteArrayComparable {
private String substr;

View File

@ -32,6 +32,7 @@ import org.apache.yetus.audience.InterfaceAudience;
// adding special compareTo methods. We have to clean it. Deprecate this class and replace it
// with a more generic one which says it compares bytes (not necessary a byte array only)
// BytesComparable implements Comparable<Byte> will work?
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public abstract class ByteArrayComparable implements Comparable<byte[]> {
byte[] value;

View File

@ -1464,7 +1464,7 @@
<buildnumber.maven.version>1.4</buildnumber.maven.version>
<checkstyle.version>6.18</checkstyle.version>
<exec.maven.version>1.6.0</exec.maven.version>
<error-prone.version>2.1.1</error-prone.version>
<error-prone.version>2.2.0</error-prone.version>
<findbugs-annotations>1.3.9-1</findbugs-annotations>
<findbugs.maven.version>3.0.4</findbugs.maven.version>
<jamon.plugin.version>2.4.2</jamon.plugin.version>