Skip to content

Commit

Permalink
Fix sun.misc.Unsafe generation on jdk17 (#4558)
Browse files Browse the repository at this point in the history
* Fix sun.misc.Unsafe generation on jdk17

* remove jmxremote argument for now

* spotless

* remove unneeded annotation
  • Loading branch information
laurit committed Nov 2, 2021
1 parent 12ec0fa commit b3d9ae8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ private void addMethods() {
addMethod("arrayIndexScale", int.class, Class.class);
addMethod("addressSize", int.class);
addMethod("pageSize", int.class);
addMethod("defineAnonymousClass", Class.class, Class.class, byte[].class, Object[].class);
addMethod("getLoadAverage", int.class, double[].class, int.class);
// defineAnonymousClass was removed in jdk17
addOptionalMethod(
"defineAnonymousClass", Class.class, Class.class, byte[].class, Object[].class);
// this method is missing from internal unsafe in some jdk11 versions
addOptionalMethod("invokeCleaner", void.class, ByteBuffer.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
package io.opentelemetry.smoketest

// jetty test with java module system
@AppServer(version = "11.0.7", jdk = "11")
class JettyJpmsSmokeTest extends AppServerTest {
abstract class JettyJpmsSmokeTest extends AppServerTest {

@Override
protected String getTargetImagePrefix() {
Expand All @@ -20,3 +19,10 @@ class JettyJpmsSmokeTest extends AppServerTest {
return ["java", "-jar", "/server/start.jar", "--jpms"]
}
}

@AppServer(version = "11.0.7", jdk = "11")
class Jetty11JpmsJdk11 extends JettyJpmsSmokeTest {
}
@AppServer(version = "11.0.7", jdk = "17")
class Jetty11JpmsJdk17 extends JettyJpmsSmokeTest {
}

0 comments on commit b3d9ae8

Please sign in to comment.