-
Notifications
You must be signed in to change notification settings - Fork 323
Decouple Gradle JDK from JDK8 #9514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
🎯 Code Coverage 🔗 Commit SHA: e8ab4c6 | Docs | Was this helpful? Give us feedback! |
c709cb4 to
5df8195
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 60 metrics, 5 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.55.0-SNAPSHOT~e8ab4c6c59, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.027 s) : 0, 1026621
Total [baseline] (8.675 s) : 0, 8674692
Agent [candidate] (1.028 s) : 0, 1027956
Total [candidate] (8.694 s) : 0, 8693659
section iast
Agent [baseline] (1.15 s) : 0, 1150034
Total [baseline] (9.278 s) : 0, 9278150
Agent [candidate] (1.158 s) : 0, 1158010
Total [candidate] (9.288 s) : 0, 9288260
gantt
title insecure-bank - break down per module: candidate=1.55.0-SNAPSHOT~e8ab4c6c59, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.471 ms) : 0, 1471
crashtracking [candidate] (1.481 ms) : 0, 1481
BytebuddyAgent [baseline] (700.305 ms) : 0, 700305
BytebuddyAgent [candidate] (701.288 ms) : 0, 701288
GlobalTracer [baseline] (243.154 ms) : 0, 243154
GlobalTracer [candidate] (244.004 ms) : 0, 244004
AppSec [baseline] (33.104 ms) : 0, 33104
AppSec [candidate] (33.099 ms) : 0, 33099
Debugger [baseline] (6.489 ms) : 0, 6489
Debugger [candidate] (6.48 ms) : 0, 6480
Remote Config [baseline] (709.824 µs) : 0, 710
Remote Config [candidate] (703.222 µs) : 0, 703
Telemetry [baseline] (9.233 ms) : 0, 9233
Telemetry [candidate] (9.317 ms) : 0, 9317
Flare Poller [baseline] (10.987 ms) : 0, 10987
Flare Poller [candidate] (10.321 ms) : 0, 10321
section iast
crashtracking [baseline] (1.466 ms) : 0, 1466
crashtracking [candidate] (1.477 ms) : 0, 1477
BytebuddyAgent [baseline] (814.086 ms) : 0, 814086
BytebuddyAgent [candidate] (820.106 ms) : 0, 820106
GlobalTracer [baseline] (231.732 ms) : 0, 231732
GlobalTracer [candidate] (232.96 ms) : 0, 232960
IAST [baseline] (26.427 ms) : 0, 26427
IAST [candidate] (26.864 ms) : 0, 26864
AppSec [baseline] (35.297 ms) : 0, 35297
AppSec [candidate] (35.585 ms) : 0, 35585
Debugger [baseline] (6.148 ms) : 0, 6148
Debugger [candidate] (6.168 ms) : 0, 6168
Remote Config [baseline] (616.979 µs) : 0, 617
Remote Config [candidate] (609.792 µs) : 0, 610
Telemetry [baseline] (8.724 ms) : 0, 8724
Telemetry [candidate] (8.739 ms) : 0, 8739
Flare Poller [baseline] (4.307 ms) : 0, 4307
Flare Poller [candidate] (4.179 ms) : 0, 4179
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.55.0-SNAPSHOT~e8ab4c6c59, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.034 s) : 0, 1033630
Total [baseline] (10.757 s) : 0, 10756598
Agent [candidate] (1.027 s) : 0, 1027194
Total [candidate] (10.704 s) : 0, 10704231
section appsec
Agent [baseline] (1.194 s) : 0, 1194262
Total [baseline] (10.958 s) : 0, 10957641
Agent [candidate] (1.195 s) : 0, 1195433
Total [candidate] (11.021 s) : 0, 11021005
section iast
Agent [baseline] (1.152 s) : 0, 1151975
Total [baseline] (10.938 s) : 0, 10938458
Agent [candidate] (1.155 s) : 0, 1154748
Total [candidate] (11.044 s) : 0, 11044387
section profiling
Agent [baseline] (1.171 s) : 0, 1171422
Total [baseline] (11.014 s) : 0, 11013893
Agent [candidate] (1.173 s) : 0, 1172995
Total [candidate] (11.032 s) : 0, 11032363
gantt
title petclinic - break down per module: candidate=1.55.0-SNAPSHOT~e8ab4c6c59, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.474 ms) : 0, 1474
crashtracking [candidate] (1.473 ms) : 0, 1473
BytebuddyAgent [baseline] (704.702 ms) : 0, 704702
BytebuddyAgent [candidate] (699.223 ms) : 0, 699223
GlobalTracer [baseline] (245.185 ms) : 0, 245185
GlobalTracer [candidate] (243.981 ms) : 0, 243981
AppSec [baseline] (33.32 ms) : 0, 33320
AppSec [candidate] (33.106 ms) : 0, 33106
Debugger [baseline] (6.516 ms) : 0, 6516
Debugger [candidate] (6.433 ms) : 0, 6433
Remote Config [baseline] (711.838 µs) : 0, 712
Remote Config [candidate] (713.144 µs) : 0, 713
Telemetry [baseline] (9.317 ms) : 0, 9317
Telemetry [candidate] (9.271 ms) : 0, 9271
Flare Poller [baseline] (11.149 ms) : 0, 11149
Flare Poller [candidate] (11.719 ms) : 0, 11719
section appsec
crashtracking [baseline] (1.459 ms) : 0, 1459
crashtracking [candidate] (1.459 ms) : 0, 1459
BytebuddyAgent [baseline] (718.273 ms) : 0, 718273
BytebuddyAgent [candidate] (718.226 ms) : 0, 718226
GlobalTracer [baseline] (234.132 ms) : 0, 234132
GlobalTracer [candidate] (235.056 ms) : 0, 235056
IAST [baseline] (24.792 ms) : 0, 24792
IAST [candidate] (24.807 ms) : 0, 24807
AppSec [baseline] (175.338 ms) : 0, 175338
AppSec [candidate] (175.755 ms) : 0, 175755
Debugger [baseline] (6.113 ms) : 0, 6113
Debugger [candidate] (6.031 ms) : 0, 6031
Remote Config [baseline] (649.484 µs) : 0, 649
Remote Config [candidate] (648.384 µs) : 0, 648
Telemetry [baseline] (8.455 ms) : 0, 8455
Telemetry [candidate] (8.373 ms) : 0, 8373
Flare Poller [baseline] (4.013 ms) : 0, 4013
Flare Poller [candidate] (3.95 ms) : 0, 3950
section iast
crashtracking [baseline] (1.48 ms) : 0, 1480
crashtracking [candidate] (1.462 ms) : 0, 1462
BytebuddyAgent [baseline] (815.598 ms) : 0, 815598
BytebuddyAgent [candidate] (816.888 ms) : 0, 816888
GlobalTracer [baseline] (232.327 ms) : 0, 232327
GlobalTracer [candidate] (233.198 ms) : 0, 233198
IAST [baseline] (26.442 ms) : 0, 26442
IAST [candidate] (26.692 ms) : 0, 26692
AppSec [baseline] (35.433 ms) : 0, 35433
AppSec [candidate] (35.618 ms) : 0, 35618
Debugger [baseline] (6.096 ms) : 0, 6096
Debugger [candidate] (6.16 ms) : 0, 6160
Remote Config [baseline] (597.16 µs) : 0, 597
Remote Config [candidate] (614.256 µs) : 0, 614
Telemetry [baseline] (8.568 ms) : 0, 8568
Telemetry [candidate] (8.642 ms) : 0, 8642
Flare Poller [baseline] (4.135 ms) : 0, 4135
Flare Poller [candidate] (4.16 ms) : 0, 4160
section profiling
crashtracking [baseline] (1.44 ms) : 0, 1440
crashtracking [candidate] (1.479 ms) : 0, 1479
BytebuddyAgent [baseline] (727.193 ms) : 0, 727193
BytebuddyAgent [candidate] (728.405 ms) : 0, 728405
GlobalTracer [baseline] (219.313 ms) : 0, 219313
GlobalTracer [candidate] (219.092 ms) : 0, 219092
AppSec [baseline] (33.393 ms) : 0, 33393
AppSec [candidate] (33.358 ms) : 0, 33358
Debugger [baseline] (7.307 ms) : 0, 7307
Debugger [candidate] (8.116 ms) : 0, 8116
Remote Config [baseline] (693.054 µs) : 0, 693
Remote Config [candidate] (701.072 µs) : 0, 701
Telemetry [baseline] (15.857 ms) : 0, 15857
Telemetry [candidate] (15.148 ms) : 0, 15148
Flare Poller [baseline] (4.185 ms) : 0, 4185
Flare Poller [candidate] (4.212 ms) : 0, 4212
ProfilingAgent [baseline] (108.478 ms) : 0, 108478
ProfilingAgent [candidate] (108.52 ms) : 0, 108520
Profiling [baseline] (109.756 ms) : 0, 109756
Profiling [candidate] (110.072 ms) : 0, 110072
LoadParameters
See matching parameters
SummaryFound 5 performance improvements and 1 performance regressions! Performance is the same for 6 metrics, 12 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~e8ab4c6c59, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section baseline
no_agent (37.387 ms) : 37089, 37685
. : milestone, 37387,
appsec (48.616 ms) : 48186, 49045
. : milestone, 48616,
code_origins (44.166 ms) : 43801, 44530
. : milestone, 44166,
iast (45.971 ms) : 45568, 46374
. : milestone, 45971,
profiling (46.782 ms) : 46370, 47194
. : milestone, 46782,
tracing (46.312 ms) : 45911, 46712
. : milestone, 46312,
section candidate
no_agent (37.181 ms) : 36878, 37483
. : milestone, 37181,
appsec (46.83 ms) : 46419, 47240
. : milestone, 46830,
code_origins (43.552 ms) : 43173, 43931
. : milestone, 43552,
iast (45.293 ms) : 44907, 45678
. : milestone, 45293,
profiling (48.902 ms) : 48459, 49346
. : milestone, 48902,
tracing (43.805 ms) : 43429, 44181
. : milestone, 43805,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~e8ab4c6c59, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section baseline
no_agent (4.366 ms) : 4314, 4418
. : milestone, 4366,
iast (10.219 ms) : 10047, 10391
. : milestone, 10219,
iast_FULL (13.891 ms) : 13612, 14171
. : milestone, 13891,
iast_GLOBAL (10.837 ms) : 10645, 11029
. : milestone, 10837,
profiling (9.433 ms) : 9260, 9606
. : milestone, 9433,
tracing (7.955 ms) : 7833, 8078
. : milestone, 7955,
section candidate
no_agent (4.378 ms) : 4326, 4429
. : milestone, 4378,
iast (9.624 ms) : 9463, 9784
. : milestone, 9624,
iast_FULL (14.396 ms) : 14099, 14694
. : milestone, 14396,
iast_GLOBAL (10.663 ms) : 10473, 10854
. : milestone, 10663,
profiling (8.969 ms) : 8830, 9108
. : milestone, 8969,
tracing (7.477 ms) : 7371, 7582
. : milestone, 7477,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~e8ab4c6c59, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section baseline
no_agent (15.457 s) : 15457000, 15457000
. : milestone, 15457000,
appsec (15.284 s) : 15284000, 15284000
. : milestone, 15284000,
iast (18.656 s) : 18656000, 18656000
. : milestone, 18656000,
iast_GLOBAL (18.377 s) : 18377000, 18377000
. : milestone, 18377000,
profiling (14.717 s) : 14717000, 14717000
. : milestone, 14717000,
tracing (14.951 s) : 14951000, 14951000
. : milestone, 14951000,
section candidate
no_agent (15.273 s) : 15273000, 15273000
. : milestone, 15273000,
appsec (15.173 s) : 15173000, 15173000
. : milestone, 15173000,
iast (18.555 s) : 18555000, 18555000
. : milestone, 18555000,
iast_GLOBAL (17.947 s) : 17947000, 17947000
. : milestone, 17947000,
profiling (15.646 s) : 15646000, 15646000
. : milestone, 15646000,
tracing (14.918 s) : 14918000, 14918000
. : milestone, 14918000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~e8ab4c6c59, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section baseline
no_agent (1.473 ms) : 1461, 1484
. : milestone, 1473,
appsec (3.72 ms) : 3502, 3939
. : milestone, 3720,
iast (2.205 ms) : 2141, 2268
. : milestone, 2205,
iast_GLOBAL (2.262 ms) : 2197, 2328
. : milestone, 2262,
profiling (2.067 ms) : 2014, 2120
. : milestone, 2067,
tracing (2.016 ms) : 1966, 2066
. : milestone, 2016,
section candidate
no_agent (1.472 ms) : 1461, 1484
. : milestone, 1472,
appsec (3.726 ms) : 3507, 3945
. : milestone, 3726,
iast (2.207 ms) : 2144, 2271
. : milestone, 2207,
iast_GLOBAL (2.249 ms) : 2185, 2313
. : milestone, 2249,
profiling (2.075 ms) : 2021, 2128
. : milestone, 2075,
tracing (2.031 ms) : 1981, 2081
. : milestone, 2031,
|
1555846 to
680c4b1
Compare
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
|
Note I didn't pursue the approach of using toolchains for every compile tasks as CI didn't like launching the compiler as it breaks CI. Example failed stacktracesInstead, this approach relies on the fact that the JVM that runs the Gradle daemon can compile to Java 1.8. Which still holds true for Java 25. |
680c4b1 to
692a27a
Compare
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
968cecd to
c04c53a
Compare
Debugger benchmarksParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 7 metrics, 6 unstable metrics.
See unchanged results
Request duration reports for reportsgantt
title reports - request duration [CI 0.99] : candidate=None, baseline=None
dateFormat X
axisFormat %s
section baseline
noprobe (336.33 µs) : 266, 407
. : milestone, 336,
basic (286.334 µs) : 277, 296
. : milestone, 286,
loop (8.966 ms) : 8960, 8972
. : milestone, 8966,
section candidate
noprobe (312.793 µs) : 287, 338
. : milestone, 313,
basic (273.792 µs) : 268, 279
. : milestone, 274,
loop (8.965 ms) : 8960, 8969
. : milestone, 8965,
|
a2b46f0 to
a02556a
Compare
efd5777 to
fa248d7
Compare
…Collection::getFirst in JDK 21
# Conflicts: # dd-java-agent/instrumentation/kafka/kafka-clients-3.8/build.gradle # Conflicts: # dd-java-agent/agent-profiling/profiling-controller-jfr/build.gradle # dd-java-agent/instrumentation/play/play-2.6/build.gradle # dd-java-agent/instrumentation/wildfly-9.0/build.gradle # dd-smoke-tests/concurrent/java-25/build.gradle # utils/socket-utils/build.gradle.kts # Conflicts: # dd-java-agent/agent-bootstrap/build.gradle # dd-java-agent/agent-builder/build.gradle # dd-java-agent/agent-profiling/profiling-controller-jfr/build.gradle # dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/build.gradle # dd-java-agent/instrumentation/exception-profiling/build.gradle # dd-java-agent/instrumentation/graal/native-image/build.gradle # dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle # dd-java-agent/instrumentation/kafka/kafka-clients-3.8/build.gradle # dd-java-agent/instrumentation/liberty-20/build.gradle # dd-java-agent/instrumentation/micronaut/http-server-netty-4.0/build.gradle # dd-java-agent/instrumentation/play/play-2.6/build.gradle # dd-java-agent/instrumentation/spring/spring-scheduling-3.1/build.gradle # dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/build.gradle # dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/build.gradle # dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10/build.gradle # dd-java-agent/instrumentation/wildfly-9.0/build.gradle
…ource/target # Conflicts: # dd-java-agent/agent-tooling/build.gradle
When Groovy compiles this code against JDK 21 **but targeting Java 8**,
```
URLClassLoader loader = new URLClassLoader(classpath, null, null) {
@OverRide
Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
...
}
}
```
Groovy will generate super class synthetic accessor methods like
* `super$2$loadClass(Ljava/lang/String;)Ljava/lang/Class;`
* `super$2$loadClass(Ljava/lang/String;Z)Ljava/lang/Class;`
* `super$2$loadClass(Ljava/lang/Module;Ljava/lang/String;)Ljava/lang/Class;`
`java.lang.Module` being missing from Java 8 won't run.
java.lang.NoClassDefFoundError: java/lang/Module
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2729)
at java.lang.Class.privateGetPublicMethods(Class.java:2930)
at java.lang.Class.getMethods(Class.java:1643)
at groovy.lang.MetaClassImpl.inheritInterfaceNewMetaMethods(MetaClassImpl.java:628)
at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:368)
at groovy.lang.MetaClassImpl.reinitialize(MetaClassImpl.java:3381)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3376)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:273)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:315)
at datadog.trace.agent.test.BaseExceptionHandlerTest$1.$getStaticMetaClass(BaseExceptionHandlerTest.groovy)
at datadog.trace.agent.test.BaseExceptionHandlerTest$1.<init>(BaseExceptionHandlerTest.groovy)
at datadog.trace.agent.test.BaseExceptionHandlerTest.$spock_feature_1_1(BaseExceptionHandlerTest.groovy:131)
...
Caused by: java.lang.ClassNotFoundException: java.lang.Module
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
...
When Groovy compiles this code against JDK 21 **but targeting Java 8**,
```
private static final class MisbehavingClassLoader extends ClassLoader { ... }
```
Groovy will generate super class synthetic accessor methods like
* `super$2$loadClass(Ljava/lang/String;)Ljava/lang/Class;`
* `super$2$loadClass(Ljava/lang/String;Z)Ljava/lang/Class;`
* `super$2$loadClass(Ljava/lang/Module;Ljava/lang/String;)Ljava/lang/Class;`
`java.lang.Module` being missing from Java 8 won't run.
java.lang.NoClassDefFoundError: java/lang/Module
at java.lang.Class.privateGetDeclaredMethods(Class.java:2729)
at java.lang.Class.privateGetPublicMethods(Class.java:2930)
at java.lang.Class.getMethods(Class.java:1643)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1336)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1197)
at java.beans.Introspector.getBeanInfo(Introspector.java:426)
at java.beans.Introspector.getBeanInfo(Introspector.java:173)
at datadog.trace.civisibility.source.ByteCodeLinesResolverTest.test returns empty method lines when class cannot be loaded(ByteCodeLinesResolverTest.groovy:45)
Caused by: java.lang.ClassNotFoundException: java.lang.Module
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 8 more
…ation. There was a `NoClassDefFoundError` of `java.lang.constant.Constable` when run on JDK8, this happened because the `Delegate` annotation makes Groovy adds the interfaces of the delegated object to the enclosing class. Since JDK12 types like `Integer`, `String` implement `Constable` this fails when the class is loaded on JDK8 or 11. See groovy/groovy-eclipse#1436 java.lang.NoClassDefFoundError: java/lang/constant/Constable at java.lang.ClassLoader.defineClass(ClassLoader.java:756) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:473) at java.net.URLClassLoader.access$100(URLClassLoader.java:74) at java.net.URLClassLoader$1.run(URLClassLoader.java:369) at java.net.URLClassLoader$1.run(URLClassLoader.java:363) at java.net.URLClassLoader.findClass(URLClassLoader.java:362) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) at com.datadog.appsec.event.data.ObjectIntrospectionSpecification.conversion of an element throws(ObjectIntrospectionSpecification.groovy:305) Caused by: java.lang.ClassNotFoundException: java.lang.constant.Constable at java.net.URLClassLoader.findClass(URLClassLoader.java:387) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ... 11 more
…or getClass on HttpRequest Instead, the byte code is now an invokevirtual on Object as the javac in JDK8 does
…with new types in JDK9 E.g. methods with `java.sql.ShardingKey`, while these methods are default, Groovy still implements them (implementation actually invokes the interface default method). org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not complete execution for Gradle Test Executor 66. at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:65) ... Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:165) ... Caused by: org.junit.platform.commons.JUnitException: ClassSelector [className = 'foo.bar.IastInstrumentedConnection', classLoader = sun.misc.Launcher$AppClassLoader@73d16e93] resolution failed at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:103) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83) ... Caused by: java.lang.NoClassDefFoundError: java/sql/ShardingKey at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2729) at java.lang.Class.privateGetPublicMethods(Class.java:2930)
ProcessManager uses the `CharBuffer.flip` method, which is coming from the super class in JDK 8 so its signature is `()Ljava.nio.Buffer`, but since JDK9 `CharBuffer` overrides it, in the bytecode the signatures becomes `()Ljava.nio.CharBuffer`. This code fails when running with testJvm=8.
…erface for getClass on HttpRequest" This reverts commit bc1b15c because muzzle now handles https://bugs.openjdk.org/browse/JDK-8272715 since #9649
a5eec7f to
e8ab4c6
Compare
What Does This Do
🙌 This allows to compile, test and produce a correct jar when the JDK running Gradle is not 1.8. I.e. it's possible to run Gradle with JDK 21.
Another win by decoupling the Gradle JDK, the build better encodes the expected bytecode target of the produced jars.
This work resumes what was started in #8883, and maybe before that. Instead of applying the toolchain for every compile tasks, it relies on the ability of the JVM running the Gradle Daemon to compile Java 1.8 (note that Java 25 can still compile to Java 1.8, and Gradle 8.14.3 carn on JDK 24 at most).
In order to achieve this, work had to be done on the default compiler configuration, and customized compiler configuration which was done via
setJavaVersionImportant
setJavaVersionwas renamed toconfigureCompiler, and now takes multiple arguments the last two are optional:E.g. in IntelliJ using JDK 24 works for compiling, and running tests
Settings | Build, Execution, Deployment | Build Tools | Gradle

