File tree 2 files changed +9
-11
lines changed
error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules
refaster-test-support/src/main/java/tech/picnic/errorprone/refaster/test
2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ public ImmutableSet<Object> elidedTypesAndStaticImports() {
50
50
identity (),
51
51
ImmutableList .class ,
52
52
ImmutableMap .class ,
53
+ List .class ,
53
54
Map .class ,
54
55
mapping (null , null ),
55
56
maxBy (null ),
Original file line number Diff line number Diff line change 12
12
import static java .util .stream .Collectors .joining ;
13
13
import static tech .picnic .errorprone .refaster .runner .Refaster .INCLUDED_RULES_PATTERN_FLAG ;
14
14
15
+ import com .google .common .collect .ImmutableList ;
15
16
import com .google .common .collect .ImmutableListMultimap ;
16
17
import com .google .common .collect .ImmutableMap ;
17
18
import com .google .common .collect .ImmutableRangeMap ;
@@ -241,17 +242,13 @@ private void reportUnSortedElidedTypesAndStaticImports(
241
242
}
242
243
243
244
private static String getArgumentName (ExpressionTree arg , VisitorState state ) {
244
- switch (arg .getKind ()) {
245
- case MEMBER_SELECT :
246
- return state .getSourceForNode (((MemberSelectTree ) arg ).getExpression ());
247
- case METHOD_INVOCATION :
248
- return state .getSourceForNode (((MethodInvocationTree ) arg ).getMethodSelect ());
249
- case STRING_LITERAL :
250
- case INT_LITERAL :
251
- return ((LiteralTree ) arg ).getValue ().toString ();
252
- default :
253
- return "" ;
254
- }
245
+ return switch (arg .getKind ()) {
246
+ case MEMBER_SELECT -> state .getSourceForNode (((MemberSelectTree ) arg ).getExpression ());
247
+ case METHOD_INVOCATION ->
248
+ state .getSourceForNode (((MethodInvocationTree ) arg ).getMethodSelect ());
249
+ case STRING_LITERAL , INT_LITERAL -> ((LiteralTree ) arg ).getValue ().toString ();
250
+ default -> "" ;
251
+ };
255
252
}
256
253
257
254
private static ImmutableRangeMap <Integer , String > indexRuleMatches (
You can’t perform that action at this time.
0 commit comments