Skip to content

Commit 809f207

Browse files
committed
minor code refactor
1 parent 2ed8b96 commit 809f207

File tree

1 file changed

+7
-6
lines changed
  • instrumentation/vertx/vertx-sql-client/vertx-sql-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/sql

1 file changed

+7
-6
lines changed

instrumentation/vertx/vertx-sql-client/vertx-sql-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/sql/QueryExecutorInstrumentation.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ public static class AdviceScope {
6262
@Nullable private final Context context;
6363
@Nullable private final Scope scope;
6464

65+
private AdviceScope(CallDepth callDepth) {
66+
this(callDepth, null, null, null);
67+
}
68+
6569
private AdviceScope(
66-
CallDepth callDepth,
67-
@Nullable VertxSqlClientRequest otelRequest,
68-
@Nullable Context context,
69-
@Nullable Scope scope) {
70+
CallDepth callDepth, VertxSqlClientRequest otelRequest, Context context, Scope scope) {
7071
this.callDepth = callDepth;
7172
this.otelRequest = otelRequest;
7273
this.context = context;
@@ -76,7 +77,7 @@ private AdviceScope(
7677
public static AdviceScope start(Object queryExecutor, Object[] arguments) {
7778
CallDepth callDepth = CallDepth.forClass(queryExecutor.getClass());
7879
if (callDepth.getAndIncrement() > 0) {
79-
return new AdviceScope(callDepth, null, null, null);
80+
return new AdviceScope(callDepth);
8081
}
8182

8283
// The parameter we need are in different positions, we are not going to have separate
@@ -97,7 +98,7 @@ public static AdviceScope start(Object queryExecutor, Object[] arguments) {
9798
}
9899
}
99100
if (sql == null || promiseInternal == null) {
100-
return new AdviceScope(callDepth, null, null, null);
101+
return new AdviceScope(callDepth);
101102
}
102103

103104
VertxSqlClientRequest otelRequest =

0 commit comments

Comments
 (0)