fix: use google java format
MODIFY
dd-java-agent/instrumentation/jetty-9/src/main/java/datadog/trace/instrumentation/jetty9/HandlerInstrumentation.java
dd-java-agent/instrumentation/jetty-9/src/main/java/datadog/trace/instrumentation/jetty9/HandlerInstrumentation.java
package datadog.trace.instrumentation.jetty9;
-import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
-import static io.opentracing.log.Fields.ERROR_OBJECT;
-import static net.bytebuddy.matcher.ElementMatchers.hasSuperType;
-import static net.bytebuddy.matcher.ElementMatchers.isInterface;
-import static net.bytebuddy.matcher.ElementMatchers.isPublic;
-import static net.bytebuddy.matcher.ElementMatchers.named;
-import static net.bytebuddy.matcher.ElementMatchers.not;
-import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
-
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.DDAdvice;
import datadog.trace.agent.tooling.HelperInjector;
@@ -23,17 +14,20 @@ import io.opentracing.contrib.web.servlet.filter.ServletFilterSpanDecorator;
import io.opentracing.propagation.Format;
import io.opentracing.tag.Tags;
import io.opentracing.util.GlobalTracer;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.concurrent.atomic.AtomicBoolean;
+import net.bytebuddy.agent.builder.AgentBuilder;
+import net.bytebuddy.asm.Advice;
+
import javax.servlet.AsyncEvent;
import javax.servlet.AsyncListener;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import net.bytebuddy.agent.builder.AgentBuilder;
-import net.bytebuddy.asm.Advice;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
+import static io.opentracing.log.Fields.ERROR_OBJECT;
+import static net.bytebuddy.matcher.ElementMatchers.*;
@AutoService(Instrumenter.class)
public final class HandlerInstrumentation extends Instrumenter.Configurable {
@@ -74,10 +68,12 @@ public final class HandlerInstrumentation extends Instrumenter.Configurable {
public static class HandlerInstrumentationAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
- public static Scope startSpan(@Advice.Argument(0) final String target, @Advice.Argument(2) final HttpServletRequest req) {
+ public static Scope startSpan(
+ @Advice.Argument(0) final String target, @Advice.Argument(2) final HttpServletRequest req) {
final SpanContext extractedContext =
- GlobalTracer.get().extract(Format.Builtin.HTTP_HEADERS, new HttpServletRequestExtractAdapter(req));
+ GlobalTracer.get()
+ .extract(Format.Builtin.HTTP_HEADERS, new HttpServletRequestExtractAdapter(req));
final String resourceName = req.getMethod() + target;
final Scope scope =
GlobalTracer.get()

MODIFY
dd-java-agent/instrumentation/sparkjava/src/test/java/TestSparkJavaApplication.java
dd-java-agent/instrumentation/sparkjava/src/test/java/TestSparkJavaApplication.java
@@ -7,26 +7,31 @@ public class TestSparkJavaApplication {
public static void main(final String[] args) {
- Spark.get("/", new Route() {
+ Spark.get(
+ "/",
+ new Route() {
@Override
public Object handle(Request request, Response response) throws Exception {
return "Hello World";
}
});
- Spark.get("/param/:param", new Route() {
+ Spark.get(
+ "/param/:param",
+ new Route() {
@Override
public Object handle(Request request, Response response) throws Exception {
return "Hello " + request.params("param");
}
});
- Spark.get("/exception/:param", new Route() {
+ Spark.get(
+ "/exception/:param",
+ new Route() {
@Override
public Object handle(Request request, Response response) throws Exception {
throw new RuntimeException(request.params("param"));
}
});
-
}
}

fix: use google java format