Browse Source

Merge branch '6.1.x'

pull/32782/head
Juergen Hoeller 2 years ago
parent
commit
645556a28c
  1. 2
      spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBeanRuntimeHints.java
  2. 3
      spring-core/src/main/java/org/springframework/aot/hint/annotation/RegisterReflectionForBinding.java
  3. 9
      spring-core/src/main/java/org/springframework/aot/hint/support/SpringFactoriesLoaderRuntimeHints.java
  4. 8
      spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactoryRuntimeHints.java
  5. 4
      spring-orm/src/main/java/org/springframework/orm/jpa/EntityManagerRuntimeHints.java
  6. 9
      spring-tx/src/main/java/org/springframework/transaction/annotation/TransactionRuntimeHints.java
  7. 4
      spring-web/src/main/java/org/springframework/http/converter/json/JacksonModulesRuntimeHints.java
  8. 4
      spring-web/src/main/java/org/springframework/http/converter/json/ProblemDetailRuntimeHints.java
  9. 6
      spring-web/src/main/java/org/springframework/web/util/WebUtilRuntimeHints.java
  10. 7
      spring-webflux/src/main/java/org/springframework/web/reactive/socket/server/support/HandshakeWebSocketServiceRuntimeHints.java
  11. 6
      spring-websocket/src/main/java/org/springframework/web/socket/server/support/HandshakeHandlerRuntimeHints.java

2
spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBeanRuntimeHints.java

@ -27,7 +27,7 @@ import org.springframework.util.ClassUtils;
/** /**
* {@link RuntimeHintsRegistrar} implementation that makes sure {@link SchedulerFactoryBean} * {@link RuntimeHintsRegistrar} implementation that makes sure {@link SchedulerFactoryBean}
* reflection entries are registered. * reflection hints are registered.
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
* @author Stephane Nicoll * @author Stephane Nicoll

3
spring-core/src/main/java/org/springframework/aot/hint/annotation/RegisterReflectionForBinding.java

@ -77,8 +77,7 @@ public @interface RegisterReflectionForBinding {
/** /**
* Classes for which reflection hints should be registered. * Classes for which reflection hints should be registered.
* <p>At least one class must be specified either via {@link #value} or * <p>At least one class must be specified either via {@link #value} or {@code classes}.
* {@code #classes}.
* @see #value() * @see #value()
*/ */
@AliasFor("value") @AliasFor("value")

