Fixing resource leak
To check for existence, switching from getResourceAsStream to getResource
MODIFY
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java
@@ -350,7 +350,6 @@ public class Agent {
// nothing to do with JDK but this should be safe because only thing this does is to delay
// tracer install
final String jfrClassResourceName = "jdk.jfr.Recording".replace('.', '/') + ".class";
- return Thread.currentThread().getContextClassLoader().getResourceAsStream(jfrClassResourceName)
- != null;
+ return Thread.currentThread().getContextClassLoader().getResource(jfrClassResourceName) != null;
}
}

Fixing resource leak

To check for existence, switching from getResourceAsStream to getResource