mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
redundant cast: ignore for lambda casts with serializable/intersections (IDEA-105839)
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
import java.io.*;
|
||||
interface Predicate<T> {
|
||||
boolean test(String s);
|
||||
}
|
||||
class Test {
|
||||
private static boolean test(String s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
Predicate<String> mh1 = (Predicate<String> & Serializable)Test::test;
|
||||
Predicate<String> mh0 = (<warning descr="Casting 'Test::test' to 'Predicate<String> & Predicate<String>' is redundant">Predicate<String> & Predicate<String></warning>)Test::test;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.io.*;
|
||||
interface Predicate<T> {
|
||||
boolean test(String s);
|
||||
}
|
||||
interface SerPredicate<T> extends Predicate<T>, Serializable {
|
||||
}
|
||||
|
||||
interface NonSerPredicate<T> extends Predicate<T> {
|
||||
}
|
||||
|
||||
class Test {
|
||||
private static boolean test(String s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
Predicate<String> mh2 = (SerPredicate<String>)Test::test;
|
||||
Predicate<String> mh02 = (<warning descr="Casting 'Test::test' to 'NonSerPredicate<String>' is redundant">NonSerPredicate<String></warning>)Test::test;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user