@@ -95,8 +95,8 @@ public boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod m, ValueNo
95
95
* that end up in the same class or in the JDK.
96
96
*/
97
97
EnumSwitchFeature feature = ImageSingletons .lookup (EnumSwitchFeature .class );
98
- method .ensureGraphParsed (feature .bb );
99
- Boolean methodSafeForExecution = feature .methodsSafeForExecution . get (method );
98
+ method .ensureGraphParsed (feature .getBigBang () );
99
+ Boolean methodSafeForExecution = feature .isMethodsSafeForExecution (method );
100
100
assert methodSafeForExecution != null : "after-parsing hook not executed for method " + method .format ("%H.%n(%p)" );
101
101
if (!methodSafeForExecution .booleanValue ()) {
102
102
return false ;
@@ -121,9 +121,9 @@ public boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod m, ValueNo
121
121
@ AutomaticallyRegisteredFeature
122
122
final class EnumSwitchFeature implements InternalFeature {
123
123
124
- BigBang bb ;
124
+ private BigBang bb ;
125
125
126
- final ConcurrentMap <AnalysisMethod , Boolean > methodsSafeForExecution = new ConcurrentHashMap <>();
126
+ private ConcurrentMap <AnalysisMethod , Boolean > methodsSafeForExecution = new ConcurrentHashMap <>();
127
127
128
128
@ Override
129
129
public void duringSetup (DuringSetupAccess a ) {
@@ -142,10 +142,19 @@ private void onMethodParsed(AnalysisMethod method, StructuredGraph graph) {
142
142
@ Override
143
143
public void afterAnalysis (AfterAnalysisAccess access ) {
144
144
bb = null ;
145
+ methodsSafeForExecution = null ;
145
146
}
146
147
147
148
@ Override
148
149
public void registerGraphBuilderPlugins (Providers providers , Plugins plugins , ParsingReason reason ) {
149
150
plugins .appendNodePlugin (new EnumSwitchPlugin (reason ));
150
151
}
152
+
153
+ Boolean isMethodsSafeForExecution (AnalysisMethod method ) {
154
+ return methodsSafeForExecution .get (method );
155
+ }
156
+
157
+ public BigBang getBigBang () {
158
+ return bb ;
159
+ }
151
160
}
0 commit comments