@@ -270,27 +270,24 @@ protected void processMethodMetadata(DuringAnalysisAccessImpl access) {
270270 }
271271 }
272272
273- private static final Map <AnalysisMethod , Set <AnalysisType >> seenHiddenMethods = new HashMap <>();
273+ private final Map <AnalysisMethod , Set <AnalysisType >> seenHiddenMethods = new HashMap <>();
274274
275275 private void registerHiddenSubTypeMethods (AnalysisMethod method , AnalysisType type ) {
276- if (seenHiddenMethods .containsKey (method ) && seenHiddenMethods .get (method ).contains (type )) {
277- return ;
278- }
279- seenHiddenMethods .computeIfAbsent (method , m -> new HashSet <>()).add (type );
280276
281277 if (!type .equals (method .getDeclaringClass ()) && type .isReachable ()) {
282- try {
283- AnalysisMethod subClassMethod = type .findMethod (method .getName (), method .getSignature ());
284- if (subClassMethod != null ) {
285- hiddenMethods .add (subClassMethod );
286- /* This method shadows all of its subclasses */
287- return ;
278+ if (!seenHiddenMethods .containsKey (method ) || !seenHiddenMethods .get (method ).contains (type )) {
279+ seenHiddenMethods .computeIfAbsent (method , m -> new HashSet <>()).add (type );
280+ try {
281+ AnalysisMethod subClassMethod = type .findMethod (method .getName (), method .getSignature ());
282+ if (subClassMethod != null ) {
283+ hiddenMethods .add (subClassMethod );
284+ }
285+ } catch (UnsupportedFeatureException | LinkageError e ) {
286+ /*
287+ * A method that is not supposed to end up in the image is considered as being
288+ * absent for reflection purposes.
289+ */
288290 }
289- } catch (UnsupportedFeatureException | LinkageError e ) {
290- /*
291- * A method that is not supposed to end up in the image is considered as being
292- * absent for reflection purposes.
293- */
294291 }
295292 }
296293 for (AnalysisType subType : type .getSubTypes ()) {
0 commit comments