Skip to content

Commit

Permalink
do not use module opener for java < 9
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainJuge committed Jan 14, 2025
1 parent ab4662c commit 3235f3a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import net.bytebuddy.description.annotation.AnnotationSource;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
import net.bytebuddy.utility.JavaModule;

public final class InstrumentationModuleInstaller {

Expand Down Expand Up @@ -213,7 +214,8 @@ private AgentBuilder installInjectingModule(
.transform(ConstantAdjuster.instance())
.transform(
(builder, typeDescription, classLoader, module, protectionDomain) -> {
if (instrumentationModule instanceof ExperimentalInstrumentationModule
if (JavaModule.isSupported()
&& instrumentationModule instanceof ExperimentalInstrumentationModule
&& !openerRun.get()) {
ExperimentalInstrumentationModule experimentalModule =
(ExperimentalInstrumentationModule) instrumentationModule;
Expand Down

0 comments on commit 3235f3a

Please sign in to comment.