Fix method parameters JVM bug by jpbempel · Pull Request #10521 · DataDog/dd-trace-java

shatzi

@jpbempel

Prevent classfiles with Method Parameters attribute
(javac -parameters) to be (re)transformed when on JDK < 19.
Spring 6+ or SpringBoot3+ rely exclusively on method parameters
to get param name and if the attribute is not present throw an
exception and returns 500 on endpoints.
see OpenJDK bug JDK-8240908.
we are scanning method with at least on parameter to detect if the
class was compiled with method parameters attribute and if the JDK
is < 19 we prevent instrumentation to happen.
Even at load time we prevent it because we need to call retransform
to remove instrumentation. Therefore the attribute can be strip at
that time.

@jpbempel

canonical record constructor has method parameters attribute

@jpbempel

@jpbempel

@jpbempel

@jpbempel

@jpbempel

@jpbempel

This was referenced

Mar 4, 2026