mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-12 12:36:25 +07:00
Also: allow a custom highlighter to supersede the default one GitOrigin-RevId: c7d7a8be3ef762c9516ed3b637d467d4b544af00
29 lines
860 B
Java
29 lines
860 B
Java
class Test {
|
|
int testIncomplete(Object obj) {
|
|
return switch(obj) {
|
|
case String s when<EOLError descr="Expression expected"></EOLError><EOLError descr="':' or '->' expected"></EOLError>
|
|
};
|
|
}
|
|
|
|
int test3(String s1) {
|
|
return switch(s1) {
|
|
case String s when s.length() <= 3 && (s.length() > 1 || <warning descr="Condition 's.length() > 10' is always 'false' when reached">s.length() > 10</warning>) -> 1;
|
|
default -> 3;
|
|
};
|
|
}
|
|
|
|
int test4(String s) {
|
|
return switch (s) {
|
|
case String ss when (ss.length() < 3 || ss.length() == 4) -> 1;
|
|
default -> 3;
|
|
};
|
|
}
|
|
|
|
int test5(Object o) {
|
|
return switch(o) {
|
|
case String s when s.length() > 5 -> 1;
|
|
case String s1 when <warning descr="Condition 's1.length() > 10' is always 'false'">s1.length() > 10</warning> -> 2;
|
|
default -> 3;
|
|
};
|
|
}
|
|
} |