mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 01:24:33 +02:00
8267630: Start of release updates for JDK 18
8267632: Add source 18 and target 18 to javac 8267631: Add SourceVersion.RELEASE_18 Reviewed-by: iris, erikj, dholmes
This commit is contained in:
parent
74007890bb
commit
b018c450e5
63 changed files with 5352 additions and 60 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -70,9 +70,10 @@ public class Versions {
|
|||
Set.of("1.2", "1.3", "1.4", "1.5", "1.6");
|
||||
|
||||
public static final Set<String> VALID_SOURCES =
|
||||
Set.of("1.7", "1.8", "1.9", "1.10", "11", "12", "13", "14", "15", "16", "17");
|
||||
Set.of("1.7", "1.8", "1.9", "1.10", "11", "12", "13", "14",
|
||||
"15", "16", "17", "18");
|
||||
|
||||
public static final String LATEST_MAJOR_VERSION = "61.0";
|
||||
public static final String LATEST_MAJOR_VERSION = "62.0";
|
||||
|
||||
static enum SourceTarget {
|
||||
SEVEN(true, "51.0", "7", Versions::checksrc7),
|
||||
|
@ -85,7 +86,8 @@ public class Versions {
|
|||
FOURTEEN(false, "58.0", "14", Versions::checksrc14),
|
||||
FIFTEEN(false, "59.0", "15", Versions::checksrc15),
|
||||
SIXTEEN(false, "60.0", "16", Versions::checksrc16),
|
||||
SEVENTEEN(false, "61.0", "17", Versions::checksrc17);
|
||||
SEVENTEEN(false, "61.0", "17", Versions::checksrc17),
|
||||
EIGHTEEN(false, "62.0", "18", Versions::checksrc18);
|
||||
|
||||
private final boolean dotOne;
|
||||
private final String classFileVer;
|
||||
|
@ -301,13 +303,20 @@ public class Versions {
|
|||
printargs("checksrc16", args);
|
||||
expectedPass(args, List.of("New7.java", "New8.java", "New10.java", "New11.java",
|
||||
"New14.java", "New15.java", "New16.java"));
|
||||
// Add expectedFail after new language features added in a later release.
|
||||
expectedFail(args, List.of("New17.java"));
|
||||
}
|
||||
|
||||
protected void checksrc17(List<String> args) {
|
||||
printargs("checksrc17", args);
|
||||
expectedPass(args, List.of("New7.java", "New8.java", "New10.java", "New11.java",
|
||||
"New14.java", "New15.java", "New16.java"));
|
||||
"New14.java", "New15.java", "New16.java", "New17.java"));
|
||||
// Add expectedFail after new language features added in a later release.
|
||||
}
|
||||
|
||||
protected void checksrc18(List<String> args) {
|
||||
printargs("checksrc18", args);
|
||||
expectedPass(args, List.of("New7.java", "New8.java", "New10.java", "New11.java",
|
||||
"New14.java", "New15.java", "New16.java", "New17.java"));
|
||||
// Add expectedFail after new language features added in a later release.
|
||||
}
|
||||
|
||||
|
@ -535,6 +544,21 @@ public class Versions {
|
|||
}
|
||||
"""
|
||||
);
|
||||
|
||||
/*
|
||||
* Create a file with a new feature in 17, not in 16 : sealed classes
|
||||
*/
|
||||
writeSourceFile("New17.java",
|
||||
"""
|
||||
public class New17 {
|
||||
public static sealed class Seal {}
|
||||
|
||||
public static final class Pinniped extends Seal {}
|
||||
public static final class TaperedThread extends Seal {}
|
||||
public static final class Wax extends Seal {}
|
||||
}
|
||||
"""
|
||||
);
|
||||
}
|
||||
|
||||
protected boolean checkClassFileVersion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue