mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-08 21:52:48 +07:00
When lambda is defined in the outer scope a number of problems may appear during the analysis. First, it actually could be analyzed twice producing different warnings (in inlining context, and as standalone expression). Second, trap-handling assumes that all exited expressions should appear within the current codeFragment. This could be violated when lambda comes from the outer scope, resulting in incorrect jumps. Fixes IDEA-240328 Condition always false inspection is wrong if using switch expressions GitOrigin-RevId: 11794502d2e661044fa2105402955aa54e3c1245
12 lines
287 B
Java
12 lines
287 B
Java
import java.util.function.Predicate;
|
|
|
|
class SwitchExpr {
|
|
void test() {
|
|
Predicate<String> predicate = value -> switch(value) {
|
|
case "A" -> true;
|
|
default -> false;
|
|
};
|
|
Predicate<String> otherPredicate = value -> value.length() == 1 && predicate.test(value);
|
|
}
|
|
}
|