1
1
package datadog .trace .civisibility ;
2
2
3
+ import static datadog .trace .api .config .CiVisibilityConfig .CIVISIBILITY_SIGNAL_SERVER_HOST ;
4
+ import static datadog .trace .api .config .CiVisibilityConfig .CIVISIBILITY_SIGNAL_SERVER_PORT ;
3
5
import static datadog .trace .bootstrap .instrumentation .api .AgentPropagation .extractContextAndGetSpanContext ;
6
+ import static datadog .trace .util .Strings .propertyNameToSystemPropertyName ;
4
7
5
- import datadog .trace . api . config . CiVisibilityConfig ;
8
+ import datadog .environment . SystemProperties ;
6
9
import datadog .trace .bootstrap .instrumentation .api .AgentPropagation ;
7
10
import datadog .trace .bootstrap .instrumentation .api .AgentSpanContext ;
8
- import datadog .trace .util .Strings ;
9
11
import java .net .InetSocketAddress ;
10
12
import java .util .Properties ;
11
13
import javax .annotation .Nullable ;
@@ -69,8 +71,8 @@ private boolean isWrapper() {
69
71
}
70
72
71
73
private boolean isMavenParent () {
72
- return System . getProperty ("maven.home" ) != null
73
- && System . getProperty ("classworlds.conf" ) != null
74
+ return SystemProperties . get ("maven.home" ) != null
75
+ && SystemProperties . get ("classworlds.conf" ) != null
74
76
// when using Maven Wrapper
75
77
|| ClassLoader .getSystemClassLoader ()
76
78
.getResource ("org/apache/maven/wrapper/WrapperExecutor.class" )
@@ -82,7 +84,7 @@ private boolean isGradleDaemon() {
82
84
.getResource ("org/gradle/launcher/daemon/bootstrap/GradleDaemon.class" )
83
85
!= null
84
86
// double-check this is not a Gradle Worker
85
- && System . getProperties (). getProperty ("org.gradle.internal.worker.tmpdir" ) == null ;
87
+ && SystemProperties . get ("org.gradle.internal.worker.tmpdir" ) == null ;
86
88
}
87
89
88
90
private boolean isGradleLauncher () {
@@ -93,16 +95,12 @@ private boolean isGradleLauncher() {
93
95
94
96
@ Nullable
95
97
public InetSocketAddress getSignalServerAddress () {
96
- // System.getProperty is used rather than Config,
98
+ // System properties are used rather than Config,
97
99
// because system variables can be set after config was initialized
98
100
String host =
99
- System .getProperty (
100
- Strings .propertyNameToSystemPropertyName (
101
- CiVisibilityConfig .CIVISIBILITY_SIGNAL_SERVER_HOST ));
101
+ SystemProperties .get (propertyNameToSystemPropertyName (CIVISIBILITY_SIGNAL_SERVER_HOST ));
102
102
String port =
103
- System .getProperty (
104
- Strings .propertyNameToSystemPropertyName (
105
- CiVisibilityConfig .CIVISIBILITY_SIGNAL_SERVER_PORT ));
103
+ SystemProperties .get (propertyNameToSystemPropertyName (CIVISIBILITY_SIGNAL_SERVER_PORT ));
106
104
if (host != null && port != null ) {
107
105
return new InetSocketAddress (host , Integer .parseInt (port ));
108
106
} else {
0 commit comments