[java-highlighting] IDEA-324586 Highlight duplicated values with casts in java 21

GitOrigin-RevId: 1a34f534b4850b8ae0ea2a0e1f373fa6b3b8b847
This commit is contained in:
Mikhail Pyltsin
2023-07-07 11:07:29 +02:00
committed by intellij-monorepo-bot
parent 4d36ca4523
commit 4e03b09337
3 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
import java.util.Random;
class DuplicatedWithCast {
void m(String... args) {
final byte b = 127;
switch (new Random().nextInt()) {
case <error descr="Duplicate label '127'">b</error> -> System.out.println("b=" + b + ";");
case <error descr="Duplicate label '127'">127</error>-> System.out.println("sweet spot");
}
}
}