Fixing resource leak

To check for existence, switching from getResourceAsStream to getResource
This commit is contained in:
dougqh 2019-11-18 10:52:23 -05:00
parent 42a3e01086
commit 022257ee55
1 changed files with 1 additions and 2 deletions

View File

@ -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;
}
}