False positive of java:S2970 if `@ExtendWith(SoftAssertionsExtension.class)` is used in parent class

I’m using SonarLint in IntelliJ IDEA 2022.2.4 (Ultimate Edition).

Parent class

public class TestBase {

  SoftAssertions softly;

Child class

class TestA extends TestBase {

  void testA() {

This leads to java:S2970 false positive.


Hello Tomohiko,

Indeed this looks like a FP - we have an open ticket for this issue. Thanks for sharing your case, I’ve added your case to this ticket, which will help us to ensure we fix it also for this slightly more complex case with inheritance.

As a workaround until this is fixed, and if you have SonarLint linked to a SonarQube/SonarCloud instance, you can mark the issues as false positive on SQ/SC side. Alternatively, you can also temporarily disable the rule in your quality profile on SQ/SC if you find it to be too noisy at the moment.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.