Skip to content

Commit 01520c6

Browse files
committed
Add comment that constructor is used by tests
1 parent 8f413da commit 01520c6

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentClassLoader.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ public class AgentClassLoader extends URLClassLoader {
6969
private final boolean isSecurityManagerSupportEnabled;
7070
private final Manifest manifest;
7171

72-
public AgentClassLoader(File javaagentFile, String internalJarFileName) {
73-
this(javaagentFile, internalJarFileName, false);
72+
// Used by tests
73+
public AgentClassLoader(File javaagentFile) {
74+
this(javaagentFile, "", false);
7475
}
7576

7677
/**

javaagent-bootstrap/src/test/groovy/io/opentelemetry/javaagent/bootstrap/AgentClassLoaderTest.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AgentClassLoaderTest extends Specification {
1919
def className2 = 'some/class/Name2'
2020
// any jar would do, use opentelemety sdk
2121
URL testJarLocation = JavaVersionSpecific.getProtectionDomain().getCodeSource().getLocation()
22-
AgentClassLoader loader = new AgentClassLoader(new File(testJarLocation.toURI()), "")
22+
AgentClassLoader loader = new AgentClassLoader(new File(testJarLocation.toURI()))
2323
Phaser threadHoldLockPhase = new Phaser(2)
2424
Phaser acquireLockFromMainThreadPhase = new Phaser(2)
2525

@@ -58,7 +58,7 @@ class AgentClassLoaderTest extends Specification {
5858
boolean jdk8 = "1.8" == System.getProperty("java.specification.version")
5959
// sdk is a multi release jar
6060
URL multiReleaseJar = JavaVersionSpecific.getProtectionDomain().getCodeSource().getLocation()
61-
AgentClassLoader loader = new AgentClassLoader(new File(multiReleaseJar.toURI()), "") {
61+
AgentClassLoader loader = new AgentClassLoader(new File(multiReleaseJar.toURI())) {
6262
@Override
6363
protected String getClassSuffix() {
6464
return ""

javaagent-tooling/javaagent-tooling-java9/src/test/groovy/UnsafeTest.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class UnsafeTest extends Specification {
1414
setup:
1515
ByteBuddyAgent.install()
1616
URL testJarLocation = AgentClassLoader.getProtectionDomain().getCodeSource().getLocation()
17-
AgentClassLoader loader = new AgentClassLoader(new File(testJarLocation.toURI()), "")
17+
AgentClassLoader loader = new AgentClassLoader(new File(testJarLocation.toURI()))
1818
UnsafeInitializer.initialize(ByteBuddyAgent.getInstrumentation(), loader, false)
1919

2020
expect:

0 commit comments

Comments
 (0)