|
45 | 45 | * </ul> |
46 | 46 | */ |
47 | 47 | public final class AgentBootstrap { |
48 | | - static final String LIB_INJECTION_ENABLED_FLAG = "DD_INJECTION_ENABLED"; |
49 | | - static final String LIB_INJECTION_FORCE_FLAG = "dd.inject.force"; |
| 48 | + static final String LIB_INJECTION_ENABLED_ENV_VAR = "DD_INJECTION_ENABLED"; |
| 49 | + static final String LIB_INJECTION_FORCE_SYS_PROP = "dd.inject.force"; |
50 | 50 |
|
51 | 51 | private static final Class<?> thisClass = AgentBootstrap.class; |
52 | 52 | private static final int MAX_EXCEPTION_CHAIN_LENGTH = 99; |
@@ -156,11 +156,11 @@ private static void agentmainImpl( |
156 | 156 |
|
157 | 157 | static boolean getConfig(String configName) { |
158 | 158 | switch (configName) { |
159 | | - case LIB_INJECTION_ENABLED_FLAG: |
160 | | - return System.getenv(LIB_INJECTION_ENABLED_FLAG) != null; |
161 | | - case LIB_INJECTION_FORCE_FLAG: |
| 159 | + case LIB_INJECTION_ENABLED_ENV_VAR: |
| 160 | + return System.getenv(LIB_INJECTION_ENABLED_ENV_VAR) != null; |
| 161 | + case LIB_INJECTION_FORCE_SYS_PROP: |
162 | 162 | { |
163 | | - String injectionForceFlag = getPropertyOrEnvVar(LIB_INJECTION_FORCE_FLAG); |
| 163 | + String injectionForceFlag = getPropertyOrEnvVar(LIB_INJECTION_FORCE_SYS_PROP); |
164 | 164 | return "true".equalsIgnoreCase(injectionForceFlag) || "1".equals(injectionForceFlag); |
165 | 165 | } |
166 | 166 | default: |
@@ -289,8 +289,8 @@ static int parseJavaMajorVersion(String version) { |
289 | 289 | static boolean shouldAbortDueToOtherJavaAgents() { |
290 | 290 | // Simply considering having multiple agents |
291 | 291 |
|
292 | | - if (getConfig(LIB_INJECTION_ENABLED_FLAG) |
293 | | - && !getConfig(LIB_INJECTION_FORCE_FLAG) |
| 292 | + if (getConfig(LIB_INJECTION_ENABLED_ENV_VAR) |
| 293 | + && !getConfig(LIB_INJECTION_FORCE_SYS_PROP) |
294 | 294 | && getAgentFilesFromVMArguments().size() > 1) { |
295 | 295 | // Formatting agent file list, Java 7 style |
296 | 296 | StringBuilder agentFiles = new StringBuilder(); |
|
0 commit comments