9
spring-core/src/main/java/org/springframework/aot/hint/support/SpringFactoriesLoaderRuntimeHints.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2023 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -48,8 +48,8 @@ class SpringFactoriesLoaderRuntimeHints implements RuntimeHintsRegistrar {
@Override @Override
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) { public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
ClassLoader classLoaderToUse = (classLoader != null ? classLoader ClassLoader classLoaderToUse = (classLoader != null ? classLoader :
: SpringFactoriesLoaderRuntimeHints.class.getClassLoader()); SpringFactoriesLoaderRuntimeHints.class.getClassLoader());
for (String resourceLocation : RESOURCE_LOCATIONS) { for (String resourceLocation : RESOURCE_LOCATIONS) {
registerHints(hints, classLoaderToUse, resourceLocation); registerHints(hints, classLoaderToUse, resourceLocation);
} }
@ -65,6 +65,7 @@ class SpringFactoriesLoaderRuntimeHints implements RuntimeHintsRegistrar {
private void registerHints(RuntimeHints hints, ClassLoader classLoader, private void registerHints(RuntimeHints hints, ClassLoader classLoader,
String factoryClassName, List<String> implementationClassNames) { String factoryClassName, List<String> implementationClassNames) {
Class<?> factoryClass = resolveClassName(classLoader, factoryClassName); Class<?> factoryClass = resolveClassName(classLoader, factoryClassName);
if (factoryClass == null) { if (factoryClass == null) {
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {
@ -102,6 +103,7 @@ class SpringFactoriesLoaderRuntimeHints implements RuntimeHintsRegistrar {
} }
} }
private static class ExtendedSpringFactoriesLoader extends SpringFactoriesLoader { private static class ExtendedSpringFactoriesLoader extends SpringFactoriesLoader {
ExtendedSpringFactoriesLoader(@Nullable ClassLoader classLoader, Map<String, List<String>> factories) { ExtendedSpringFactoriesLoader(@Nullable ClassLoader classLoader, Map<String, List<String>> factories) {
@ -111,7 +113,6 @@ class SpringFactoriesLoaderRuntimeHints implements RuntimeHintsRegistrar {
static Map<String, List<String>> accessLoadFactoriesResource(ClassLoader classLoader, String resourceLocation) { static Map<String, List<String>> accessLoadFactoriesResource(ClassLoader classLoader, String resourceLocation) {
return SpringFactoriesLoader.loadFactoriesResource(classLoader, resourceLocation); return SpringFactoriesLoader.loadFactoriesResource(classLoader, resourceLocation);
} }
} }
} }

8
spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactoryRuntimeHints.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2022 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -24,9 +24,9 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
/** /**
* {@link RuntimeHintsRegistrar} implementation that registers reflection hints for * {@link RuntimeHintsRegistrar} implementation that registers reflection hints
* {@code EmbeddedDataSourceProxy#shutdown} in order to allow it to be used as a bean * for {@code EmbeddedDataSourceProxy#shutdown} in order to allow it to be used
* destroy method. * as a bean destroy method.
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
* @since 6.0 * @since 6.0

4
spring-orm/src/main/java/org/springframework/orm/jpa/EntityManagerRuntimeHints.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2023 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -42,6 +42,7 @@ class EntityManagerRuntimeHints implements RuntimeHintsRegistrar {
private static final String NATIVE_QUERY_IMPL_CLASS_NAME = "org.hibernate.query.sql.internal.NativeQueryImpl"; private static final String NATIVE_QUERY_IMPL_CLASS_NAME = "org.hibernate.query.sql.internal.NativeQueryImpl";
@Override @Override
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) { public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
if (ClassUtils.isPresent(HIBERNATE_SESSION_FACTORY_CLASS_NAME, classLoader)) { if (ClassUtils.isPresent(HIBERNATE_SESSION_FACTORY_CLASS_NAME, classLoader)) {
@ -71,4 +72,5 @@ class EntityManagerRuntimeHints implements RuntimeHintsRegistrar {
catch (ClassNotFoundException ignored) { catch (ClassNotFoundException ignored) {
} }
} }
} }

9
spring-tx/src/main/java/org/springframework/transaction/annotation/TransactionRuntimeHints.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2023 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -24,8 +24,8 @@ import org.springframework.aot.hint.TypeReference;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
/** /**
* {@link RuntimeHintsRegistrar} implementation that registers runtime hints for * {@link RuntimeHintsRegistrar} implementation that registers runtime hints
* transaction management. * for transaction management.
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
* @since 6.0 * @since 6.0
@ -35,7 +35,8 @@ class TransactionRuntimeHints implements RuntimeHintsRegistrar {
@Override @Override
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) { public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
hints.reflection().registerTypes(TypeReference.listOf(Isolation.class, Propagation.class), hints.reflection().registerTypes(
TypeReference.listOf(Isolation.class, Propagation.class),
TypeHint.builtWith(MemberCategory.DECLARED_FIELDS)); TypeHint.builtWith(MemberCategory.DECLARED_FIELDS));
} }

4
spring-web/src/main/java/org/springframework/http/converter/json/JacksonModulesRuntimeHints.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2022 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -25,7 +25,7 @@ import org.springframework.aot.hint.TypeHint.Builder;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
/** /**
* {@link RuntimeHintsRegistrar} implementation that registers reflection entries * {@link RuntimeHintsRegistrar} implementation that registers reflection hints
* for {@link Jackson2ObjectMapperBuilder} well-known modules. * for {@link Jackson2ObjectMapperBuilder} well-known modules.
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze

4
spring-web/src/main/java/org/springframework/http/converter/json/ProblemDetailRuntimeHints.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2023 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -24,7 +24,7 @@ import org.springframework.lang.Nullable;
import org.springframework.util.ClassUtils; import org.springframework.util.ClassUtils;
/** /**
* {@link RuntimeHintsRegistrar} implementation that registers binding reflection entries * {@link RuntimeHintsRegistrar} implementation that registers binding reflection hints
* for {@link ProblemDetail} serialization support with Jackson. * for {@link ProblemDetail} serialization support with Jackson.
* *
* @author Brian Clozel * @author Brian Clozel

6
spring-web/src/main/java/org/springframework/web/util/WebUtilRuntimeHints.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2022 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,8 +22,8 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
/** /**
* {@link RuntimeHintsRegistrar} implementation that registers resource * {@link RuntimeHintsRegistrar} implementation that registers resource hints
* hints for web util resources. * for resources in the {@code web.util} package.
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
* @since 6.0 * @since 6.0

7
spring-webflux/src/main/java/org/springframework/web/reactive/socket/server/support/HandshakeWebSocketServiceRuntimeHints.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2022 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,8 +22,8 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
/** /**
* {@link RuntimeHintsRegistrar} implementation that registers reflection hints related to * {@link RuntimeHintsRegistrar} implementation that registers reflection hints
* {@link HandshakeWebSocketService}. * related to {@link HandshakeWebSocketService}.
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
* @since 6.0 * @since 6.0
@ -35,4 +35,5 @@ class HandshakeWebSocketServiceRuntimeHints implements RuntimeHintsRegistrar {
hints.reflection().registerType(HandshakeWebSocketService.initUpgradeStrategy().getClass(), hints.reflection().registerType(HandshakeWebSocketService.initUpgradeStrategy().getClass(),
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS); MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
} }
} }

6
spring-websocket/src/main/java/org/springframework/web/socket/server/support/HandshakeHandlerRuntimeHints.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2023 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -25,7 +25,7 @@ import org.springframework.lang.Nullable;
import org.springframework.util.ClassUtils; import org.springframework.util.ClassUtils;
/** /**
* {@link RuntimeHintsRegistrar} implementation that registers reflection entries * {@link RuntimeHintsRegistrar} implementation that registers reflection hints
* for {@link AbstractHandshakeHandler}. * for {@link AbstractHandshakeHandler}.
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
@ -61,6 +61,7 @@ class HandshakeHandlerRuntimeHints implements RuntimeHintsRegistrar {
"com.ibm.websphere.wsoc.WsWsocServerContainer", classLoader); "com.ibm.websphere.wsoc.WsWsocServerContainer", classLoader);
} }
@Override @Override
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) { public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
ReflectionHints reflectionHints = hints.reflection(); ReflectionHints reflectionHints = hints.reflection();
@ -88,4 +89,5 @@ class HandshakeHandlerRuntimeHints implements RuntimeHintsRegistrar {
reflectionHints.registerType(TypeReference.of(className), reflectionHints.registerType(TypeReference.of(className),
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)); builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS));
} }
} }

Loading…
Cancel
Save