Skip to content

Commit

Permalink
Avoid crashing on early 1.8 openjdk vms (#4789)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit committed Dec 5, 2021
1 parent 99e82d7 commit 3f31808
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public static void initialize(Instrumentation inst, File javaagentFile, boolean
* @return true for oracle 1.8 before 1.8.0_40
*/
private static boolean isEarlyOracle18() {
// Java HotSpot(TM) 64-Bit Server VM
// Java HotSpot(TM) 64-Bit Server VM or OpenJDK 64-Bit Server VM
String vmName = System.getProperty("java.vm.name");
if (!vmName.contains("HotSpot")) {
if (!vmName.contains("HotSpot") && !vmName.contains("OpenJDK")) {
return false;
}
// 1.8.0_31
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static void main(String... args) {

public void test() {
// run loop enough times for jit compiler to kick in
for (int i = 0; i < 10_000; i++) {
for (int i = 0; i < 100_000; i++) {
this.bar(this::foo);
}
}
Expand Down

0 comments on commit 3f31808

Please sign in to comment.