Skip to content

Commit 999a6ec

Browse files
committed
apply spotless
1 parent e502918 commit 999a6ec

File tree

40 files changed

+331
-422
lines changed

40 files changed

+331
-422
lines changed

conventions/src/main/kotlin/otel.spotless-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ if (project == rootProject) {
9797
"**/*.dockerfile",
9898
"**/gradle.properties"
9999
)
100-
indentWithSpaces()
100+
leadingTabsToSpaces()
101101
trimTrailingWhitespace()
102102
endWithNewline()
103103
}

instrumentation/finagle-http-23.11/javaagent/build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ val scalaMinor = Regex("""^([0-9]+\.[0-9]+)\.?.*$""").find(scalaVersion)!!.run {
2525
minorVersion
2626
}
2727

28-
val scalified = fun(pack: String): String {
29-
return "${pack}_$scalaMinor"
30-
}
28+
val scalified = fun(pack: String): String = "${pack}_$scalaMinor"
3129

3230
dependencies {
3331
bootstrap(project(":instrumentation:executors:bootstrap"))

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/javaagent/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ dependencies {
6464

6565
latestDepTestLibrary("org.jboss.resteasy:resteasy-servlet-initializer:3.0.+") // see jaxrs-3.0-resteasy-3.1 module
6666
latestDepTestLibrary("org.jboss.resteasy:resteasy-jaxrs:3.0.+") // see jaxrs-3.0-resteasy-3.1 module
67-
latestDepTestLibrary("org.jboss.resteasy:resteasy-undertow:3.0.+") { // see jaxrs-3.0-resteasy-3.1 module
67+
latestDepTestLibrary("org.jboss.resteasy:resteasy-undertow:3.0.+") {
68+
// see jaxrs-3.0-resteasy-3.1 module
6869
exclude("org.jboss.resteasy", "resteasy-client")
6970
}
7071
latestDepTestLibrary("io.undertow:undertow-servlet:2.2.24.Final") // see jaxrs-3.0-resteasy-3.1 module

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/javaagent/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ dependencies {
6262
// artifact name changed from 'resteasy-jaxrs' to 'resteasy-core' starting from version 4.0.0
6363
latestDepTestLibrary("org.jboss.resteasy:resteasy-core:5.+") // documented limitation
6464
latestDepTestLibrary("org.jboss.resteasy:resteasy-servlet-initializer:5.+") // documented limitation
65-
latestDepTestLibrary("org.jboss.resteasy:resteasy-undertow:5.+") { // documented limitation
65+
latestDepTestLibrary("org.jboss.resteasy:resteasy-undertow:5.+") {
66+
// documented limitation
6667
exclude("org.jboss.resteasy", "resteasy-client")
6768
}
6869
}

instrumentation/jmx-metrics/library/src/main/java/io/opentelemetry/instrumentation/jmx/engine/MetricRegistrar.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void enrollExtractor(
7171
String unit = metricInfo.getUnit();
7272

7373
switch (instrumentType) {
74-
// CHECKSTYLE:OFF
74+
// CHECKSTYLE:OFF
7575
case COUNTER:
7676
{
7777
// CHECKSTYLE:ON
@@ -88,7 +88,7 @@ void enrollExtractor(
8888
}
8989
break;
9090

91-
// CHECKSTYLE:OFF
91+
// CHECKSTYLE:OFF
9292
case UPDOWNCOUNTER:
9393
{
9494
// CHECKSTYLE:ON
@@ -105,7 +105,7 @@ void enrollExtractor(
105105
}
106106
break;
107107

108-
// CHECKSTYLE:OFF
108+
// CHECKSTYLE:OFF
109109
case GAUGE:
110110
{
111111
// CHECKSTYLE:ON
@@ -121,7 +121,7 @@ void enrollExtractor(
121121
logger.log(INFO, "Created Gauge for {0}", metricName);
122122
}
123123
break;
124-
// CHECKSTYLE:OFF
124+
// CHECKSTYLE:OFF
125125
case STATE:
126126
{
127127
// CHECKSTYLE:ON

instrumentation/kotlinx-coroutines/kotlinx-coroutines-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/instrumentationannotations/ExpandFramesClassVisitor.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,34 +95,34 @@ private static void copy(Object[] array, int count, List<Object> list) {
9595
@Override
9696
public void visitFrame(int type, int numLocal, Object[] local, int numStack, Object[] stack) {
9797
switch (type) {
98-
// An expanded frame.
98+
// An expanded frame.
9999
case Opcodes.F_NEW:
100-
// A compressed frame with complete frame data.
100+
// A compressed frame with complete frame data.
101101
case Opcodes.F_FULL:
102102
copy(local, numLocal, currentLocals);
103103
copy(stack, numStack, currentStack);
104104
break;
105-
// A compressed frame with exactly the same locals as the previous frame and with an empty
106-
// stack.
105+
// A compressed frame with exactly the same locals as the previous frame and with an empty
106+
// stack.
107107
case Opcodes.F_SAME:
108108
currentStack.clear();
109109
break;
110-
// A compressed frame with exactly the same locals as the previous frame and with a single
111-
// value on the stack.
110+
// A compressed frame with exactly the same locals as the previous frame and with a single
111+
// value on the stack.
112112
case Opcodes.F_SAME1:
113113
currentStack.clear();
114114
currentStack.add(stack[0]);
115115
break;
116-
// A compressed frame where locals are the same as the locals in the previous frame,
117-
// except that additional 1-3 locals are defined, and with an empty stack.
116+
// A compressed frame where locals are the same as the locals in the previous frame,
117+
// except that additional 1-3 locals are defined, and with an empty stack.
118118
case Opcodes.F_APPEND:
119119
currentStack.clear();
120120
for (int i = 0; i < numLocal; i++) {
121121
currentLocals.add(local[i]);
122122
}
123123
break;
124-
// A compressed frame where locals are the same as the locals in the previous frame,
125-
// except that the last 1-3 locals are absent and with an empty stack.
124+
// A compressed frame where locals are the same as the locals in the previous frame,
125+
// except that the last 1-3 locals are absent and with an empty stack.
126126
case Opcodes.F_CHOP:
127127
currentStack.clear();
128128
for (Iterator<Object> iterator =

instrumentation/kotlinx-coroutines/kotlinx-coroutines-1.0/javaagent/src/test/kotlin/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/KotlinCoroutinesInstrumentationTest.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,7 @@ class KotlinCoroutinesInstrumentationTest {
461461
tracer.spanBuilder(opName).startSpan().end()
462462
}
463463

464-
private fun <T> runTest(dispatcherWrapper: DispatcherWrapper, block: suspend CoroutineScope.() -> T): T {
465-
return runTest(dispatcherWrapper.dispatcher, block)
466-
}
464+
private fun <T> runTest(dispatcherWrapper: DispatcherWrapper, block: suspend CoroutineScope.() -> T): T = runTest(dispatcherWrapper.dispatcher, block)
467465

468466
private fun <T> runTest(dispatcher: CoroutineDispatcher, block: suspend CoroutineScope.() -> T): T {
469467
val parentSpan = tracer.spanBuilder("parent").startSpan()
@@ -562,9 +560,7 @@ class KotlinCoroutinesInstrumentationTest {
562560
oldState.close()
563561
}
564562

565-
override fun updateThreadContext(context: CoroutineContext): Scope {
566-
return otelContext.makeCurrent()
567-
}
563+
override fun updateThreadContext(context: CoroutineContext): Scope = otelContext.makeCurrent()
568564
}
569565

570566
// regression test for

instrumentation/kotlinx-coroutines/kotlinx-coroutines-flow-1.3/javaagent-kotlin/src/main/kotlin/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/flow/FlowUtil.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter
1010
import kotlinx.coroutines.flow.Flow
1111
import kotlinx.coroutines.flow.onCompletion
1212

13-
fun <REQUEST, RESPONSE> onComplete(flow: Flow<*>, instrumenter: Instrumenter<REQUEST, RESPONSE>, context: Context, request: REQUEST & Any): Flow<*> {
14-
return flow.onCompletion { cause: Throwable? ->
15-
instrumenter.end(context, request, null, cause)
16-
}
13+
fun <REQUEST, RESPONSE> onComplete(flow: Flow<*>, instrumenter: Instrumenter<REQUEST, RESPONSE>, context: Context, request: REQUEST & Any): Flow<*> = flow.onCompletion { cause: Throwable? ->
14+
instrumenter.end(context, request, null, cause)
1715
}

instrumentation/kotlinx-coroutines/kotlinx-coroutines-flow-1.3/javaagent/src/test/kotlin/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/KotlinCoroutines13InstrumentationTest.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,7 @@ class KotlinCoroutines13InstrumentationTest {
185185
tracer.spanBuilder(opName).startSpan().end()
186186
}
187187

188-
private fun <T> runTest(dispatcherWrapper: DispatcherWrapper, block: suspend CoroutineScope.() -> T): T {
189-
return runTest(dispatcherWrapper.dispatcher, block)
190-
}
188+
private fun <T> runTest(dispatcherWrapper: DispatcherWrapper, block: suspend CoroutineScope.() -> T): T = runTest(dispatcherWrapper.dispatcher, block)
191189

192190
private fun <T> runTest(dispatcher: CoroutineDispatcher, block: suspend CoroutineScope.() -> T): T {
193191
val parentSpan = tracer.spanBuilder("parent").startSpan()

instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/ApplicationRequestGetter.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import io.ktor.request.*
99
import io.opentelemetry.context.propagation.TextMapGetter
1010

1111
internal object ApplicationRequestGetter : TextMapGetter<ApplicationRequest> {
12-
override fun keys(carrier: ApplicationRequest): Iterable<String> {
13-
return carrier.headers.names()
14-
}
12+
override fun keys(carrier: ApplicationRequest): Iterable<String> = carrier.headers.names()
1513

16-
override fun get(carrier: ApplicationRequest?, name: String): String? {
17-
return carrier?.headers?.get(name)
18-
}
14+
override fun get(carrier: ApplicationRequest?, name: String): String? = carrier?.headers?.get(name)
1915
}

0 commit comments

Comments
 (0)