Skip to content

Commit 3fc559b

Browse files
spotless appllied to test on CI
1 parent 1fdc913 commit 3fc559b

File tree

342 files changed

+2640
-1520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+2640
-1520
lines changed

build.gradle.kts

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@ allprojects {
6161
group = "com.datadoghq"
6262

6363
if (isCI.isPresent) {
64-
layout.buildDirectory = providers.provider {
65-
val newProjectCIPath = projectDir.path.replace(
66-
rootDir.path,
67-
""
68-
)
69-
rootDir.resolve("workspace/$newProjectCIPath/build/")
70-
}
64+
layout.buildDirectory =
65+
providers.provider {
66+
val newProjectCIPath =
67+
projectDir.path.replace(
68+
rootDir.path,
69+
"",
70+
)
71+
rootDir.resolve("workspace/$newProjectCIPath/build/")
72+
}
7173
}
7274

7375
apply(from = rootDir.resolve("gradle/dependencies.gradle"))
@@ -84,7 +86,7 @@ allprojects {
8486
jvmArgs(
8587
"-XX:ErrorFile=/tmp/hs_err_pid%p.log",
8688
"-XX:+HeapDumpOnOutOfMemoryError",
87-
"-XX:HeapDumpPath=/tmp"
89+
"-XX:HeapDumpPath=/tmp",
8890
)
8991
}
9092
}
@@ -123,15 +125,24 @@ nexusPublishing {
123125
}
124126
}
125127

126-
val writeMainVersionFileTask = tasks.register("writeMainVersionFile") {
127-
val versionFile = rootProject.layout.buildDirectory.file("main.version")
128-
inputs.property("version", project.version)
129-
outputs.file(versionFile)
130-
doFirst {
131-
require(versionFile.get().asFile.parentFile.mkdirs() || versionFile.get().asFile.parentFile.isDirectory)
132-
versionFile.get().asFile.writeText(project.version.toString())
128+
val writeMainVersionFileTask =
129+
tasks.register("writeMainVersionFile") {
130+
val versionFile = rootProject.layout.buildDirectory.file("main.version")
131+
inputs.property("version", project.version)
132+
outputs.file(versionFile)
133+
doFirst {
134+
require(
135+
versionFile
136+
.get()
137+
.asFile.parentFile
138+
.mkdirs() ||
139+
versionFile
140+
.get()
141+
.asFile.parentFile.isDirectory,
142+
)
143+
versionFile.get().asFile.writeText(project.version.toString())
144+
}
133145
}
134-
}
135146

136147
allprojects {
137148
tasks.withType<PublishToMavenLocal>().configureEach {
@@ -144,11 +155,12 @@ testAggregate("instrumentation", listOf(":dd-java-agent:instrumentation"), empty
144155
testAggregate("profiling", listOf(":dd-java-agent:agent-profiling"), emptyList())
145156
testAggregate("debugger", listOf(":dd-java-agent:agent-debugger"), forceCoverage = true)
146157
testAggregate(
147-
"base", listOf(":"),
158+
"base",
159+
listOf(":"),
148160
listOf(
149161
":dd-java-agent:instrumentation",
150162
":dd-smoke-tests",
151163
":dd-java-agent:agent-profiling",
152-
":dd-java-agent:agent-debugger"
153-
)
164+
":dd-java-agent:agent-debugger",
165+
),
154166
)

communication/build.gradle.kts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ dependencies {
2929
testImplementation(
3030
group = "com.squareup.okhttp3",
3131
name = "mockwebserver",
32-
version = libs.versions.okhttp.legacy.get() // actually a version range
32+
version =
33+
libs.versions.okhttp.legacy
34+
.get(),
35+
// actually a version range
3336
)
3437
}
3538

@@ -57,15 +60,15 @@ val excludedClassesCoverage by extra(
5760
"datadog.communication.IntakeApi",
5861
"datadog.communication.util.IOUtils",
5962
"datadog.communication.util.IOUtils.1",
60-
)
63+
),
6164
)
6265
val excludedClassesBranchCoverage by extra(
6366
listOf(
6467
"datadog.communication.ddagent.TracerVersion",
6568
"datadog.communication.BackendApiFactory",
6669
"datadog.communication.EvpProxyApi",
6770
"datadog.communication.IntakeApi",
68-
)
71+
),
6972
)
7073
val excludedClassesInstructionCoverage by extra(
7174
listOf(
@@ -79,5 +82,5 @@ val excludedClassesInstructionCoverage by extra(
7982
"datadog.communication.IntakeApi",
8083
"datadog.communication.util.IOUtils",
8184
"datadog.communication.util.IOUtils.1",
82-
)
85+
),
8386
)

