Skip to content

Commit d63f220

Browse files
committed
PR review: inline constants
1 parent b3bf09b commit d63f220

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

internal-api/src/main/java/datadog/trace/api/git/EmbeddedGitInfoBuilder.java

+10-21
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,22 @@ public class EmbeddedGitInfoBuilder implements GitInfoBuilder {
1313

1414
private static final Logger log = LoggerFactory.getLogger(EmbeddedGitInfoBuilder.class);
1515

16-
// Spring boot fat jars and wars should have the git.properties file in a specific path,
17-
// guaranteeing that it's not coming from a dependency
18-
private static final String SPRING_BOOT_JAR_EMBEDDED_DATADOG_GIT_PROPERTIES_FILE_NAME =
19-
"BOOT-INF/classes/datadog_git.properties";
20-
private static final String SPRING_BOOT_JAR_EMBEDDED_GIT_PROPERTIES_FILE_NAME =
21-
"BOOT-INF/classes/git.properties";
22-
private static final String WAR_EMBEDDED_DATADOG_GIT_PROPERTIES_FILE_NAME =
23-
"WEB-INF/classes/datadog_git.properties";
24-
private static final String WAR_EMBEDDED_GIT_PROPERTIES_FILE_NAME =
25-
"WEB-INF/classes/git.properties";
26-
// If we can't find the files above, probably because we're not in a spring context, we can look
27-
// at the root of the classpath.
28-
// Since it could be tainted by dependencies, we're looking for a specific datadog_git.properties
29-
// file.
30-
private static final String EMBEDDED_DATADOOG_GIT_PROPERTIES_FILE_NAME = "datadog_git.properties";
31-
3216
private final List<String> resourceNames;
3317

3418
public EmbeddedGitInfoBuilder() {
3519
// Order is important here, from the most reliable sources to the least reliable ones
3620
this(
3721
Arrays.asList(
38-
SPRING_BOOT_JAR_EMBEDDED_DATADOG_GIT_PROPERTIES_FILE_NAME,
39-
SPRING_BOOT_JAR_EMBEDDED_GIT_PROPERTIES_FILE_NAME,
40-
WAR_EMBEDDED_DATADOG_GIT_PROPERTIES_FILE_NAME,
41-
WAR_EMBEDDED_GIT_PROPERTIES_FILE_NAME,
42-
EMBEDDED_DATADOOG_GIT_PROPERTIES_FILE_NAME));
22+
// Spring boot fat jars and wars should have the git.properties file in the following
23+
// specific paths, guaranteeing that it's not coming from a dependency
24+
"BOOT-INF/classes/datadog_git.properties",
25+
"BOOT-INF/classes/git.properties",
26+
"WEB-INF/classes/datadog_git.properties",
27+
"WEB-INF/classes/git.properties",
28+
// If we can't find the files above, probably because we're not in a spring context, we
29+
// can look at the root of the classpath. Since it could be tainted by dependencies,
30+
// we're looking for a specific datadog_git.properties file.
31+
"datadog_git.properties"));
4332
}
4433

4534
EmbeddedGitInfoBuilder(List<String> resourceNames) {

0 commit comments

Comments
 (0)