Hello,
squid S1162 reports a finding on any method that throws a new checked exception. I would like to suggest that this may be a false positive in the specific case dealing with implementing an interface. For example:
public interface SomeInterface {
boolean isSomeMethod() throws CheckedException
}
and implementor:
@Override
public boolean isSomeMethod() throws CheckedException {
throw new CheckedException("some message");
}
...reports a finding. By converting the checked exception into an unchecked exception, you would be fundamentally altering the contract of the interface/method, which expects one of 3 results: true, false, or a CheckedException. I am wondering whether this finding should be suppressed when a method implements an interface that declares the checked exception.