2018-08-29 07:36:17 +00:00
|
|
|
/*
|
|
|
|
* @test /nodynamiccopyright/
|
|
|
|
* @bug 8206986
|
2023-05-22 04:24:06 +00:00
|
|
|
* @summary Verify "case null" is not allowed for --release 16, 20
|
|
|
|
* @compile/fail/ref=SwitchNullDisabled.out -XDrawDiagnostics --release 20 SwitchNullDisabled.java
|
|
|
|
* @compile SwitchNullDisabled.java
|
2018-08-29 07:36:17 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class SwitchNullDisabled {
|
|
|
|
private int switchNull(String str) {
|
|
|
|
switch (str) {
|
|
|
|
case null: return 0;
|
|
|
|
case "": return 1;
|
|
|
|
default: return 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|