Skip to content

Commit c007c15

Browse files
Address review comments
1 parent a9aaae3 commit c007c15

5 files changed

Lines changed: 6 additions & 7 deletions

File tree

dd-java-agent/agent-builder/src/main/java/datadog/trace/agent/tooling/CombiningTransformerBuilder.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ private void prepareInstrumentation(InstrumenterModule module, int instrumentati
131131
helperTransformer =
132132
helperClassNames.length > 0
133133
? new HelperTransformer(
134-
module.injectHelperClassesWithAgentCodeSource(),
135-
module.getClass().getSimpleName(),
136-
helperClassNames)
134+
module.useAgentCodeSource(), module.getClass().getSimpleName(), helperClassNames)
137135
: null;
138136

139137
muzzle = new MuzzleCheck(module, instrumentationId);

dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/HelperInjector.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import net.bytebuddy.dynamic.ClassFileLocator;
2121
import net.bytebuddy.dynamic.DynamicType;
2222
import net.bytebuddy.dynamic.loading.ClassInjector;
23+
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
2324
import net.bytebuddy.utility.JavaModule;
2425
import org.slf4j.Logger;
2526
import org.slf4j.LoggerFactory;
@@ -160,7 +161,7 @@ private ProtectionDomain createProtectionDomain(final ClassLoader classLoader) {
160161
CodeSource codeSource = HelperInjector.class.getProtectionDomain().getCodeSource();
161162
return new ProtectionDomain(codeSource, null, classLoader, null);
162163
} else {
163-
return null;
164+
return ClassLoadingStrategy.NO_PROTECTION_DOMAIN;
164165
}
165166
}
166167

dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/InstrumenterModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public String[] helperClassNames() {
112112
/**
113113
* @return {@code true} if helper classes should be injected with the agent's {@link CodeSource}
114114
*/
115-
public boolean injectHelperClassesWithAgentCodeSource() {
115+
public boolean useAgentCodeSource() {
116116
return false;
117117
}
118118

dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/muzzle/MuzzleVersionScanPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static void assertInstrumentationMuzzled(
7373
final String[] helperClassNames = module.helperClassNames();
7474
if (helperClassNames.length > 0) {
7575
new HelperInjector(
76-
module.injectHelperClassesWithAgentCodeSource(),
76+
module.useAgentCodeSource(),
7777
MuzzleVersionScanPlugin.class.getSimpleName(),
7878
createHelperMap(module))
7979
.transform(null, null, testApplicationLoader, null, null);

dd-java-agent/instrumentation/gradle/src/main/groovy/datadog/trace/instrumentation/gradle/GradlePluginInjectorInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public String[] helperClassNames() {
5959
}
6060

6161
@Override
62-
public boolean injectHelperClassesWithAgentCodeSource() {
62+
public boolean useAgentCodeSource() {
6363
return true;
6464
}
6565

0 commit comments

Comments
 (0)