False-positive on java:S7467 "Unused exception parameter should use the unnamed variable pattern"

  • Language: Java
  • Rule: java:S7467
  • Why is it false-positive:
    • The variable e is reported as unused and recommended to be replaced with _
    • However two lines below in the same code block the variable is used
  • Product: SonarQube Server, Data Center Edition, v2026.3.1 (123439)

Java code:

executor.run(
    slow,
    () -> {
      try {
        neverReleased.await();
      } catch (final InterruptedException e) {
// HERE IS THE FALSE-POSITIVE: Replace "e" with an unnamed pattern.
        interrupted.countDown();
        throw e;
      }
      return UnitOutcome.ok();
    });

Hello @Honza ,

Thanks for your feedback! We created JIRA ticket to fix the issue.

Thanks, @asya.vorobeva . Can you also provide the link to the JIRA ticket please?

JIRA ticket