Remove unused variable from AsyncChild classes
MODIFY
dd-java-agent/instrumentation/java-concurrent/scala-testing/src/test/java/AsyncChild.java
dd-java-agent/instrumentation/java-concurrent/scala-testing/src/test/java/AsyncChild.java
import datadog.trace.api.Trace;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
public class AsyncChild implements Runnable, Callable {
private final AtomicBoolean blockThread;
private final boolean doTraceableWork;
- private final AtomicInteger numberOfWorkers = new AtomicInteger(0);
public AsyncChild() {
this(true, false);
}
- public AsyncChild(boolean doTraceableWork, boolean blockThread) {
+ public AsyncChild(final boolean doTraceableWork, final boolean blockThread) {
this.doTraceableWork = doTraceableWork;
this.blockThread = new AtomicBoolean(blockThread);
}
@@ -36,14 +34,9 @@ public class AsyncChild implements Runnable, Callable {
if (doTraceableWork) {
asyncChild();
}
- numberOfWorkers.getAndIncrement();
- try {
while (blockThread.get()) {
// busy-wait to block thread
}
- } finally {
- numberOfWorkers.getAndDecrement();
- }
}
@Trace(operationName = "asyncChild")

MODIFY
dd-java-agent/instrumentation/java-concurrent/src/test/java/AsyncChild.java
dd-java-agent/instrumentation/java-concurrent/src/test/java/AsyncChild.java
import datadog.trace.api.Trace;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
public class AsyncChild implements Runnable, Callable {
private final AtomicBoolean blockThread;
private final boolean doTraceableWork;
- private final AtomicInteger numberOfWorkers = new AtomicInteger(0);
public AsyncChild() {
this(true, false);
@@ -36,14 +34,9 @@ public class AsyncChild implements Runnable, Callable {
if (doTraceableWork) {
asyncChild();
}
- numberOfWorkers.getAndIncrement();
- try {
while (blockThread.get()) {
// busy-wait to block thread
}
- } finally {
- numberOfWorkers.getAndDecrement();
- }
}
@Trace(operationName = "asyncChild")

Remove unused variable from AsyncChild classes