author | phh |
Sat, 30 Nov 2019 14:33:05 -0800 | |
changeset 59330 | 5b96c12f909d |
parent 50949 | 999f09bf3464 |
permissions | -rw-r--r-- |
4142 | 1 |
/* |
2 |
* @test /nodynamiccopyright/ |
|
3 |
* @bug 6827009 |
|
4 |
* @summary Check for repeated string case labels. |
|
6150 | 5 |
* @compile/fail/ref=RSCL2.out -XDrawDiagnostics RepeatedStringCaseLabels2.java |
4142 | 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 |
} |