Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
chenlujjj committed Jan 8, 2025
1 parent 6f50140 commit 8e9b228
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions instrumentation/jsonrpc4j-1.6/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ muzzle {
}
}

val jsonrpcVersion = "1.6"

dependencies {
implementation(project(":instrumentation:jsonrpc4j-1.6:library"))
library("com.github.briandilley.jsonrpc4j:jsonrpc4j:$jsonrpcVersion")

library("com.github.briandilley.jsonrpc4j:jsonrpc4j:1.6")

testImplementation(project(":instrumentation:jsonrpc4j-1.6:testing"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package io.opentelemetry.javaagent.instrumentation.jsonrpc4j.v1_6;

import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
import static io.opentelemetry.javaagent.instrumentation.jsonrpc4j.v1_6.JsonRpcSingletons.SERVER_INVOCATION_LISTENER;
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.named;
Expand Down Expand Up @@ -51,7 +52,7 @@ public static void setInvocationListener(
@Advice.This JsonRpcBasicServer jsonRpcServer,
@Advice.FieldValue(value = "invocationListener", readOnly = false)
InvocationListener invocationListener) {
invocationListener = JsonRpcSingletons.SERVER_INVOCATION_LISTENER;
invocationListener = SERVER_INVOCATION_LISTENER;
}
}

Expand All @@ -67,14 +68,13 @@ public static void setInvocationListener(
VirtualField.find(JsonRpcBasicServer.class, Boolean.class);
if (!Boolean.TRUE.equals(instrumented.get(jsonRpcServer))) {
if (invocationListener == null) {
invocationListener = JsonRpcSingletons.SERVER_INVOCATION_LISTENER;
invocationListener = SERVER_INVOCATION_LISTENER;
} else if (invocationListener instanceof MultipleInvocationListener) {
((MultipleInvocationListener) invocationListener)
.addInvocationListener(JsonRpcSingletons.SERVER_INVOCATION_LISTENER);
.addInvocationListener(SERVER_INVOCATION_LISTENER);
} else {
invocationListener =
new MultipleInvocationListener(
invocationListener, JsonRpcSingletons.SERVER_INVOCATION_LISTENER);
new MultipleInvocationListener(invocationListener, SERVER_INVOCATION_LISTENER);
}

instrumented.set(jsonRpcServer, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import org.junit.jupiter.api.extension.RegisterExtension;

public class AgentJsonRpcTest extends AbstractJsonRpcTest {
class AgentJsonRpcTest extends AbstractJsonRpcTest {

@RegisterExtension
static final InstrumentationExtension testing = AgentInstrumentationExtension.create();
Expand Down
3 changes: 1 addition & 2 deletions instrumentation/jsonrpc4j-1.6/library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ plugins {
id("otel.library-instrumentation")
}

val jsonrpcVersion = "1.6"
val jacksonVersion = "2.13.3"

dependencies {
library("com.github.briandilley.jsonrpc4j:jsonrpc4j:$jsonrpcVersion")
library("com.github.briandilley.jsonrpc4j:jsonrpc4j:1.6")

implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")

Expand Down

0 comments on commit 8e9b228

Please sign in to comment.