mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EclipseDefaultTypeUse: lambda tests (IDEA-CR-62110)
GitOrigin-RevId: 32c42e7bf331ca2301f2e7de336923480004be52
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a7149e200a
commit
86d6e5863b
@@ -16,4 +16,26 @@ public class EclipseDefaultTypeUse {
|
||||
// List::add is not annotated but ArrayList<String> is defined in context of TYPE_USE NonNullByDefault annotation
|
||||
a.add(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>);
|
||||
}
|
||||
}
|
||||
@NonNullByDefault
|
||||
@FunctionalInterface
|
||||
interface DefNotNull {
|
||||
String apply(String s);
|
||||
}
|
||||
@FunctionalInterface
|
||||
interface Plain {
|
||||
String apply(String s);
|
||||
}
|
||||
@NonNullByDefault
|
||||
class UseNotNull {
|
||||
void test() {
|
||||
DefNotNull l1 = s -> <warning descr="Condition 's == null' is always 'false'">s == null</warning> ? "null" : s.isEmpty() ? <warning descr="'null' is returned by the method declared as @NonNullByDefault">null</warning> : s;
|
||||
Plain l2 = s -> s == null ? "null" : s.isEmpty() ? null : s;
|
||||
}
|
||||
}
|
||||
class UsePlain {
|
||||
void test() {
|
||||
DefNotNull l1 = s -> <warning descr="Condition 's == null' is always 'false'">s == null</warning> ? "null" : s.isEmpty() ? <warning descr="'null' is returned by the method declared as @NonNullByDefault">null</warning> : s;
|
||||
Plain l2 = s -> s == null ? "null" : s.isEmpty() ? null : s;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user