mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-211702 Incorrect inspection "Can be replaced with single expression in functional style" when types differ
GitOrigin-RevId: 4006edb212486fa38b31b26ecbed881e6079f6e6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3ddbffb2db
commit
61ac76cf48
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace Optional.isPresent() condition with functional style expression" "false"
|
||||
import java.util.Optional;
|
||||
|
||||
class Test {
|
||||
Object get() {
|
||||
Optional<String> obj = Stream.of("one", "two").filter(s -> Math.sqrt(s.length()) > 100).findFirst();
|
||||
if (obj.<caret>isPresent()) {
|
||||
return obj.get();
|
||||
} else {
|
||||
return 7;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user