Skip to content

Commit

Permalink
Post rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsamehsalah committed May 8, 2024
1 parent 5bf7e66 commit 1593ff2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public ImmutableSet<Object> elidedTypesAndStaticImports() {
identity(),
ImmutableList.class,
ImmutableMap.class,
List.class,
Map.class,
mapping(null, null),
maxBy(null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static java.util.stream.Collectors.joining;
import static tech.picnic.errorprone.refaster.runner.Refaster.INCLUDED_RULES_PATTERN_FLAG;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableRangeMap;
Expand Down Expand Up @@ -241,17 +242,13 @@ private void reportUnSortedElidedTypesAndStaticImports(
}

private static String getArgumentName(ExpressionTree arg, VisitorState state) {
switch (arg.getKind()) {
case MEMBER_SELECT:
return state.getSourceForNode(((MemberSelectTree) arg).getExpression());
case METHOD_INVOCATION:
return state.getSourceForNode(((MethodInvocationTree) arg).getMethodSelect());
case STRING_LITERAL:
case INT_LITERAL:
return ((LiteralTree) arg).getValue().toString();
default:
return "";
}
return switch (arg.getKind()) {
case MEMBER_SELECT -> state.getSourceForNode(((MemberSelectTree) arg).getExpression());
case METHOD_INVOCATION ->
state.getSourceForNode(((MethodInvocationTree) arg).getMethodSelect());
case STRING_LITERAL, INT_LITERAL -> ((LiteralTree) arg).getValue().toString();
default -> "";
};
}

private static ImmutableRangeMap<Integer, String> indexRuleMatches(
Expand Down

0 comments on commit 1593ff2

Please sign in to comment.