mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 16:39:37 +07:00
17 lines
651 B
Java
17 lines
651 B
Java
import java.util.function.Predicate;
|
|
|
|
class RedundantCast {
|
|
private static void foo(final int matchType) {
|
|
Object o = switch (matchType) {
|
|
default -> (Predicate<Object>) target -> target == null;
|
|
};
|
|
Predicate<Object> o1 = switch (matchType) {
|
|
default -> (<warning descr="Casting 'target -> {...}' to 'Predicate<Object>' is redundant">Predicate<Object></warning>) target -> target == null;
|
|
};
|
|
|
|
Predicate<Object> o2 = switch (matchType) {
|
|
default:
|
|
yield (<warning descr="Casting 'target -> {...}' to 'Predicate<Object>' is redundant">Predicate<Object></warning>) target -> target == null;
|
|
};
|
|
}
|
|
} |