1 /* 2 * @test /nodynamiccopyright/ 3 * @bug 6827009 4 * @summary Check for repeated string case labels. 5 * @compile/fail/ref=RSCL2.out -XDrawDiagnostics RepeatedStringCaseLabels2.java 6 */ 7 class RepeatedStringCaseLabels2 { 8 String m(String s) { 9 final String constant = "Hello" + " " + "World"; 10 switch(s) { 11 case "Hello World": 12 return(s); 13 case constant: 14 return (s + s); 15 } 16 } 17 }