8030253: Update langtools to use strings-in-switch

8030262: Update langtools to use foreach loops
8030245: Update langtools to use try-with-resources and multi-catch

Reviewed-by: darcy
This commit is contained in:
Brian Goetz 2013-12-18 10:29:25 -05:00
parent bedae747dc
commit dbcdc16212
82 changed files with 703 additions and 895 deletions

View file

@ -158,12 +158,14 @@ public enum SourceVersion {
try {
String specVersion = System.getProperty("java.specification.version");
if ("1.8".equals(specVersion))
return RELEASE_8;
else if("1.7".equals(specVersion))
return RELEASE_7;
else if("1.6".equals(specVersion))
return RELEASE_6;
switch (specVersion) {
case "1.8":
return RELEASE_8;
case "1.7":
return RELEASE_7;
case "1.6":
return RELEASE_6;
}
} catch (SecurityException se) {}
return RELEASE_5;