Enable null analysis

This commit is contained in:
Stephan Schroevers
2018-01-01 17:07:55 +01:00
parent e680a00c1d
commit 3f79a928e1
2 changed files with 14 additions and 4 deletions

View File

@@ -44,6 +44,7 @@
<version.javadoc>2.10.4</version.javadoc>
<version.jdk>1.8</version.jdk>
<version.maven>3.5.0</version.maven>
<version.nullaway>0.3.0</version.nullaway>
<version.plexus-compiler>2.8.2</version.plexus-compiler>
<version.slf4j>1.7.25</version.slf4j>
<version.surefire>2.20.1</version.surefire>
@@ -168,6 +169,11 @@
<artifactId>checkstyle</artifactId>
<version>${version.checkstyle}</version>
</dependency>
<dependency>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
<version>${version.nullaway}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -780,6 +786,11 @@
<artifactId>guava-beta-checker</artifactId>
<version>${version.guava-beta-checker}</version>
</path>
<path>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
<version>${version.nullaway}</version>
</path>
</annotationProcessorPaths>
<compilerArgs combine.children="append">
<!-- We enable nearly all doclint checks,
@@ -803,10 +814,9 @@
<arg>-Xep:ConstructorLeaksThis:OFF</arg>
<!-- See https://github.com/google/error-prone/issues/708. -->
<arg>-Xep:FieldMissingNullable:OFF</arg>
<!-- See https://github.com/google/error-prone/issues/723. -->
<arg>-Xep:ReturnMissingNullable:OFF</arg>
<!-- XXX: Enable this once we open-source this library. -->
<arg>-Xep:BetaApi:OFF</arg>
<arg>-XepOpt:NullAway:AnnotatedPackages=com.picnicinternational</arg>
</compilerArgs>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>

View File

@@ -34,7 +34,7 @@ import java.util.function.ToDoubleFunction;
import java.util.function.ToIntFunction;
import java.util.function.ToLongFunction;
import java.util.stream.Stream;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
/**
* A {@link BugChecker} which flags {@code Comparator#comparing*} invocations that can be replaced
@@ -100,7 +100,7 @@ public final class PrimitiveComparisonCheck extends BugChecker
return isStatic ? "comparing" : "thenComparing";
}
@CheckForNull
@Nullable
private static Type getPotentiallyBoxedReturnType(ExpressionTree tree) {
switch (tree.getKind()) {
case LAMBDA_EXPRESSION: