Skip to content

Commit

Permalink
Rebase and fix error message dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
lazaroclapp committed Mar 29, 2019
1 parent c76e6f5 commit fee2c25
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions nullaway/src/main/java/com/uber/nullaway/NullAway.java
Expand Up @@ -32,6 +32,7 @@

import com.google.auto.service.AutoService;
import com.google.auto.value.AutoValue;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -503,8 +504,10 @@ public Description matchMethod(MethodTree tree, VisitorState state) {
+ " in "
+ methodSymbol.toString()
+ " (this issue can cause other errors below, wherever the var args array is dereferenced)";
return createErrorDescription(
MessageTypes.NULLABLE_VARARGS_UNSUPPORTED, tree, message, state.getPath());
return errorBuilder.createErrorDescription(
new ErrorMessage(MessageTypes.NULLABLE_VARARGS_UNSUPPORTED, message),
state.getPath(),
buildDescription(tree));
}
}
return Description.NO_MATCH;
Expand Down Expand Up @@ -1314,8 +1317,8 @@ private Description handleInvocation(
actual = actualParams.get(argPos);
mayActualBeNull = mayBeNullExpr(state, actual);
}
Preconditions.checkNotNull(
actual); // This statement should be unreachable without assigning actual beforehand
// This statement should be unreachable without assigning actual beforehand:
Preconditions.checkNotNull(actual);
// make sure we are passing a non-null value
if (mayActualBeNull) {
String message =
Expand Down

0 comments on commit fee2c25

Please sign in to comment.