We have a custom library which provides a method Strings.isFilled
which ensures that a given string is neither null nor empty. (https://github.com/scireum/sirius-kernel/blob/master/src/main/java/sirius/kernel/commons/Strings.java#L65)
If we now have a pattern like:
public void someMethod(@Nullable String param) {
if (Strings.isFilled(param)) {
methodWithNonNullParameter(param);
}
}
private void methodWithNonNullParameter(@Nonnull String param) {
LOG.FINE(param);
}
then sonarlint will trigger rule S2637: "@NonNull" values should not be set to null. However: If we manually set sonar.java.libraries and only put the library (sirius-kernel.jar) from the local maven repository in it, the analysis works!
Is it possible, that both, IntelliJ and Maven provide too many libraries to SonarLint so that it starts ignoring some? When using maven and debug logging,
then sonar:sonar
happily reports that it uses all libraries from the classpath,
it can find all required classes and reports no error?