Skip to content

Commit 5974382

Browse files
committed
applied the overlay files from cvm8/master
1 parent d5ac2ad commit 5974382

7 files changed

Lines changed: 46 additions & 11 deletions

File tree

jdk/test/com/sun/jdi/BreakpointWithFullGC.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jdbFailIfNotPresent 'System\..*bottom of loop'
120120
jdbFailIfNotPresent 'System\..*end of test'
121121

122122
# make sure we had at least one full GC
123-
debuggeeFailIfNotPresent 'Full GC'
123+
debuggeeFailIfNotPresent 'Full GC|Pause Full'
124124

125125
# check for error message due to thread ID change
126126
debuggeeFailIfPresent \

jdk/test/com/sun/jdi/RedefineCrossEvent.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
* @run compile -g AccessSpecifierTest.java
3333
* @run compile -g AfterThreadDeathTest.java
3434
* @run compile -g ArrayRangeTest.java
35-
* @run compile -g BacktraceFieldTest.java
36-
* @run compile -g ClassesByName2Test.java
3735
* @run compile -g DebuggerThreadTest.java
3836
* @run compile -g DeleteEventRequestsTest.java
3937
* @run compile -g ExceptionEvents.java
@@ -49,8 +47,6 @@
4947
* @run main AccessSpecifierTest -redefstart -redefevent
5048
* @run main AfterThreadDeathTest -redefstart -redefevent
5149
* @run main ArrayRangeTest -redefstart -redefevent
52-
* @run main BacktraceFieldTest -redefstart -redefevent
53-
* @run main ClassesByName2Test -redefstart -redefevent
5450
* @run main DebuggerThreadTest -redefstart -redefevent
5551
* @run main DeleteEventRequestsTest -redefstart -redefevent
5652
* @run main/othervm ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.Exception

jdk/test/java/lang/System/Versions.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ static void checkClassVersion(int major, int minor, boolean expectSupported)
7272
public static void main(String [] args) throws Exception {
7373
String classVersion = getProperty("java.class.version");
7474
String javaVersion = getProperty("java.version");
75-
String VMVersion = getProperty("java.vm.version");
75+
String VMSpecVersion = getProperty("java.vm.specification.version");
7676
String runtimeVersion = getProperty("java.runtime.version");
7777
String specVersion = getProperty("java.specification.version");
7878

79+
boolean isCVM = VMSpecVersion.equals("17");
80+
7981
if (! (javaVersion.startsWith(specVersion) &&
8082
runtimeVersion.startsWith(specVersion)))
8183
throw new Exception("Invalid version-related system properties");
@@ -95,7 +97,7 @@ public static void main(String [] args) throws Exception {
9597
cl = new URLClassLoader(new URL[]{new File("./").toURL()}, null);
9698

9799
checkClassVersion(majorVersion , minorVersion , true );
98-
checkClassVersion(majorVersion + 1, minorVersion , false);
99-
checkClassVersion(majorVersion , minorVersion + 1, false);
100+
checkClassVersion(majorVersion + 1, minorVersion , isCVM);
101+
checkClassVersion(majorVersion , minorVersion + 1, isCVM);
100102
}
101103
}

jdk/test/sun/misc/Version/Version.java

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public static void main(String[] args) throws Exception {
4646
if (!jdk.equals(v1)) {
4747
throw new RuntimeException("Unmatched version: " + jdk + " vs " + v1);
4848
}
49-
VersionInfo jvm = jvmVersionInfo(System.getProperty("java.vm.version"));
49+
VersionInfo jvm = System.getProperty("java.vm.specification.version").equals("17") ?
50+
jvm17VersionInfo(System.getProperty("java.vm.version"))
51+
: jvmVersionInfo(System.getProperty("java.vm.version"));
5052
VersionInfo v2 = new VersionInfo(jvmMajorVersion(),
5153
jvmMinorVersion(),
5254
jvmMicroVersion(),
@@ -136,6 +138,36 @@ private static VersionInfo jdkVersionInfo(String version) throws Exception {
136138
return vi;
137139
}
138140

141+
private static VersionInfo jvm17VersionInfo(String version) throws Exception {
142+
// According to jdk-version.m4 in jdk17u
143+
// valid format of the version string is:
144+
// <major>[.<minor>][.<update>][.<patch>[-<version_pre>]+<build>[-<version_opt>]
145+
int major = 0;
146+
int minor = 0;
147+
int build = 0;
148+
149+
String regex = "^(?<major>[0-9]{1,2})"; // major
150+
regex += "(\\."; // separator
151+
regex += "(?<minor>[0-9]{1,3})"; // minor
152+
regex += ")?"; // minor '0' might be stripped
153+
regex += "(\\.[0-9]{1,3})?(\\.[0-9]{1,3})?"; // (not important) update, patch
154+
regex += "(\\-[a-zA-Z0-9]+)?"; // (not important) version_pre
155+
regex += "\\+(?<build>[0-9]{1,3})"; // build
156+
regex += "(\\-[a-zA-Z0-9\\.\\-]+)?$"; // (not important) version_opt
157+
158+
Pattern p = Pattern.compile(regex);
159+
Matcher m = p.matcher(version);
160+
m.matches();
161+
162+
major = Integer.parseInt(m.group("major"));
163+
minor = m.group("minor") == null ? 0 : Integer.parseInt(m.group("minor"));
164+
build = Integer.parseInt(m.group("build"));
165+
166+
VersionInfo vi = new VersionInfo(major, minor, 0, 0, "", build);
167+
System.out.printf("jvmVersionInfo: input=%s output=%s\n", version, vi);
168+
return vi;
169+
}
170+
139171
private static VersionInfo jvmVersionInfo(String version) throws Exception {
140172
try {
141173
// valid format of the version string is:

langtools/test/tools/javac/6508981/TestInferBinaryName.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ void testDirectory() throws IOException {
7777
}
7878

7979
void testSymbolArchive() throws IOException {
80-
String testClassName = "java.lang.String";
80+
String testClassName = "8".equals(System.getProperty("java.vm.specification.version")) ?
81+
"java.lang.String" : "java.lang.StringBuilder";
8182
JavaFileManager fm =
8283
getFileManager("sun.boot.class.path", USE_SYMBOL_FILE, DONT_USE_ZIP_FILE_INDEX);
8384
test("testSymbolArchive",

langtools/test/tools/javac/annotations/8218152/MalformedAnnotationProcessorTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ public void testWrongClassFileVersion(Path base) throws Exception {
133133
.setErrOutput(actualErrors);
134134
ToolBox.javac(args);
135135

136+
// cvm supports a higher bytecode version, so the test would not fail. Keep
137+
// the higher version support and skip the test.
138+
if (!System.getProperty("java.vm.specification.version").equals("8"))
139+
return;
136140
if (!actualErrors.get(0).contains("- compiler.err.proc.cant.load.class: " +
137141
"WrongClassFileVersion has been compiled by a more recent version")) {
138142
throw new AssertionError("Unexpected errors reported: " + actualErrors);

test/jtreg-ext/requires/VMProps.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected String vmFlavor() {
6969

7070
Pattern startP = Pattern.compile(".* (\\S+) VM");
7171
Matcher m = startP.matcher(vmName);
72-
if (m.matches()) {
72+
if (m.find()) {
7373
return m.group(1).toLowerCase();
7474
}
7575
return null;

0 commit comments

Comments
 (0)