Removed the jdk11 classloader workaround; fixes gh-1193
This commit is contained in:
@@ -21,7 +21,6 @@ import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.aopalliance.aop.Advice;
|
||||
@@ -181,14 +180,6 @@ class ExecutorBeanPostProcessor implements BeanPostProcessor {
|
||||
factory.setProxyTargetClass(cglibProxy);
|
||||
factory.addAdvice(advice);
|
||||
factory.setTarget(bean);
|
||||
if (JavaVersion.current().isJava11Compatible()) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Creating an additional ClassLoader for JDK11");
|
||||
}
|
||||
factory.setBeanClassLoader(new ClassLoader(this.getClass().getClassLoader()) {
|
||||
|
||||
});
|
||||
}
|
||||
return getObject(factory);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,8 @@ import org.springframework.util.Assert;
|
||||
* @deprecated
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = { "spring.sleuth.enabled", "spring.zipkin.enabled" }, matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = { "spring.sleuth.enabled",
|
||||
"spring.zipkin.enabled" }, matchIfMissing = true)
|
||||
@AutoConfigureBefore(ZipkinAutoConfiguration.class)
|
||||
@Deprecated
|
||||
public class ZipkinBackwardsCompatibilityAutoConfiguration {
|
||||
|
||||
@@ -35,8 +35,7 @@ public class ZipkinBackwardsCompatibilityAutoConfigurationTests {
|
||||
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withConfiguration(AutoConfigurations.of(
|
||||
ZipkinBackwardsCompatibilityAutoConfiguration.class,
|
||||
ZipkinAutoConfiguration.class,
|
||||
TraceAutoConfiguration.class));
|
||||
ZipkinAutoConfiguration.class, TraceAutoConfiguration.class));
|
||||
|
||||
@Test
|
||||
public void shouldLoadBeans() {
|
||||
@@ -50,26 +49,24 @@ public class ZipkinBackwardsCompatibilityAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
public void shouldNotLoadBackwardsCompatibilityConfigWhenZipkinDisabled() {
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.zipkin.enabled=false")
|
||||
this.contextRunner.withPropertyValues("spring.zipkin.enabled=false")
|
||||
.run(context -> {
|
||||
assertThat(context.getBeansOfType(ZipkinProperties.class)).isEmpty();
|
||||
assertThat(context.getBeansOfType(BytesEncoder.class)).isEmpty();
|
||||
assertThat(context.getBean(ReporterMetrics.class)).isNotNull(); // TraceAutoConfiguration
|
||||
assertThat(context.getBean(Reporter.class)).isNotNull(); // noOpSpanReporter
|
||||
});
|
||||
assertThat(context.getBeansOfType(ZipkinProperties.class)).isEmpty();
|
||||
assertThat(context.getBeansOfType(BytesEncoder.class)).isEmpty();
|
||||
assertThat(context.getBean(ReporterMetrics.class)).isNotNull(); // TraceAutoConfiguration
|
||||
assertThat(context.getBean(Reporter.class)).isNotNull(); // noOpSpanReporter
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotLoadBackwardsCompatibilityConfigWhenSleuthDisabled() {
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.sleuth.enabled=false")
|
||||
this.contextRunner.withPropertyValues("spring.sleuth.enabled=false")
|
||||
.run(context -> {
|
||||
assertThat(context.getBeansOfType(ZipkinProperties.class)).isEmpty();
|
||||
assertThat(context.getBeansOfType(BytesEncoder.class)).isEmpty();
|
||||
assertThat(context.getBeansOfType(ReporterMetrics.class)).isEmpty();
|
||||
assertThat(context.getBeansOfType(Reporter.class)).isEmpty();
|
||||
});
|
||||
assertThat(context.getBeansOfType(ZipkinProperties.class)).isEmpty();
|
||||
assertThat(context.getBeansOfType(BytesEncoder.class)).isEmpty();
|
||||
assertThat(context.getBeansOfType(ReporterMetrics.class)).isEmpty();
|
||||
assertThat(context.getBeansOfType(Reporter.class)).isEmpty();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user