Operating system:
macOS Ventura
uname -a gives:
Darwin Kernel Version 22.3.0: Thu Jan 5 20:48:54 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T6000 arm64
SonarLint plugin version:
8.0.0.63273
IntelliJ: Build #IU-223.8617.56, built on January 26, 2023
Programming language you’re coding in:
Java 17
Is connected mode used: No
Connected to SonarCloud or SonarQube (and which version):
And a thorough description of the problem / question:
Thanks for raising this. I am not able to reproduce, an issue is correctly raised on my side.
Could you please enable verbose logs and send them here ? Also could you send the full class instead of the method snippet, in case something else causes problems?
package com.box.data.credence.integration;
public class Foo {
private int foo() {
try {
return 1;
} finally {
return 2;
}
}
public String bar() {
return null;
}
}
Please notice that the plugin runs using JDK 17 (my IntelliJ runs on JDK 17), but the project uses JDK 8 (Toolchain explicitly set in Gradle build to be JDK 8).
Thanks for the logs, I am able to reproduce. It seems that this rule is not run for test code, and I’m not sure if this is expected or not. I will forward to the team in charge.