Causing dozens of FPs for us just in one PR.
- What language is this for? Java
Java 17 switches cause FP not just with -> methodCall();
syntax, but also when using switch blocks. e.g.
public class Main
{
enum Kind { REGEXP, TAGS, REST }
public static void main(String[] args) {
Kind kind = Kind.REGEXP;
switch(kind) {
case REGEXP -> {
yield ofNullable(portfolio.getSelectionExpression()).ifPresent(view::setRegexp); // FP
}
case TAGS -> ofNullable(portfolio.getSelectionExpression()).ifPresent(tags -> view.setTagsAssociation(getTags(portfolio))); // FP
case REST -> view.setDef(true); // FP
default -> {
}
}
}
}
This may be a combination of [SONARJAVA-4401] - Jira and [SONARJAVA-1186] - Jira