mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
IDEA-177515 Optional.isPresent() refactoring should not be suggested for ternary with incompatible branch types
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace Optional.isPresent() condition with functional style expression" "false"
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Optional;
|
||||
|
||||
public class OptionalTest {
|
||||
Optional<LocalDate> date = Optional.of(LocalDate.now());
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final String x = "{date:" + (date.isPres<caret>ent() ? date.get() : "<missing>") + '}';
|
||||
return x;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user