8085822: JEP 223: New Version-String Scheme (initial integration)

Co-authored-by: Kumar Srinivasan <kumar.x.srinivasan@oracle.com>
Reviewed-by: erikj, dcubed, dholmes, alanb
This commit is contained in:
Magnus Ihse Bursie 2015-06-11 00:23:18 +02:00
parent 63dc40184a
commit ebd376a99e
4 changed files with 10 additions and 7 deletions

View file

@ -45,7 +45,10 @@ public class SourceTargetTest extends Tester {
@Test
void testSourceTarget() throws IOException {
String v = System.getProperty("java.specification.version");
String latest = v.substring(v.lastIndexOf(".") + 1);
String[] va = v.split("\\.");
int major = Integer.parseInt(va[0]);
boolean newVersion = major > 8;
String latest = (newVersion) ? va[0] : va[1];
String prev = String.valueOf(Integer.valueOf(latest) - 1);
writeFile("C.java", "class C { }");