False positive of `javabugs:S2190: Recursion should not be infinite` in combination with `lombok`

I want to report a false positive of javabugs:S2190: Recursion should not be infinite in combination with lombok.

Then tell us:

package io.github.hemeroc;

import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public class S2190 {

    private final String identifier;

    public S2190(Long identifier) {
        this(String.valueOf(identifier));
    }

}
1 Like

This issue often occurs for me as well, and is pretty annoying.

Hello,

Thank you for your report and the very good reproducer you have provided. Unfortunately, Lombok manipulates byte code in ways which we cannot follow precisely in our static analysis tools and we do not have plans for more in-depth support for Lombok on our roadmap. That said, we will be looking into ways to avoid reporting such issues if we know that Lombok is involved in the program code. I created an internal ticket to track this on our side.

Cheers,

Gyula

@Gyula_Sallai today I received a notification from SonarCloud that javabugs:S2190 which I considered false positive, was closed in the code while I didn’t touch it.
So maybe the problem with this rule was fixed.

1 Like

That’s right. We fixed the FP on S2190 related to Lombok.

1 Like