Remove unnecessary final on params and local vars (#3283)
* Remove unnecessary final on params and local vars * Fix gwt * Keep final for non-initialized var * Keep final for non-initialized var * Keep final for non-initialized var
This commit is contained in:
parent
be983a9439
commit
dc316609ee
|
|
@ -71,7 +71,7 @@ public class ByteBuddyPluginConfigurator {
|
|||
if (!project.getTasks().getNames().contains(compileTaskName)) {
|
||||
return null;
|
||||
}
|
||||
final TaskProvider<?> compileTask = project.getTasks().named(compileTaskName);
|
||||
TaskProvider<?> compileTask = project.getTasks().named(compileTaskName);
|
||||
|
||||
// We also process resources for SPI classes.
|
||||
return createLanguageTask(
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class CamelContextInstrumentation implements TypeInstrumentation {
|
|||
public static class StartAdvice {
|
||||
|
||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||
public static void onContextStart(@Advice.This final CamelContext context) throws Exception {
|
||||
public static void onContextStart(@Advice.This CamelContext context) throws Exception {
|
||||
|
||||
if (context.hasService(CamelTracingService.class) == null) {
|
||||
// start this service eager so we init before Camel is starting up
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ final class CamelPropagationUtil {
|
|||
|
||||
private CamelPropagationUtil() {}
|
||||
|
||||
static Context extractParent(final Map<String, Object> exchangeHeaders, Endpoint endpoint) {
|
||||
static Context extractParent(Map<String, Object> exchangeHeaders, Endpoint endpoint) {
|
||||
return (isAwsPropagated(endpoint)
|
||||
? extractAwsPropagationParent(exchangeHeaders)
|
||||
: extractHttpPropagationParent(exchangeHeaders));
|
||||
|
|
@ -28,7 +28,7 @@ final class CamelPropagationUtil {
|
|||
return endpoint.getClass().getName().endsWith("SqsEndpoint");
|
||||
}
|
||||
|
||||
private static Context extractAwsPropagationParent(final Map<String, Object> exchangeHeaders) {
|
||||
private static Context extractAwsPropagationParent(Map<String, Object> exchangeHeaders) {
|
||||
return AwsXrayPropagator.getInstance()
|
||||
.extract(
|
||||
Context.current(),
|
||||
|
|
@ -36,13 +36,13 @@ final class CamelPropagationUtil {
|
|||
MapGetter.INSTANCE);
|
||||
}
|
||||
|
||||
private static Context extractHttpPropagationParent(final Map<String, Object> exchangeHeaders) {
|
||||
private static Context extractHttpPropagationParent(Map<String, Object> exchangeHeaders) {
|
||||
return GlobalOpenTelemetry.getPropagators()
|
||||
.getTextMapPropagator()
|
||||
.extract(Context.current(), exchangeHeaders, MapGetter.INSTANCE);
|
||||
}
|
||||
|
||||
static void injectParent(Context context, final Map<String, Object> exchangeHeaders) {
|
||||
static void injectParent(Context context, Map<String, Object> exchangeHeaders) {
|
||||
GlobalOpenTelemetry.getPropagators()
|
||||
.getTextMapPropagator()
|
||||
.inject(context, exchangeHeaders, MapSetter.INSTANCE);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class DecoratorRegistry {
|
|||
return result;
|
||||
}
|
||||
|
||||
public SpanDecorator forComponent(final String component) {
|
||||
public SpanDecorator forComponent(String component) {
|
||||
|
||||
return DECORATORS.getOrDefault(component, DEFAULT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class KafkaSpanDecorator extends MessagingSpanDecorator {
|
|||
* @param header the header name
|
||||
* @param type the class type of the exchange header
|
||||
*/
|
||||
private static <T> String getValue(final Exchange exchange, final String header, Class<T> type) {
|
||||
private static <T> String getValue(Exchange exchange, String header, Class<T> type) {
|
||||
T value = exchange.getIn().getHeader(header, type);
|
||||
return value != null ? String.valueOf(value) : exchange.getIn().getHeader(header, String.class);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ abstract class ApiGatewayProxyRequest {
|
|||
fields.iterator().next());
|
||||
}
|
||||
|
||||
static ApiGatewayProxyRequest forStream(final InputStream source) throws IOException {
|
||||
static ApiGatewayProxyRequest forStream(InputStream source) throws IOException {
|
||||
|
||||
if (noHttpPropagationNeeded()) {
|
||||
return new NoopRequest(source);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public abstract class AbstractExecutorInstrumentation implements TypeInstrumenta
|
|||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
ElementMatcher.Junction<TypeDescription> matcher = any();
|
||||
final ElementMatcher.Junction<TypeDescription> hasExecutorInterfaceMatcher =
|
||||
ElementMatcher.Junction<TypeDescription> hasExecutorInterfaceMatcher =
|
||||
implementsInterface(named(Executor.class.getName()));
|
||||
if (!INCLUDE_ALL) {
|
||||
matcher =
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class FutureInstrumentation implements TypeInstrumentation {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
final ElementMatcher.Junction<TypeDescription> hasFutureInterfaceMatcher =
|
||||
ElementMatcher.Junction<TypeDescription> hasFutureInterfaceMatcher =
|
||||
implementsInterface(named(Future.class.getName()));
|
||||
return new ElementMatcher.Junction.AbstractBase<TypeDescription>() {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -53,11 +53,11 @@ public class GuavaListenableFutureInstrumentation implements TypeInstrumentation
|
|||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||
public static State addListenerEnter(
|
||||
@Advice.Argument(value = 0, readOnly = false) Runnable task) {
|
||||
final Context context = Java8BytecodeBridge.currentContext();
|
||||
final Runnable newTask = RunnableWrapper.wrapIfNeeded(task);
|
||||
Context context = Java8BytecodeBridge.currentContext();
|
||||
Runnable newTask = RunnableWrapper.wrapIfNeeded(task);
|
||||
if (ExecutorInstrumentationUtils.shouldAttachStateToTask(newTask)) {
|
||||
task = newTask;
|
||||
final ContextStore<Runnable, State> contextStore =
|
||||
ContextStore<Runnable, State> contextStore =
|
||||
InstrumentationContext.get(Runnable.class, State.class);
|
||||
return ExecutorInstrumentationUtils.setupState(contextStore, newTask, context);
|
||||
}
|
||||
|
|
@ -66,7 +66,7 @@ public class GuavaListenableFutureInstrumentation implements TypeInstrumentation
|
|||
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
||||
public static void addListenerExit(
|
||||
@Advice.Enter final State state, @Advice.Thrown final Throwable throwable) {
|
||||
@Advice.Enter State state, @Advice.Thrown Throwable throwable) {
|
||||
ExecutorInstrumentationUtils.cleanUpOnMethodExit(state, throwable);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public final class MessagePropertyGetter implements TextMapGetter<MessageWithDes
|
|||
@Override
|
||||
public String get(MessageWithDestination carrier, String key) {
|
||||
String propName = key.replace("-", MessagePropertySetter.DASH);
|
||||
Object value;
|
||||
final Object value;
|
||||
try {
|
||||
value = carrier.getMessage().getObjectProperty(propName);
|
||||
} catch (JMSException e) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ final class LoggingEventWrapper implements ILoggingEvent {
|
|||
this.event = event;
|
||||
this.mdcPropertyMap = mdcPropertyMap;
|
||||
|
||||
final LoggerContextVO oldVo = event.getLoggerContextVO();
|
||||
LoggerContextVO oldVo = event.getLoggerContextVO();
|
||||
if (oldVo != null) {
|
||||
vo = new LoggerContextVO(oldVo.getName(), mdcPropertyMap, oldVo.getBirthTime());
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public final class UnionMap<K, V> extends AbstractMap<K, V> {
|
|||
|
||||
@Override
|
||||
public V get(Object key) {
|
||||
final V value = first.get(key);
|
||||
V value = first.get(key);
|
||||
return value != null ? value : second.get(key);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public class Bridging {
|
|||
}
|
||||
|
||||
public static io.opentelemetry.api.common.Attributes toAgent(Attributes applicationAttributes) {
|
||||
final io.opentelemetry.api.common.AttributesBuilder agentAttributes =
|
||||
io.opentelemetry.api.common.AttributesBuilder agentAttributes =
|
||||
io.opentelemetry.api.common.Attributes.builder();
|
||||
applicationAttributes.forEach(
|
||||
(key, value) -> {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public final class GarbageCollector {
|
|||
List<GarbageCollectorMXBean> garbageCollectors = ManagementFactory.getGarbageCollectorMXBeans();
|
||||
Meter meter = GlobalMeterProvider.getMeter(GarbageCollector.class.getName());
|
||||
List<Labels> labelSets = new ArrayList<>(garbageCollectors.size());
|
||||
for (final GarbageCollectorMXBean gc : garbageCollectors) {
|
||||
for (GarbageCollectorMXBean gc : garbageCollectors) {
|
||||
labelSets.add(Labels.of(GC_LABEL_KEY, gc.getName()));
|
||||
}
|
||||
meter
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ public final class TracingAssembly {
|
|||
biCompose(
|
||||
oldOnCompletableSubscribe,
|
||||
(completable, observer) -> {
|
||||
final Context context = Context.current();
|
||||
Context context = Context.current();
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
return new TracingCompletableObserver(observer, context);
|
||||
}
|
||||
|
|
@ -187,7 +187,7 @@ public final class TracingAssembly {
|
|||
biCompose(
|
||||
oldOnFlowableSubscribe,
|
||||
(flowable, subscriber) -> {
|
||||
final Context context = Context.current();
|
||||
Context context = Context.current();
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
if (subscriber instanceof ConditionalSubscriber) {
|
||||
return new TracingConditionalSubscriber<>(
|
||||
|
|
@ -207,7 +207,7 @@ public final class TracingAssembly {
|
|||
biCompose(
|
||||
oldOnObservableSubscribe,
|
||||
(observable, observer) -> {
|
||||
final Context context = Context.current();
|
||||
Context context = Context.current();
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
return new TracingObserver(observer, context);
|
||||
}
|
||||
|
|
@ -222,7 +222,7 @@ public final class TracingAssembly {
|
|||
biCompose(
|
||||
oldOnSingleSubscribe,
|
||||
(single, singleObserver) -> {
|
||||
final Context context = Context.current();
|
||||
Context context = Context.current();
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
return new TracingSingleObserver(singleObserver, context);
|
||||
}
|
||||
|
|
@ -238,7 +238,7 @@ public final class TracingAssembly {
|
|||
oldOnMaybeSubscribe,
|
||||
(BiFunction<Maybe, MaybeObserver, MaybeObserver>)
|
||||
(maybe, maybeObserver) -> {
|
||||
final Context context = Context.current();
|
||||
Context context = Context.current();
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
return new TracingMaybeObserver(maybeObserver, context);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ class TracingCompletableObserver implements CompletableObserver, Disposable {
|
|||
private final Context context;
|
||||
private Disposable disposable;
|
||||
|
||||
TracingCompletableObserver(final CompletableObserver actual, final Context context) {
|
||||
TracingCompletableObserver(CompletableObserver actual, Context context) {
|
||||
this.actual = actual;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribe(final Disposable d) {
|
||||
public void onSubscribe(Disposable d) {
|
||||
if (!DisposableHelper.validate(disposable, d)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ class TracingCompletableObserver implements CompletableObserver, Disposable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onError(final Throwable e) {
|
||||
public void onError(Throwable e) {
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
actual.onError(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,7 @@ class TracingConditionalSubscriber<T> extends BasicFuseableConditionalSubscriber
|
|||
private final ConditionalSubscriber<? super T> wrappedSubscriber;
|
||||
private final Context context;
|
||||
|
||||
TracingConditionalSubscriber(
|
||||
final ConditionalSubscriber<? super T> actual, final Context context) {
|
||||
TracingConditionalSubscriber(ConditionalSubscriber<? super T> actual, Context context) {
|
||||
super(actual);
|
||||
this.wrappedSubscriber = actual;
|
||||
this.context = context;
|
||||
|
|
@ -72,9 +71,9 @@ class TracingConditionalSubscriber<T> extends BasicFuseableConditionalSubscriber
|
|||
|
||||
@Override
|
||||
public int requestFusion(int mode) {
|
||||
final QueueSubscription<T> qs = this.qs;
|
||||
QueueSubscription<T> qs = this.qs;
|
||||
if (qs != null) {
|
||||
final int m = qs.requestFusion(mode);
|
||||
int m = qs.requestFusion(mode);
|
||||
sourceMode = m;
|
||||
return m;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ class TracingMaybeObserver<T> implements MaybeObserver<T>, Disposable {
|
|||
private final Context context;
|
||||
private Disposable disposable;
|
||||
|
||||
TracingMaybeObserver(final MaybeObserver<T> actual, final Context context) {
|
||||
TracingMaybeObserver(MaybeObserver<T> actual, Context context) {
|
||||
this.actual = actual;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribe(final Disposable d) {
|
||||
public void onSubscribe(Disposable d) {
|
||||
if (!DisposableHelper.validate(disposable, d)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -49,14 +49,14 @@ class TracingMaybeObserver<T> implements MaybeObserver<T>, Disposable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(final T t) {
|
||||
public void onSuccess(T t) {
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
actual.onSuccess(t);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(final Throwable e) {
|
||||
public void onError(Throwable e) {
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
actual.onError(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class TracingObserver<T> extends BasicFuseableObserver<T, T> {
|
|||
private final Observer<? super T> wrappedObserver;
|
||||
private final Context context;
|
||||
|
||||
TracingObserver(final Observer<? super T> actual, final Context context) {
|
||||
TracingObserver(Observer<? super T> actual, Context context) {
|
||||
super(actual);
|
||||
this.wrappedObserver = actual;
|
||||
this.context = context;
|
||||
|
|
@ -67,9 +67,9 @@ class TracingObserver<T> extends BasicFuseableObserver<T, T> {
|
|||
|
||||
@Override
|
||||
public int requestFusion(int mode) {
|
||||
final QueueDisposable<T> qd = getQueueDisposable();
|
||||
QueueDisposable<T> qd = getQueueDisposable();
|
||||
if (qd != null) {
|
||||
final int m = qd.requestFusion(mode);
|
||||
int m = qd.requestFusion(mode);
|
||||
sourceMode = m;
|
||||
return m;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,21 +33,21 @@ class TracingParallelFlowable<T> extends ParallelFlowable<T> {
|
|||
private final ParallelFlowable<T> source;
|
||||
private final Context context;
|
||||
|
||||
TracingParallelFlowable(final ParallelFlowable<T> source, final Context context) {
|
||||
TracingParallelFlowable(ParallelFlowable<T> source, Context context) {
|
||||
this.source = source;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void subscribe(final Subscriber<? super T>[] subscribers) {
|
||||
public void subscribe(Subscriber<? super T>[] subscribers) {
|
||||
if (!validate(subscribers)) {
|
||||
return;
|
||||
}
|
||||
final int n = subscribers.length;
|
||||
final Subscriber<? super T>[] parents = new Subscriber[n];
|
||||
int n = subscribers.length;
|
||||
Subscriber<? super T>[] parents = new Subscriber[n];
|
||||
for (int i = 0; i < n; i++) {
|
||||
final Subscriber<? super T> z = subscribers[i];
|
||||
Subscriber<? super T> z = subscribers[i];
|
||||
if (z instanceof ConditionalSubscriber) {
|
||||
parents[i] =
|
||||
new TracingConditionalSubscriber<>((ConditionalSubscriber<? super T>) z, context);
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ class TracingSingleObserver<T> implements SingleObserver<T>, Disposable {
|
|||
private final Context context;
|
||||
private Disposable disposable;
|
||||
|
||||
TracingSingleObserver(final SingleObserver<T> actual, final Context context) {
|
||||
TracingSingleObserver(SingleObserver<T> actual, Context context) {
|
||||
this.actual = actual;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribe(final Disposable d) {
|
||||
public void onSubscribe(Disposable d) {
|
||||
if (!DisposableHelper.validate(disposable, d)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ class TracingSingleObserver<T> implements SingleObserver<T>, Disposable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(final T t) {
|
||||
public void onSuccess(T t) {
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
actual.onSuccess(t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class TracingSubscriber<T> extends BasicFuseableSubscriber<T, T> {
|
|||
private final Subscriber<? super T> wrappedSubscriber;
|
||||
private final Context context;
|
||||
|
||||
TracingSubscriber(final Subscriber<? super T> actual, final Context context) {
|
||||
TracingSubscriber(Subscriber<? super T> actual, Context context) {
|
||||
super(actual);
|
||||
this.wrappedSubscriber = actual;
|
||||
this.context = context;
|
||||
|
|
@ -64,9 +64,9 @@ class TracingSubscriber<T> extends BasicFuseableSubscriber<T, T> {
|
|||
|
||||
@Override
|
||||
public int requestFusion(int mode) {
|
||||
final QueueSubscription<T> qs = this.qs;
|
||||
QueueSubscription<T> qs = this.qs;
|
||||
if (qs != null) {
|
||||
final int m = qs.requestFusion(mode);
|
||||
int m = qs.requestFusion(mode);
|
||||
sourceMode = m;
|
||||
return m;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ public final class TracingAssembly {
|
|||
biCompose(
|
||||
oldOnCompletableSubscribe,
|
||||
(completable, observer) -> {
|
||||
final Context context = Context.current();
|
||||
Context context = Context.current();
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
return new TracingCompletableObserver(observer, context);
|
||||
}
|
||||
|
|
@ -187,7 +187,7 @@ public final class TracingAssembly {
|
|||
biCompose(
|
||||
oldOnFlowableSubscribe,
|
||||
(flowable, subscriber) -> {
|
||||
final Context context = Context.current();
|
||||
Context context = Context.current();
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
if (subscriber instanceof ConditionalSubscriber) {
|
||||
return new TracingConditionalSubscriber<>(
|
||||
|
|
@ -206,7 +206,7 @@ public final class TracingAssembly {
|
|||
biCompose(
|
||||
oldOnObservableSubscribe,
|
||||
(observable, observer) -> {
|
||||
final Context context = Context.current();
|
||||
Context context = Context.current();
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
return new TracingObserver(observer, context);
|
||||
}
|
||||
|
|
@ -220,7 +220,7 @@ public final class TracingAssembly {
|
|||
biCompose(
|
||||
oldOnSingleSubscribe,
|
||||
(single, singleObserver) -> {
|
||||
final Context context = Context.current();
|
||||
Context context = Context.current();
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
return new TracingSingleObserver(singleObserver, context);
|
||||
}
|
||||
|
|
@ -236,7 +236,7 @@ public final class TracingAssembly {
|
|||
oldOnMaybeSubscribe,
|
||||
(BiFunction<Maybe, MaybeObserver, MaybeObserver>)
|
||||
(maybe, maybeObserver) -> {
|
||||
final Context context = Context.current();
|
||||
Context context = Context.current();
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
return new TracingMaybeObserver(maybeObserver, context);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ class TracingCompletableObserver implements CompletableObserver, Disposable {
|
|||
private final Context context;
|
||||
private Disposable disposable;
|
||||
|
||||
TracingCompletableObserver(final CompletableObserver actual, final Context context) {
|
||||
TracingCompletableObserver(CompletableObserver actual, Context context) {
|
||||
this.actual = actual;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribe(final Disposable d) {
|
||||
public void onSubscribe(Disposable d) {
|
||||
if (!DisposableHelper.validate(disposable, d)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ class TracingCompletableObserver implements CompletableObserver, Disposable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onError(final Throwable e) {
|
||||
public void onError(Throwable e) {
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
actual.onError(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ class TracingConditionalSubscriber<T> extends BasicFuseableConditionalSubscriber
|
|||
|
||||
private final Context context;
|
||||
|
||||
TracingConditionalSubscriber(
|
||||
final ConditionalSubscriber<? super T> downstream, final Context context) {
|
||||
TracingConditionalSubscriber(ConditionalSubscriber<? super T> downstream, Context context) {
|
||||
super(downstream);
|
||||
this.context = context;
|
||||
}
|
||||
|
|
@ -68,9 +67,9 @@ class TracingConditionalSubscriber<T> extends BasicFuseableConditionalSubscriber
|
|||
|
||||
@Override
|
||||
public int requestFusion(int mode) {
|
||||
final QueueSubscription<T> qs = this.qs;
|
||||
QueueSubscription<T> qs = this.qs;
|
||||
if (qs != null) {
|
||||
final int m = qs.requestFusion(mode);
|
||||
int m = qs.requestFusion(mode);
|
||||
sourceMode = m;
|
||||
return m;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ class TracingMaybeObserver<T> implements MaybeObserver<T>, Disposable {
|
|||
private final Context context;
|
||||
private Disposable disposable;
|
||||
|
||||
TracingMaybeObserver(final MaybeObserver<T> actual, final Context context) {
|
||||
TracingMaybeObserver(MaybeObserver<T> actual, Context context) {
|
||||
this.actual = actual;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribe(final Disposable d) {
|
||||
public void onSubscribe(Disposable d) {
|
||||
if (!DisposableHelper.validate(disposable, d)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -49,14 +49,14 @@ class TracingMaybeObserver<T> implements MaybeObserver<T>, Disposable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(final T t) {
|
||||
public void onSuccess(T t) {
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
actual.onSuccess(t);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(final Throwable e) {
|
||||
public void onError(Throwable e) {
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
actual.onError(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class TracingObserver<T> extends BasicFuseableObserver<T, T> {
|
|||
|
||||
private final Context context;
|
||||
|
||||
TracingObserver(final Observer<? super T> downstream, final Context context) {
|
||||
TracingObserver(Observer<? super T> downstream, Context context) {
|
||||
super(downstream);
|
||||
this.context = context;
|
||||
}
|
||||
|
|
@ -60,9 +60,9 @@ class TracingObserver<T> extends BasicFuseableObserver<T, T> {
|
|||
|
||||
@Override
|
||||
public int requestFusion(int mode) {
|
||||
final QueueDisposable<T> qd = this.qd;
|
||||
QueueDisposable<T> qd = this.qd;
|
||||
if (qd != null) {
|
||||
final int m = qd.requestFusion(mode);
|
||||
int m = qd.requestFusion(mode);
|
||||
sourceMode = m;
|
||||
return m;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,21 +33,21 @@ class TracingParallelFlowable<T> extends ParallelFlowable<T> {
|
|||
private final ParallelFlowable<T> source;
|
||||
private final Context context;
|
||||
|
||||
TracingParallelFlowable(final ParallelFlowable<T> source, final Context context) {
|
||||
TracingParallelFlowable(ParallelFlowable<T> source, Context context) {
|
||||
this.source = source;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void subscribe(final Subscriber<? super T>[] subscribers) {
|
||||
public void subscribe(Subscriber<? super T>[] subscribers) {
|
||||
if (!validate(subscribers)) {
|
||||
return;
|
||||
}
|
||||
final int n = subscribers.length;
|
||||
final Subscriber<? super T>[] parents = new Subscriber[n];
|
||||
int n = subscribers.length;
|
||||
Subscriber<? super T>[] parents = new Subscriber[n];
|
||||
for (int i = 0; i < n; i++) {
|
||||
final Subscriber<? super T> z = subscribers[i];
|
||||
Subscriber<? super T> z = subscribers[i];
|
||||
if (z instanceof ConditionalSubscriber) {
|
||||
parents[i] =
|
||||
new TracingConditionalSubscriber<>((ConditionalSubscriber<? super T>) z, context);
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ class TracingSingleObserver<T> implements SingleObserver<T>, Disposable {
|
|||
private final Context context;
|
||||
private Disposable disposable;
|
||||
|
||||
TracingSingleObserver(final SingleObserver<T> actual, final Context context) {
|
||||
TracingSingleObserver(SingleObserver<T> actual, Context context) {
|
||||
this.actual = actual;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribe(final Disposable d) {
|
||||
public void onSubscribe(Disposable d) {
|
||||
if (!DisposableHelper.validate(disposable, d)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ class TracingSingleObserver<T> implements SingleObserver<T>, Disposable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(final T t) {
|
||||
public void onSuccess(T t) {
|
||||
try (Scope ignored = context.makeCurrent()) {
|
||||
actual.onSuccess(t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class TracingSubscriber<T> extends BasicFuseableSubscriber<T, T> {
|
|||
|
||||
private final Context context;
|
||||
|
||||
TracingSubscriber(final Subscriber<? super T> downstream, final Context context) {
|
||||
TracingSubscriber(Subscriber<? super T> downstream, Context context) {
|
||||
super(downstream);
|
||||
this.context = context;
|
||||
}
|
||||
|
|
@ -60,9 +60,9 @@ class TracingSubscriber<T> extends BasicFuseableSubscriber<T, T> {
|
|||
|
||||
@Override
|
||||
public int requestFusion(int mode) {
|
||||
final QueueSubscription<T> qs = this.qs;
|
||||
QueueSubscription<T> qs = this.qs;
|
||||
if (qs != null) {
|
||||
final int m = qs.requestFusion(mode);
|
||||
int m = qs.requestFusion(mode);
|
||||
sourceMode = m;
|
||||
return m;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ public class TestServlets {
|
|||
@WebServlet("/success")
|
||||
public static class Success extends HttpServlet {
|
||||
@Override
|
||||
protected void service(HttpServletRequest req, final HttpServletResponse resp) {
|
||||
final HttpServerTest.ServerEndpoint endpoint =
|
||||
protected void service(HttpServletRequest req, HttpServletResponse resp) {
|
||||
HttpServerTest.ServerEndpoint endpoint =
|
||||
HttpServerTest.ServerEndpoint.forPath(req.getServletPath());
|
||||
HttpServerTest.controller(
|
||||
endpoint,
|
||||
|
|
@ -35,8 +35,8 @@ public class TestServlets {
|
|||
@WebServlet("/query")
|
||||
public static class Query extends HttpServlet {
|
||||
@Override
|
||||
protected void service(final HttpServletRequest req, final HttpServletResponse resp) {
|
||||
final HttpServerTest.ServerEndpoint endpoint =
|
||||
protected void service(HttpServletRequest req, HttpServletResponse resp) {
|
||||
HttpServerTest.ServerEndpoint endpoint =
|
||||
HttpServerTest.ServerEndpoint.forPath(req.getServletPath());
|
||||
HttpServerTest.controller(
|
||||
endpoint,
|
||||
|
|
@ -55,8 +55,8 @@ public class TestServlets {
|
|||
@WebServlet("/redirect")
|
||||
public static class Redirect extends HttpServlet {
|
||||
@Override
|
||||
protected void service(HttpServletRequest req, final HttpServletResponse resp) {
|
||||
final HttpServerTest.ServerEndpoint endpoint =
|
||||
protected void service(HttpServletRequest req, HttpServletResponse resp) {
|
||||
HttpServerTest.ServerEndpoint endpoint =
|
||||
HttpServerTest.ServerEndpoint.forPath(req.getServletPath());
|
||||
HttpServerTest.controller(
|
||||
endpoint,
|
||||
|
|
@ -73,8 +73,8 @@ public class TestServlets {
|
|||
@WebServlet("/error-status")
|
||||
public static class ErrorServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void service(HttpServletRequest req, final HttpServletResponse resp) {
|
||||
final HttpServerTest.ServerEndpoint endpoint =
|
||||
protected void service(HttpServletRequest req, HttpServletResponse resp) {
|
||||
HttpServerTest.ServerEndpoint endpoint =
|
||||
HttpServerTest.ServerEndpoint.forPath(req.getServletPath());
|
||||
HttpServerTest.controller(
|
||||
endpoint,
|
||||
|
|
@ -93,7 +93,7 @@ public class TestServlets {
|
|||
public static class ExceptionServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void service(HttpServletRequest req, HttpServletResponse resp) {
|
||||
final HttpServerTest.ServerEndpoint endpoint =
|
||||
HttpServerTest.ServerEndpoint endpoint =
|
||||
HttpServerTest.ServerEndpoint.forPath(req.getServletPath());
|
||||
HttpServerTest.controller(
|
||||
endpoint,
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ public class FieldBackedProvider implements InstrumentationContextProvider {
|
|||
|
||||
/** Get transformer that forces helper injection onto bootstrap classloader. */
|
||||
private AgentBuilder.Transformer bootstrapHelperInjector(
|
||||
final Collection<DynamicType.Unloaded<?>> helpers) {
|
||||
Collection<DynamicType.Unloaded<?>> helpers) {
|
||||
// TODO: Better to pass through the context of the Instrumenter
|
||||
return new AgentBuilder.Transformer() {
|
||||
final HelperInjector injector =
|
||||
|
|
@ -422,8 +422,7 @@ public class FieldBackedProvider implements InstrumentationContextProvider {
|
|||
};
|
||||
}
|
||||
|
||||
private AsmVisitorWrapper getFieldInjectionVisitor(
|
||||
final String keyClassName, final String contextClassName) {
|
||||
private AsmVisitorWrapper getFieldInjectionVisitor(String keyClassName, String contextClassName) {
|
||||
return new AsmVisitorWrapper() {
|
||||
|
||||
@Override
|
||||
|
|
@ -438,7 +437,7 @@ public class FieldBackedProvider implements InstrumentationContextProvider {
|
|||
|
||||
@Override
|
||||
public ClassVisitor wrap(
|
||||
final TypeDescription instrumentedType,
|
||||
TypeDescription instrumentedType,
|
||||
ClassVisitor classVisitor,
|
||||
Implementation.Context implementationContext,
|
||||
TypePool typePool,
|
||||
|
|
@ -616,7 +615,7 @@ public class FieldBackedProvider implements InstrumentationContextProvider {
|
|||
* @return visitor that adds implementation for methods that need to be generated
|
||||
*/
|
||||
private AsmVisitorWrapper getContextStoreImplementationVisitor(
|
||||
final String keyClassName, final String contextClassName) {
|
||||
String keyClassName, String contextClassName) {
|
||||
return new AsmVisitorWrapper() {
|
||||
|
||||
@Override
|
||||
|
|
@ -631,9 +630,9 @@ public class FieldBackedProvider implements InstrumentationContextProvider {
|
|||
|
||||
@Override
|
||||
public ClassVisitor wrap(
|
||||
final TypeDescription instrumentedType,
|
||||
TypeDescription instrumentedType,
|
||||
ClassVisitor classVisitor,
|
||||
final Implementation.Context implementationContext,
|
||||
Implementation.Context implementationContext,
|
||||
TypePool typePool,
|
||||
FieldList<FieldDescription.InDefinedShape> fields,
|
||||
MethodList<?> methods,
|
||||
|
|
@ -980,8 +979,7 @@ public class FieldBackedProvider implements InstrumentationContextProvider {
|
|||
.make();
|
||||
}
|
||||
|
||||
private static AgentBuilder.Transformer getTransformerForAsmVisitor(
|
||||
final AsmVisitorWrapper visitor) {
|
||||
private static AgentBuilder.Transformer getTransformerForAsmVisitor(AsmVisitorWrapper visitor) {
|
||||
return (builder, typeDescription, classLoader, module) -> builder.visit(visitor);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue