-
Notifications
You must be signed in to change notification settings - Fork 778
Description
The OpenJ9 JVM is failing a common compatibility test because it does not output the required deprecation warning when launched with the obsolete HotSpot flag -XX:+TLABStats.
This behavior prevents test suites from validating command-line compatibility and offers poor guidance to users migrating from OpenJDK.
``
public class test {
public static void main(String[] args) {
String javaCommand = System.getProperty("java.home") + "/bin/java";
try {
ProcessBuilder pb = new ProcessBuilder(javaCommand, "-XX:+TLABStats", "-version");
pb.redirectErrorStream(true);
Process process = pb.start();
String output = new BufferedReader(new InputStreamReader(process.getInputStream()))
.lines()
.reduce("", (acc, line) -> acc + line + "\n");
int exitCode = process.waitFor();
boolean foundDeprecationWarning = output.toLowerCase().contains("tlabstats") &&
output.toLowerCase().contains("deprecat");
if (!foundDeprecationWarning) {
throw new AssertionError("Expected deprecation warning for TLABStats flag was not found. Exit Code: " + exitCode + "\nOutput:\n" + output);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
}
``
The output shows that the JVM runs normally, but no deprecation warning is printed:
`
Exception in thread "main" java.lang.AssertionError: Expected deprecation warning for TLABStats flag was not found. Exit Code: 0
Output:
openjdk version "17.0.13" 2024-10-15
IBM Semeru Runtime Open Edition 17.0.13.11 (build 17.0.13+11)
Eclipse OpenJ9 VM 17.0.13.11 (build openj9-0.48.0, JRE 17 Linux amd64-64-Bit Compressed References 20241015_886 (JIT enabled, AOT enabled)
OpenJ9 - 1d58314
OMR - d10a4d553
JCL - d17dd58f8d7 based on jdk-17.0.13+11)
On HotSpot, deprecated or obsolete options like -XX:+TLABStats typically produce explicit warnings such as:
“Warning: Option -XX:+TLABStats was deprecated…”
However, OpenJ9 currently handles this option silently, which breaks command-line compatibility expectations.