1 /* 2 * @test /nodynamiccopyright/ 3 * @bug 8206986 4 * @summary Verify "case null" is not allowed. 5 * @compile/fail/ref=SwitchNullDisabled.out -XDrawDiagnostics SwitchNullDisabled.java 6 */ 7 8 public class SwitchNullDisabled { 9 private int switchNull(String str) { 10 switch (str) { 11 case null: return 0; 12 case "": return 1; 13 default: return 2; 14 } 15 } 16 }