- Operating system: NixOS
- SonarLint plugin version: 3.16.0
- Programming language you’re coding in: Java
- Is connected mode used: No
- Connected to SonarCloud or SonarQube (and which version): No
The following code:
import java.util.function.UnaryOperator;
class $ {
public $ $;
public $ id() {
return this;
}
public static UnaryOperator<$> $Op = ($ it) -> it.id();
}
is erroneously corrected to this:
import java.util.function.UnaryOperator;
class $ {
public $ $;
public $ id() {
return this;
}
public static UnaryOperator<$> $Op = $::id;
}
which produces the error:
non-static variable $ cannot be referenced from a static context