Cross Reference: RepeatedStringCaseLabels1.java
xref
: /
openjdk7
/
langtools
/
test
/
tools
/
javac
/
StringsInSwitch
/
RepeatedStringCaseLabels1.java
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
609
N/A
/*
609
N/A
* @test /nodynamiccopyright/
609
N/A
* @bug 6827009
609
N/A
* @summary Check for repeated string case labels.
609
N/A
* @
compile
/
fail
-source 6
RepeatedStringCaseLabels1.java
609
N/A
* @
compile
/
fail
/
ref
=RSCL1.out -XDrawDiagnostics
RepeatedStringCaseLabels1.java
609
N/A
*/
609
N/A
class
RepeatedStringCaseLabels1
{
609
N/A
String
m(
String
s) {
609
N/A
switch
(s) {
609
N/A
case
"Hello World"
:
609
N/A
return
(s);
609
N/A
case
"Hello"
+
" "
+
"World"
:
609
N/A
return
(s + s);
609
N/A
}
609
N/A
}
609
N/A
}
609
N/A