mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
IDEA-163463 Stream API migration: type argument before map appears sometimes when it's unnecessary
18 lines
645 B
Java
18 lines
645 B
Java
// "Replace Optional.isPresent() condition with functional style expression" "true"
|
|
|
|
import java.lang.annotation.Annotation;
|
|
import java.lang.reflect.AnnotatedElement;
|
|
import java.util.Optional;
|
|
|
|
public class Main<T> {
|
|
public static <A extends Annotation> Optional<A> findAnnotation(Optional<? extends AnnotatedElement> element) {
|
|
if (element.isPre<caret>sent()) {
|
|
return element.get().getAnnotations().length == 0 ? Optional.empty() : null;
|
|
}
|
|
return findAnnotation((AnnotatedElement)null);
|
|
}
|
|
|
|
private static <A extends Annotation> Optional<A> findAnnotation(AnnotatedElement element) {
|
|
return Optional.empty();
|
|
}
|
|
} |