mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
[java-highlighting] 'case default' is the incorrect syntax, and it was replaced with the proper 'default' syntax.
GitOrigin-RevId: 72f8e7f6c9080db7cb0b89c0ed876eb949171e8f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d40820813e
commit
ab14666e4e
@@ -18,7 +18,7 @@ class Main {
|
||||
default -> () -> {
|
||||
switch (o2) {
|
||||
case null -> { retu<caret> }
|
||||
case default -> { retu<caret> }
|
||||
default -> { retu<caret> }
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ class Main {
|
||||
default -> () -> {
|
||||
switch (o2) {
|
||||
case null -> { return;<caret> }
|
||||
case default -> { return;<caret> }
|
||||
default -> { return;<caret> }
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ class Test {
|
||||
switch (o) {
|
||||
case (Integer i) when (switch (o) {
|
||||
case Integer ii when ii != <error descr="Variable used in guarded pattern should be final or effectively final">mode</error> -> 2;
|
||||
case default -> 1;
|
||||
default -> 1;
|
||||
}) == <error descr="Variable used in guarded pattern should be final or effectively final">mode</error> -> System.out.println();
|
||||
default -> {}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ class Test {
|
||||
switch (o) {
|
||||
case (Integer i) when (switch (<error descr="Variable used in guarded pattern should be final or effectively final">o</error>) {
|
||||
case Integer ii when ii != mode -> 2;
|
||||
case default -> 1;
|
||||
default -> 1;
|
||||
}) == mode -> o = null;
|
||||
default -> {}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class Main {
|
||||
System.out.println(i);
|
||||
break;
|
||||
case String s:
|
||||
case default:
|
||||
default:
|
||||
System.out.println(<error descr="Cannot resolve symbol 's'">s</error>);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,17 +26,17 @@ class Test {
|
||||
switch (n) {
|
||||
case <error descr="Type pattern expected">MyNumber</error>: break;
|
||||
case <error descr="Type pattern expected">Integer</error><error descr="':' or '->' expected"> </error>break;
|
||||
case default: break;
|
||||
default: break;
|
||||
}
|
||||
result = switch (n) {
|
||||
case <error descr="Type pattern expected">MyNumber</error>: yield 1;
|
||||
case Float ignored: yield 2;
|
||||
case default: yield 3;
|
||||
default: yield 3;
|
||||
};
|
||||
result = switch (n) {
|
||||
case <error descr="Type pattern expected">MyNumber</error> -> 1;
|
||||
case Float ignored -> 2;
|
||||
case default -> 3;
|
||||
default -> 3;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ class Test {
|
||||
}
|
||||
switch (o) {
|
||||
case <error descr="Parenthesized patterns are not supported at language level '21'">(Object s)</error> when s != null -> System.out.println();
|
||||
case default -> System.out.println();
|
||||
default -> System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ abstract class Test {
|
||||
<caret>switch (o) {
|
||||
case String s -> System.out.println("one");
|
||||
case Integer i -> System.out.println("two");
|
||||
case default -> System.out.println("default");
|
||||
default -> System.out.println("default");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ class Test {
|
||||
switch<caret> (o) {
|
||||
case String s -> System.out.println("one");
|
||||
case Integer i -> System.out.println("two");
|
||||
case default -> System.out.println("default");
|
||||
default -> System.out.println("default");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ abstract class Test {
|
||||
|
||||
void foo() {
|
||||
<caret>switch (o) {
|
||||
case default -> System.out.println("hello");
|
||||
default -> System.out.println("hello");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ abstract class Test {
|
||||
|
||||
void foo() {
|
||||
<caret>switch (o) {
|
||||
case default, null -> System.out.println("hello");
|
||||
case null, default -> System.out.println("hello");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ class Main {
|
||||
case 1, 2:
|
||||
System.out.println("A");
|
||||
break;
|
||||
case default:
|
||||
default:
|
||||
System.out.println("B");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class Main {
|
||||
System.out.println("something");
|
||||
yield "Six by nine";
|
||||
}
|
||||
case default -> "and more";
|
||||
default -> "and more";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class Main {
|
||||
case 1, 2, <caret>default:
|
||||
System.out.println("A");
|
||||
break;
|
||||
case default:
|
||||
default:
|
||||
System.out.println("B");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class X {
|
||||
return switch (E.AA) {
|
||||
case A<caret>A:
|
||||
System.out.println(9);
|
||||
case default: break 0;
|
||||
default: break 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class Main {
|
||||
System.out.println("something");
|
||||
yield "Six by nine"; // 42
|
||||
}
|
||||
case default -> "and more"; // other
|
||||
default -> "and more"; // other
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ class Main {
|
||||
System.out.println("something");
|
||||
yield "Six by nine";
|
||||
}
|
||||
case default, 100500 -> "and more";
|
||||
case 100500 -> "and more";
|
||||
default -> "and more";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class Test {
|
||||
int result = switch (n) {
|
||||
case <caret>Integer i when i == 1 -> i;
|
||||
case Long l -> l.intValue();
|
||||
case default -> 1;
|
||||
default -> 1;
|
||||
} + 10;
|
||||
int i = 5;
|
||||
System.out.println(result + i);
|
||||
|
||||
@@ -4,7 +4,7 @@ class Test {
|
||||
int result = switch (n) {
|
||||
case <caret>Integer i when i == 1 -> i;
|
||||
case Long l -> l.intValue();
|
||||
case default -> 1;
|
||||
default -> 1;
|
||||
} + 10;
|
||||
{
|
||||
int i = 5;
|
||||
|
||||
@@ -11,7 +11,7 @@ class Test {
|
||||
case "fsd":
|
||||
System.out.println(2);
|
||||
break;
|
||||
case default:
|
||||
default:
|
||||
System.out.println(3);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class Test {
|
||||
return switch (s) {
|
||||
case <caret>String ss when ss.length() <= 3 -> 1;
|
||||
case "fsd" -> 2;
|
||||
case default -> 3;
|
||||
default -> 3;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ class Test {
|
||||
return 1 + switch (n) {
|
||||
case <caret>Integer i when i == 1 -> i;
|
||||
case Long l -> l.intValue();
|
||||
case default -> 1;
|
||||
default -> 1;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ class T {
|
||||
return 2;
|
||||
case 2:
|
||||
return 4;
|
||||
case default:
|
||||
default:
|
||||
return 0;
|
||||
case 3:
|
||||
return 10;
|
||||
|
||||
@@ -9,7 +9,7 @@ class T {
|
||||
case 2:
|
||||
n = 4;
|
||||
break;
|
||||
case default:
|
||||
default:
|
||||
n = 0;
|
||||
break;
|
||||
case 3:
|
||||
|
||||
@@ -7,7 +7,7 @@ class C {
|
||||
case 2:
|
||||
s = "x";
|
||||
break;
|
||||
case default:
|
||||
default:
|
||||
s = "x";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class C {
|
||||
case Rect(Point(double x1, double y1) point1, Point(double x2, double y2) point2):
|
||||
System.out.println();
|
||||
break;
|
||||
case default:
|
||||
default:
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ class C {
|
||||
String s = "";
|
||||
switch (n) {
|
||||
case 1:
|
||||
<caret>case default:
|
||||
<caret>default:
|
||||
case 2:
|
||||
s = "x";
|
||||
break;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
public class One {
|
||||
void f1(String a) {
|
||||
sw<caret>itch (a) {
|
||||
case default -> System.out.println("None");
|
||||
default -> System.out.println("None");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
class Test {
|
||||
void foo(Object obj) {
|
||||
int answer = sw<caret>itch (obj) {
|
||||
case default -> 42;
|
||||
default -> 42;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ class SwitchExpressionMigration {
|
||||
case String s:
|
||||
i = 0;
|
||||
break;
|
||||
case default:
|
||||
default:
|
||||
i = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class SwitchExpressionMigration {
|
||||
private void matchingSwitchError(Object obj) {
|
||||
int i = switch<caret> (obj) {
|
||||
case String s -> 0;
|
||||
case default -> 1;
|
||||
default -> 1;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ class X {
|
||||
return switch (e) {
|
||||
case A -> 3;
|
||||
case B -> 1;
|
||||
case default -> 2;
|
||||
default -> 2;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ class X {
|
||||
return 3;
|
||||
case B:
|
||||
return 1;
|
||||
case default:
|
||||
default:
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user