Skip to content

Commit

Permalink
Fix issue pmd#4980
Browse files Browse the repository at this point in the history
 - When an applicability test fails (ie: during LUB) we don't want that
   to bubble up and fail the process, simply to discard the candidate
   and move forward. If no matching candidate is found, the inference
   will fail anyway.
  • Loading branch information
jsotuyod committed Apr 27, 2024
1 parent b510f77 commit 0a7a52f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,12 @@ private JMethodSig instantiateImpl(JMethodSig m, MethodCallSite site, MethodReso
// we only test it can reduce, we don't commit inferred types at this stage
InferenceContext ctxCopy = infCtx.copy();
LOG.applicabilityTest(ctxCopy, m);
ctxCopy.solve(/*onlyBoundedVars:*/isPreJava8());
try {
ctxCopy.solve(/*onlyBoundedVars:*/isPreJava8());
} catch (ResolutionFailedException | IllegalArgumentException ignored) {
// applicability test failed for this candidate, but continue with others
return null;
}

// if unchecked conversion was needed, update the site for invocation pass
if (ctxCopy.needsUncheckedConversion()) {
Expand Down

0 comments on commit 0a7a52f

Please sign in to comment.