Allowed 'java.*', rather then just 'java.annotation' loading for jdk 11
This commit is contained in:
@@ -42,6 +42,7 @@ import org.springframework.util.ClassUtils;
|
||||
* {@link #run(String...)} it, cleaning up with a call to {@link #close()}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
public class ApplicationRunner {
|
||||
|
||||
@@ -69,7 +70,7 @@ public class ApplicationRunner {
|
||||
try {
|
||||
ClassUtils.overrideThreadContextClassLoader(this.classLoader);
|
||||
Class<?> cls = this.classLoader.loadClass(ContextRunner.class.getName());
|
||||
this.app = new StandardEvaluationContext(cls.newInstance());
|
||||
this.app = new StandardEvaluationContext(cls.getDeclaredConstructor().newInstance());
|
||||
this.app.setTypeLocator(new StandardTypeLocator(this.classLoader));
|
||||
runContext(this.source, defaultProperties(UUID.randomUUID().toString()),
|
||||
args);
|
||||
|
||||
@@ -81,6 +81,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Eric Bottard
|
||||
* @author Mark Fisher
|
||||
* @author Dave Syer
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
@Configuration
|
||||
class FunctionCreatorConfiguration {
|
||||
@@ -557,7 +558,7 @@ class FunctionCreatorConfiguration {
|
||||
protected Class<?> loadClass(String name, boolean resolve)
|
||||
throws ClassNotFoundException {
|
||||
try {
|
||||
if (name.startsWith("javax.annotation") && JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.NINE)) {
|
||||
if (name.startsWith("javax.") && JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.NINE)) {
|
||||
return getClass().getClassLoader().loadClass(name);
|
||||
}
|
||||
return super.loadClass(name, resolve);
|
||||
|
||||
@@ -19,15 +19,12 @@ package org.springframework.cloud.function.deployer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.junit.Assume;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.system.JavaVersion;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.cloud.function.context.FunctionCatalog;
|
||||
|
||||
Reference in New Issue
Block a user