mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Merge branch '3.5.x'
Closes gh-47621
This commit is contained in:
@@ -26,6 +26,10 @@ import java.util.List;
|
||||
import java.util.SortedSet;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.aot.hint.RuntimeHints;
|
||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
@@ -96,8 +100,11 @@ public enum JavaVersion {
|
||||
|
||||
private final boolean available;
|
||||
|
||||
private final Class<?> versionSpecificClass;
|
||||
|
||||
JavaVersion(String name, Class<?> versionSpecificClass, String versionSpecificMethod, Class<?>... paramTypes) {
|
||||
this.name = name;
|
||||
this.versionSpecificClass = versionSpecificClass;
|
||||
this.available = ClassUtils.hasMethod(versionSpecificClass, versionSpecificMethod, paramTypes);
|
||||
}
|
||||
|
||||
@@ -139,4 +146,15 @@ public enum JavaVersion {
|
||||
return compareTo(version) < 0;
|
||||
}
|
||||
|
||||
static class Hints implements RuntimeHintsRegistrar {
|
||||
|
||||
@Override
|
||||
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
|
||||
for (JavaVersion javaVersion : JavaVersion.values()) {
|
||||
hints.reflection().registerType(javaVersion.versionSpecificClass);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ org.springframework.boot.logging.log4j2.Log4J2RuntimeHints,\
|
||||
org.springframework.boot.logging.logback.LogbackRuntimeHints,\
|
||||
org.springframework.boot.logging.structured.ElasticCommonSchemaProperties$ElasticCommonSchemaPropertiesRuntimeHints,\
|
||||
org.springframework.boot.logging.structured.GraylogExtendedLogFormatProperties$GraylogExtendedLogFormatPropertiesRuntimeHints,\
|
||||
org.springframework.boot.logging.structured.StructuredLoggingJsonProperties$StructuredLoggingJsonPropertiesRuntimeHints
|
||||
org.springframework.boot.logging.structured.StructuredLoggingJsonProperties$StructuredLoggingJsonPropertiesRuntimeHints,\
|
||||
org.springframework.boot.system.JavaVersion$Hints
|
||||
|
||||
org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor=\
|
||||
org.springframework.boot.context.properties.ConfigurationPropertiesBeanFactoryInitializationAotProcessor,\
|
||||
|
||||
Reference in New Issue
Block a user