java highlighting tests moved to community

This commit is contained in:
Alexey Kudravtsev
2010-06-25 12:46:38 +04:00
parent 7ec040c1ec
commit 735a9d17a8
243 changed files with 22082 additions and 0 deletions
@@ -0,0 +1,41 @@
public class Test {
private static final String BAZ = "baz";
private void stringSwitch() {
final String bar = "bar";
String key = "key";
switch (key) {
case "": {
System.out.println("Nothing");
break;
}
case "foo": // fallthrough works as before
case bar: // local final variables are ok
case BAZ: { // constants are ok
System.out.println("Matched key");
break;
}
default:
break;
}
}
private void illegalStringSwitch() {
String foo = "foo";
String key = "key";
switch (key) {
case <error>foo</error>:
case <error>getStringValue()</error>: {
System.out.println("illegal");
break;
}
default:
break;
}
}
private String getStringValue() {
return "";
}
}