record ColoredPoint(int p, int x, String c) { }
record Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight) { }
public class Test {
void test(Object obj) {
int y = 0;
switch (obj) {
case ColoredPoint(int x, _, _) when(x >= 2) ->
{
}case ColoredPoint(int x, _, _) // violation
when(x >= 2) ->
{
}case ColoredPoint(int x, _, _) // violation
when(x == 1)
->
{
}
case ColoredPoint(int x, _, _)
when(x == 0) -> {
}
default -> { }
}
switch (obj) {
case ColoredPoint(int x, _, _) when(x >= 2) :
{ } break; // violation
case ColoredPoint(int x, _, _)
when(x >= 2) :
{ } break; // violation
case ColoredPoint(int x, _, _)
when(x >= 2) : { }
default : { }
}
}
}
we are ok here. This can be closed or add an input file for cases with when
child of #14961
I have read check documentation: https://checkstyle.org/checks/blocks/rightcurly.html
I have downloaded the latest checkstyle from: https://checkstyle.org/cmdline.html#Download_and_Run
I have executed the cli and showed it below, as cli describes the problem better than 1,000 words
Describe what you want in detail
we are ok here. This can be closed or add an input file for cases with when