Motivation
This preliminary work should unlocks other tasks:
Additional Notes
The produced jars, found on the GH releases page, have been checked against a tool I crafted. Other tools didn't work or didn't perform what was needed.
Note
🔗 https://github.com/bric3/jardiff
Shortcomings:
Ran the following command on this branch (folder
dd-trace-java), and onmaster(folderdd-trace-java-copy-1)Assuming that
jardiffrunsjava -jar jardiff/build/shadowed-app/jardiff-0.1.0-SNAPSHOT.jarusing java 25. Also the following snippet usedeltarender the diff, but it's not strictly necessary.The following diffs have been performed:
dd-java-agentjardiff ../dd-trace-java{-copy-1,}/dd-java-agent/build/libs/dd-java-agent-1.54.0-SNAPSHOT.jar -c classdata --class-text-producer=class-file-version --exclude "**/*.yaml,**/*.MF,**/*.version,*.version" | delta --syntax-theme=GitHub --lightbyte code differences, appear to be only order of some fields
Remove the
--class-text-producer=class-file-versiondd-trace-apijardiff ../dd-trace-java{-copy-1,}/dd-trace-api/build/libs/dd-trace-api-1.54.0-SNAPSHOT.jar -c classdata --exclude "**/*.yaml,**/*.MF,**/*.version,*.version" | delta --syntax-theme=GitHub --lightdd-trace-otjardiff ../dd-trace-java{-copy-1,}/dd-trace-ot/build/libs/dd-trace-ot-1.54.0-SNAPSHOT.jar -c classdata --exclude "**/*.yaml,**/*.MF,**/*.version,*.version" | delta --syntax-theme=GitHub --lightNote
While running compiling and generating the code using a more recent JDK. I noticed the following change in bytecode for some methods, this is legal and will run correctly on JDK 8.


Thanks to @mcculls for digging into the reasons, and updating muzzle in #9649
Contributor Checklist
type:and (comp:orinst:) labels in addition to any usefull labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]