Skip to content

Commit 240061c

Browse files
committed
Returning false if file does not end with .class
When using scriptOutputDir as a param to -javaagent, the folder might contain non Java class files. Ensuring that the files loaded into BTrace is a .class file.
1 parent 2e5b0f0 commit 240061c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • btrace-agent/src/main/java/org/openjdk/btrace/agent

btrace-agent/src/main/java/org/openjdk/btrace/agent/Main.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,10 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc)
750750
}
751751

752752
private static boolean loadBTraceScript(String filePath, boolean traceToStdOut) {
753+
if (!filePath.endsWith(".class")) {
754+
return false;
755+
}
756+
753757
try {
754758
String scriptName = "";
755759
String scriptParent = "";

0 commit comments

Comments
 (0)