Closed
Description
Running checkstyle validation on a class that contains switch expression:
return switch (c.getLocation().toLowerCase()) {
case "query" -> String.format("ARGS_GET:%s", c.getFullPath().get(0));
case "header" -> String.format("REQUEST_HEADERS:%s", c.getFullPath().get(0));
case "cookie" -> String.format("REQUEST_COOKIES:%s", c.getFullPath().get(0));
default -> "";
};
fails with:
unexpected token: switch
And also
expecting EOF, found 'case'
FIX Summary:
new Tokens are created. Syntax should be supported, Checks will be updated later on, See follow up issues.
see #8449 for more details