11package datadog .trace .civisibility ;
22
3+ import static datadog .trace .api .config .CiVisibilityConfig .CIVISIBILITY_SIGNAL_SERVER_HOST ;
4+ import static datadog .trace .api .config .CiVisibilityConfig .CIVISIBILITY_SIGNAL_SERVER_PORT ;
35import static datadog .trace .bootstrap .instrumentation .api .AgentPropagation .extractContextAndGetSpanContext ;
6+ import static datadog .trace .util .Strings .propertyNameToSystemPropertyName ;
47
5- import datadog .trace . api . config . CiVisibilityConfig ;
8+ import datadog .environment . SystemProperties ;
69import datadog .trace .bootstrap .instrumentation .api .AgentPropagation ;
710import datadog .trace .bootstrap .instrumentation .api .AgentSpanContext ;
8- import datadog .trace .util .Strings ;
911import java .net .InetSocketAddress ;
1012import java .util .Properties ;
1113import javax .annotation .Nullable ;
@@ -69,8 +71,8 @@ private boolean isWrapper() {
6971 }
7072
7173 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
7476 // when using Maven Wrapper
7577 || ClassLoader .getSystemClassLoader ()
7678 .getResource ("org/apache/maven/wrapper/WrapperExecutor.class" )
@@ -82,7 +84,7 @@ private boolean isGradleDaemon() {
8284 .getResource ("org/gradle/launcher/daemon/bootstrap/GradleDaemon.class" )
8385 != null
8486 // 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 ;
8688 }
8789
8890 private boolean isGradleLauncher () {
@@ -93,16 +95,12 @@ private boolean isGradleLauncher() {
9395
9496 @ Nullable
9597 public InetSocketAddress getSignalServerAddress () {
96- // System.getProperty is used rather than Config,
98+ // System properties are used rather than Config,
9799 // because system variables can be set after config was initialized
98100 String host =
99- System .getProperty (
100- Strings .propertyNameToSystemPropertyName (
101- CiVisibilityConfig .CIVISIBILITY_SIGNAL_SERVER_HOST ));
101+ SystemProperties .get (propertyNameToSystemPropertyName (CIVISIBILITY_SIGNAL_SERVER_HOST ));
102102 String port =
103- System .getProperty (
104- Strings .propertyNameToSystemPropertyName (
105- CiVisibilityConfig .CIVISIBILITY_SIGNAL_SERVER_PORT ));
103+ SystemProperties .get (propertyNameToSystemPropertyName (CIVISIBILITY_SIGNAL_SERVER_PORT ));
106104 if (host != null && port != null ) {
107105 return new InetSocketAddress (host , Integer .parseInt (port ));
108106 } else {
0 commit comments