Skip to content

Commit

Permalink
applies spotless fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishekkr3003 committed Nov 26, 2024
1 parent cfc0227 commit 3b6ab9b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ public void transform(TypeTransformer transformer) {
isMethod()
.and(takesGenericArguments(iterableHasAtLeastOne(named("com.aerospike.client.Key"))))
.and(
not(takesGenericArguments(iterableHasAtLeastOne(named("com.aerospike.client.async.EventLoop"))))),
not(
takesGenericArguments(
iterableHasAtLeastOne(named("com.aerospike.client.async.EventLoop"))))),
this.getClass().getName() + "$SyncCommandAdvice");

transformer.applyAdviceToMethod(
isMethod()
.and(takesGenericArguments(iterableHasAtLeastOne(named("com.aerospike.client.Key"))))
.and(takesGenericArguments(iterableHasAtLeastOne(named("com.aerospike.client.async.EventLoop")))),
.and(
takesGenericArguments(
iterableHasAtLeastOne(named("com.aerospike.client.async.EventLoop")))),
this.getClass().getName() + "$AsyncCommandAdvice");
}

Expand Down Expand Up @@ -75,9 +79,7 @@ public static void startInstrumentation(
requestContext = AerospikeRequestContext.attach(request, context);
}

@Advice.OnMethodExit(
onThrowable = Throwable.class,
suppress = Throwable.class)
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
public static void stopInstrumentation(
@Advice.Thrown Throwable ex,
@Advice.Local("AerospikeContext") AerospikeRequestContext requestContext) {
Expand Down Expand Up @@ -113,9 +115,7 @@ public static void startInstrumentation(
requestContext = AerospikeRequestContext.attach(request, context);
}

@Advice.OnMethodExit(
onThrowable = Throwable.class,
suppress = Throwable.class)
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
public static void stopInstrumentaionIfError(
@Advice.Thrown Throwable ex,
@Advice.Local("AerospikeContext") AerospikeRequestContext requestContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public AerospikeClientInstrumentationModule() {

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
return hasClassesNamed("com.aerospike.client.IAerospikeClient").
and(hasClassesNamed("com.aerospike.client.command.Command")).
and(hasClassesNamed("com.aerospike.client.command.SyncCommand")).
and(hasClassesNamed("com.aerospike.client.async.AsyncCommand")).
and(hasClassesNamed("com.aerospike.client.async.EventLoop")).
and(hasClassesNamed("com.aerospike.client.Key"));
return hasClassesNamed("com.aerospike.client.IAerospikeClient")
.and(hasClassesNamed("com.aerospike.client.command.Command"))
.and(hasClassesNamed("com.aerospike.client.command.SyncCommand"))
.and(hasClassesNamed("com.aerospike.client.async.AsyncCommand"))
.and(hasClassesNamed("com.aerospike.client.async.EventLoop"))
.and(hasClassesNamed("com.aerospike.client.Key"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public void transform(TypeTransformer transformer) {
isMethod().and(named("onSuccess")), this.getClass().getName() + "$GetOnSuccessAdvice");

transformer.applyAdviceToMethod(
isMethod().and(named("onFailure").and(takesArgument(0, named("com.aerospike.client.AerospikeException")))),
isMethod()
.and(
named("onFailure")
.and(takesArgument(0, named("com.aerospike.client.AerospikeException")))),
this.getClass().getName() + "$GetOnFailureAdvice");
}

Expand Down

0 comments on commit 3b6ab9b

Please sign in to comment.