components/context/src/main/java/datadog/context/ContextKey.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
*/
1111
public final class ContextKey<T> {
1212
private static final AtomicInteger NEXT_INDEX = new AtomicInteger(0);
13+
1314
/** The key name, for debugging purpose only. */
1415
private final String name;
16+
1517
/** The key unique context, related to {@link IndexedContext} implementation. */
1618
final int index;
1719

components/context/src/main/java/datadog/context/propagation/Concern.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
public class Concern {
99
/** The concern default priority. */
1010
public static final int DEFAULT_PRIORITY = 100;
11+
1112
/** The concern name, for debugging purpose only. */
1213
private final String name;
14+
1315
/** The concern priority, lower value means higher priority. */
1416
private final int priority;
1517

dd-java-agent/agent-bootstrap/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,4 @@ tasks.withType(Test).configureEach {
7575
JavaVersion.VERSION_16,
7676
['--add-opens', 'java.base/java.net=ALL-UNNAMED'] // for HostNameResolverForkedTest
7777
)
78-
7978
}

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,9 @@ private static boolean isDebugMode() {
14681468
return false;
14691469
}
14701470

1471-
/** @return {@code true} if the agent feature is enabled */
1471+
/**
1472+
* @return {@code true} if the agent feature is enabled
1473+
*/
14721474
private static boolean isFeatureEnabled(AgentFeature feature) {
14731475
// must be kept in sync with logic from Config!
14741476
final String featureConfigKey = feature.getConfigKey();
@@ -1498,7 +1500,9 @@ private static boolean isFeatureEnabled(AgentFeature feature) {
14981500
}
14991501
}
15001502

1501-
/** @see datadog.trace.api.ProductActivation#fromString(String) */
1503+
/**
1504+
* @see datadog.trace.api.ProductActivation#fromString(String)
1505+
*/
15021506
private static boolean isFullyDisabled(final AgentFeature feature) {
15031507
// must be kept in sync with logic from Config!
15041508
final String featureConfigKey = feature.getConfigKey();
@@ -1536,7 +1540,9 @@ private static String getNullIfEmpty(final String value) {
15361540
return value;
15371541
}
15381542

1539-
/** @return configured JMX start delay in seconds */
1543+
/**
1544+
* @return configured JMX start delay in seconds
1545+
*/
15401546
private static int getJmxStartDelay() {
15411547
String startDelay = ddGetProperty("dd.dogstatsd.start-delay");
15421548
if (startDelay == null) {

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InitializationTelemetry.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ static final class BootstrapProxy extends InitializationTelemetry {
9797
// DQH - Decided not to eager access MethodHandles, since exceptions are uncommon
9898
// However, MethodHandles are cached on lookup
9999

100-
/** @param bootstrapInitTelemetry - non-null BootstrapInitializationTelemetry */
100+
/**
101+
* @param bootstrapInitTelemetry - non-null BootstrapInitializationTelemetry
102+
*/
101103
BootstrapProxy(final Object bootstrapInitTelemetry) {
102104
this.bootstrapInitTelemetry = bootstrapInitTelemetry;
103105
}

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InstanceStore.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public final class InstanceStore<T> {
1919
private static final ClassValue<InstanceStore> classInstanceStore =
2020
GenericClassValue.of(type -> new InstanceStore<>());
2121

22-
/** @return global store of instances with the same common type */
22+
/**
23+
* @return global store of instances with the same common type
24+
*/
2325
@SuppressWarnings("unchecked")
2426
public static <T> InstanceStore<T> of(Class<T> type) {
2527
return classInstanceStore.get(type);

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/api/Java8BytecodeBridge.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,37 @@
1010
* were not supported prior to Java 8 and will lead to a class verification error.
1111
*/
1212
public class Java8BytecodeBridge {
13-
/** @see Context#root() */
13+
/**
14+
* @see Context#root()
15+
*/
1416
public static Context getRootContext() {
1517
return Context.root();
1618
}
1719

18-
/** @see Context#current() */
20+
/**
21+
* @see Context#current()
22+
*/
1923
public static Context getCurrentContext() {
2024
return Context.current();
2125
}
2226

23-
/** @see Context#from(Object) */
27+
/**
28+
* @see Context#from(Object)
29+
*/
2430
public static Context getContextFrom(Object carrier) {
2531
return Context.from(carrier);
2632
}
2733

28-
/** @see Context#detachFrom(Object) */
34+
/**
35+
* @see Context#detachFrom(Object)
36+
*/
2937
public static Context detachContextFrom(Object carrier) {
3038
return Context.detachFrom(carrier);
3139
}
3240

33-
/** @see AgentSpan#fromContext(Context) */
41+
/**
42+
* @see AgentSpan#fromContext(Context)
43+
*/
3444
public static AgentSpan spanFromContext(Context context) {
3545
return AgentSpan.fromContext(context);
3646
}

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/rmi/ContextPropagator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ private boolean checkIfContextCanBePassed(
6262
return result;
6363
}
6464

65-
/** @return {@code true} when no error happened during call */
65+
/**
66+
* @return {@code true} when no error happened during call
67+
*/
6668
private boolean syntheticCall(
6769
final Connection c, final ContextPayload payload, final int operationId) {
6870
final StreamRemoteCall shareContextCall = new StreamRemoteCall(c);

0 commit comments

Comments
 (0)