mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[java-highlighting] IDEA-357866 Spurious "Different case kinds used in the switch" error on incomplete code
- improve error message GitOrigin-RevId: 2a8da472e07dd10bdb0ae75e679b6056ab884b72
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6d95a69a3e
commit
cd14483af8
@@ -318,7 +318,7 @@ unclosed.comment=Unclosed comment
|
|||||||
exception.already.caught=Exception ''{0}'' has already been caught
|
exception.already.caught=Exception ''{0}'' has already been caught
|
||||||
exception.must.be.disjoint=Types in multi-catch must be disjoint: ''{0}'' is a subclass of ''{1}''
|
exception.must.be.disjoint=Types in multi-catch must be disjoint: ''{0}'' is a subclass of ''{1}''
|
||||||
statement.must.be.prepended.with.case.label=Statement must be prepended with case label
|
statement.must.be.prepended.with.case.label=Statement must be prepended with case label
|
||||||
different.case.kinds.in.switch=Different case kinds used in the switch
|
different.case.kinds.in.switch=Different 'case' kinds used in 'switch'
|
||||||
void.type.is.not.allowed='void' type is not allowed here
|
void.type.is.not.allowed='void' type is not allowed here
|
||||||
single.import.class.conflict=''{0}'' is already defined in a single-type import
|
single.import.class.conflict=''{0}'' is already defined in a single-type import
|
||||||
numeric.overflow.in.expression=Numeric overflow in expression
|
numeric.overflow.in.expression=Numeric overflow in expression
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ class EnhancedSwitchStatements {
|
|||||||
}
|
}
|
||||||
switch (new Random().nextInt()) {
|
switch (new Random().nextInt()) {
|
||||||
case 0 -> throw new IllegalStateException("no args");
|
case 0 -> throw new IllegalStateException("no args");
|
||||||
<error descr="Different case kinds used in the switch">case 1:</error> break;
|
<error descr="Different 'case' kinds used in 'switch'">case 1:</error> break;
|
||||||
}
|
}
|
||||||
switch (new Random().nextInt()) {
|
switch (new Random().nextInt()) {
|
||||||
case 0: throw new IllegalStateException("no args"); break;
|
case 0: throw new IllegalStateException("no args"); break;
|
||||||
<error descr="Different case kinds used in the switch">case 1 -> { System.out.println("one"); }</error>
|
<error descr="Different 'case' kinds used in 'switch'">case 1 -> { System.out.println("one"); }</error>
|
||||||
}
|
}
|
||||||
|
|
||||||
{ <error descr="Case statement outside switch">case 11 -> System.out.println("hi there");</error> }
|
{ <error descr="Case statement outside switch">case 11 -> System.out.println("hi there");</error> }
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class SwitchExpressions {
|
|||||||
|
|
||||||
System.out.println(switch (new Random().nextInt()) {
|
System.out.println(switch (new Random().nextInt()) {
|
||||||
case 0 -> throw new IllegalStateException("no args");
|
case 0 -> throw new IllegalStateException("no args");
|
||||||
<error descr="Different case kinds used in the switch">case 1:</error> yield "lone";
|
<error descr="Different 'case' kinds used in 'switch'">case 1:</error> yield "lone";
|
||||||
});
|
});
|
||||||
|
|
||||||
System.out.println(
|
System.out.println(
|
||||||
|
|||||||
Reference in New Issue
Block a user