# Test is not passing #18387
Unanswered
SURYANSHUAGRAWAL2006
asked this question in
Q&A
Replies: 1 comment
-
|
please create PR to show all changes, we supposed to compile all Inputs by jdk21, so we need to know if this error from your IDE or from CI |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
InputMissingNullCaseInSwitchPattern2.java/*
MissingNullCaseInSwitch
*/
// java21
package com.puppycrawl.tools.checkstyle.checks.coding.missingnullcaseinswitch;
public class InputMissingNullCaseInSwitchWithPattern2 {
static void m(Object o) {
switch (o) { // violation, 'Switch using reference types should have a null case.'
case String s when s.length() > 2 -> {
}
default -> {
}
}
switch (o) {
case null -> {}
case String s -> {}
default -> {
}
}
switch (o) {
case null -> {}
default -> {}
}
switch (o) {
case null -> {
}
default -> {
}
}
switch (o) {
case String s -> {}
case null -> {}
default -> {
}
}
}
}
Hello Everyone in this above code in switch statement Error Showing -->
java: patterns in switch statements are not supported in -source 17 (use -source 21 or higher to enable patterns in switch statements)although I am using upgrade version of java still it is showing error all other test pass except this
could anyone please help me What is the problem there?
Thank u.
Beta Was this translation helpful? Give feedback.
All reactions