From f49cd5e9b09fa4a0763c29c5b6eca1c46be827f9 Mon Sep 17 00:00:00 2001 From: Roman Matiushchenko Date: Wed, 27 Jan 2021 23:03:15 +0200 Subject: [PATCH] remove redundant check --- .../reactor/ReactorHooksHelper.java | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/reactor/ReactorHooksHelper.java b/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/reactor/ReactorHooksHelper.java index 5f7731a22..dd759fbbd 100644 --- a/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/reactor/ReactorHooksHelper.java +++ b/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/reactor/ReactorHooksHelper.java @@ -129,14 +129,13 @@ final class ReactorHooksHelper { if (isTraceContextPropagator(current)) { return false; } - if (!isLifter(current)) { - if (!isSync(current)) { - return true; - } - if (isSourceProducer(current)) { - return false; - } + if (!isSync(current)) { + return true; + } + + if (isSourceProducer(current)) { + return false; } current = getParent(current); @@ -165,18 +164,6 @@ final class ReactorHooksHelper { return null; } - private static boolean isReactorCorePublisher(String pubClassName) { - return pubClassName != null && pubClassName.startsWith("reactor.core.publisher"); - } - - private static boolean isLifter(Publisher current) { - if (current == null) { - return false; - } - String name = current.getClass().getName(); - return isReactorCorePublisher(name) && ((name.endsWith("Lift") || name.endsWith("LiftFuseable"))); - } - /** * Decorates {@link Publisher} with {@link TraceContextPropagator} {@code Publisher}. * Mostly it is a copy of reactor-core logic from