We’re using SonarQube server Version 6.7.5 (build 38563). With default settings & the sonar-way quality profile.
We have a lot of code like this:
Optional<SomeClass> optional = ...
if (optional.isEmpty()) {
throw new Exception("Error");
}
var value = optional.get();
This triggers S3655 every time & we have to mark it as a false positive. From this topic I see that this PR was supposed to fix this issue. But from the examples in the PR I think that the case where control flow is interrupted due to the isEmpty() check is missed.
Is there any workaround for this? Or a planned fix?
I found that this case is still happening in our Sonarqube even we updated the version higher to 5.12.1. So i have created a “help” ticket recently. Can you reproduce this problem too?
SonarQube & relevant plugin version:
SonarQube Developer edition, the version is 7.9.1.27448