16
16
17
17
package com .google .errorprone ;
18
18
19
- import static com .google .common .collect .ImmutableSet .toImmutableSet ;
20
-
21
19
import com .google .common .collect .ImmutableSet ;
22
20
import com .google .errorprone .annotations .CheckReturnValue ;
23
21
import com .google .errorprone .annotations .Immutable ;
37
35
import java .util .HashSet ;
38
36
import java .util .Set ;
39
37
import java .util .concurrent .atomic .AtomicBoolean ;
40
- import java .util .stream .Stream ;
41
38
42
39
/**
43
40
* Immutable container of "suppression signals" - annotations or other information gathered from
@@ -57,12 +54,6 @@ public class SuppressionInfo {
57
54
private static final Supplier <Name > ANDROID_SUPPRESS_LINT =
58
55
VisitorState .memoize (state -> state .getName ("android.annotation.SuppressLint" ));
59
56
private static final Supplier <Name > VALUE = VisitorState .memoize (state -> state .getName ("value" ));
60
- private static final Supplier <ImmutableSet <Name >> GENERATED_ANNOTATIONS =
61
- VisitorState .memoize (
62
- state ->
63
- Stream .of ("javax.annotation.Generated" , "javax.annotation.processing.Generated" )
64
- .map (state ::getName )
65
- .collect (toImmutableSet ()));
66
57
private final ImmutableSet <String > suppressWarningsStrings ;
67
58
68
59
@ SuppressWarnings ("Immutable" ) /* Name is javac's interned version of a string. */
@@ -78,7 +69,7 @@ private SuppressionInfo(
78
69
}
79
70
80
71
private static boolean isGenerated (Symbol sym , VisitorState state ) {
81
- return !ASTHelpers .annotationsAmong (sym , GENERATED_ANNOTATIONS . get ( state ) , state ).isEmpty ();
72
+ return !ASTHelpers .getGeneratedBy (sym , state ).isEmpty ();
82
73
}
83
74
84
75
/**
0 commit comments