Skip to content

Commit 0f41106

Browse files
authored
Preserve old logic to extract jar file name (#8756)
1 parent 889d878 commit 0f41106

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal-api/src/main/java/datadog/trace/api/env/CapturedEnvironment.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ private String autodetectServiceName() {
103103
return siteName;
104104
}
105105

106-
if (processInfo.jarFile != null) {
107-
final String jarName = processInfo.jarFile.getName();
108-
return jarName.substring(0, jarName.length() - 4); // strip .jar
106+
// preserve the original logic that is case sensitive on the .jar extension
107+
if (processInfo.jarFile != null && processInfo.jarFile.getName().endsWith(".jar")) {
108+
return processInfo.jarFile.getName().replace(".jar", "");
109109
} else {
110110
return processInfo.mainClass;
111111
}

0 commit comments

Comments
 (0)