GH-251 Initial attempt to fix Java 11 issues
polishing polishing
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -54,6 +55,11 @@
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -42,7 +42,6 @@ import javax.annotation.PreDestroy;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
|
||||
@@ -52,6 +51,7 @@ import org.springframework.boot.loader.JarLauncher;
|
||||
import org.springframework.boot.loader.archive.Archive;
|
||||
import org.springframework.boot.loader.archive.ExplodedArchive;
|
||||
import org.springframework.boot.loader.archive.JarFileArchive;
|
||||
import org.springframework.boot.system.JavaVersion;
|
||||
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader;
|
||||
import org.springframework.cloud.function.context.FunctionCatalog;
|
||||
import org.springframework.cloud.function.context.FunctionRegistration;
|
||||
@@ -557,6 +557,9 @@ class FunctionCreatorConfiguration {
|
||||
protected Class<?> loadClass(String name, boolean resolve)
|
||||
throws ClassNotFoundException {
|
||||
try {
|
||||
if (name.startsWith("javax.annotation") && JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.NINE)) {
|
||||
return getClass().getClassLoader().loadClass(name);
|
||||
}
|
||||
return super.loadClass(name, resolve);
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
|
||||
@@ -163,12 +163,6 @@ public abstract class FunctionCreatorConfigurationTests {
|
||||
public static class SupplierCompositionTests
|
||||
extends FunctionCreatorConfigurationTests {
|
||||
|
||||
@BeforeClass
|
||||
public static void init() {
|
||||
Assume.assumeTrue("Java > 8",
|
||||
JavaVersion.getJavaVersion().isOlderThan(JavaVersion.NINE));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSupplier() {
|
||||
Supplier<Integer> function = catalog.lookup(Supplier.class, "function0");
|
||||
@@ -191,12 +185,6 @@ public abstract class FunctionCreatorConfigurationTests {
|
||||
public static class FunctionCompositionTests
|
||||
extends FunctionCreatorConfigurationTests {
|
||||
|
||||
@BeforeClass
|
||||
public static void init() {
|
||||
Assume.assumeTrue("Java > 8",
|
||||
JavaVersion.getJavaVersion().isOlderThan(JavaVersion.NINE));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFunction() {
|
||||
Function<Flux<Integer>, Flux<String>> function = catalog
|
||||
@@ -219,12 +207,6 @@ public abstract class FunctionCreatorConfigurationTests {
|
||||
public static class ConsumerCompositionTests
|
||||
extends FunctionCreatorConfigurationTests {
|
||||
|
||||
@BeforeClass
|
||||
public static void init() {
|
||||
Assume.assumeTrue("Java > 8",
|
||||
JavaVersion.getJavaVersion().isOlderThan(JavaVersion.NINE));
|
||||
}
|
||||
|
||||
@Rule
|
||||
public OutputCapture capture = new OutputCapture();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user