Skip to content

Commit

Permalink
HBASE-19987 error-prone 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
madrob committed Mar 7, 2018
1 parent 37d91cd commit 641e870
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 4 deletions.
6 changes: 6 additions & 0 deletions hbase-build-support/hbase-error-prone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ public Map<byte[], RegionLoad> getRegionsLoad() {
.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)));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected Mutation(Mutation clone) {
.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)));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* @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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* {@link BinaryComparator}.
*/
@InterfaceAudience.Public
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public class BinaryPrefixComparator extends ByteArrayComparable {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* 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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
* @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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* </pre>
*/
@InterfaceAudience.Public
@SuppressWarnings("ComparableType") // Should this move to Comparator usage?
public class SubstringComparator extends ByteArrayComparable {

private String substr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
// 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;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 641e870

Please sign in to comment.