--- /dev/null 2009-07-06 20:02:10.000000000 -0700 +++ new/test/tools/javac/StringsInSwitch/BadlyTypedLabel2.java 2009-11-02 19:06:32.000000000 -0800 @@ -0,0 +1,19 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6827009 + * @summary Check for case lables of different types. + * @compile/fail -source 6 BadlyTypedLabel2.java + * @compile/fail/ref=BadlyTypedLabel2.out -XDstdout -XDrawDiagnostics BadlyTypedLabel2.java + */ +import static java.math.RoundingMode.*; + +class BadlyTypedLabel2 { + String m(String s) { + switch(s) { + case "Oh what a feeling...": + return(s); + case CEILING: + return ("... switching on the ceiling!"); + } + } +}