The following stripped down code looks like a false positive:
(Problem in a.toAbsolutePath())
Raw code:
import org.apache.commons.lang3.Validate;
import java.nio.file.Path;
import java.nio.file.Paths;
import BaseException;
private void x() {
final var a = Paths.get("");
try {
y(a);
} catch (final Exception e) {
System.err.println(a.toAbsolutePath());
}
}
private void y(final Path b) throws BaseException {
Validate.notNull(b);
}
My work-around is currently assert b != null; which removes the problem, but has the same effect for me. Changing Exception to BaseException would also remove it, but in this I need also to catch all Exceptions.
- Community Edition
- Version 9.5 (build 56709)
Best Regards,
Roland