Browse Source

Move reflection hints for ObjectToObjectConverter conventions to aot.hint.support

Avoids an accidental package cycle between aot and core (only aot->core allowed).

See gh-29429
pull/29492/head
Juergen Hoeller 3 years ago
parent
commit
ffd45c0e7b
  1. 7
      spring-core/src/main/java/org/springframework/aot/hint/support/ObjectToObjectConverterRuntimeHints.java
  2. 4
      spring-core/src/main/resources/META-INF/spring/aot.factories
  3. 2
      spring-core/src/test/java/org/springframework/aot/hint/support/ObjectToObjectConverterRuntimeHintsTests.java

7
spring-core/src/main/java/org/springframework/core/convert/support/ObjectToObjectConverterRuntimeHints.java → spring-core/src/main/java/org/springframework/aot/hint/support/ObjectToObjectConverterRuntimeHints.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.core.convert.support;
package org.springframework.aot.hint.support;
import java.time.LocalDate;
import java.util.Collections;
@ -27,8 +27,8 @@ import org.springframework.aot.hint.TypeReference; @@ -27,8 +27,8 @@ import org.springframework.aot.hint.TypeReference;
import org.springframework.lang.Nullable;
/**
* {@link RuntimeHintsRegistrar} to register hints for {@link ObjectToObjectConverter}
* popular conventions.
* {@link RuntimeHintsRegistrar} to register hints for popular conventions in
* {@code org.springframework.core.convert.support.ObjectToObjectConverter}.
*
* @author Sebastien Deleuze
* @since 6.0
@ -44,4 +44,5 @@ class ObjectToObjectConverterRuntimeHints implements RuntimeHintsRegistrar { @@ -44,4 +44,5 @@ class ObjectToObjectConverterRuntimeHints implements RuntimeHintsRegistrar {
.withMethod("valueOf", List.of(TypeReference.of(LocalDate.class)), ExecutableMode.INVOKE)
.onReachableType(sqlDateTypeReference));
}
}

4
spring-core/src/main/resources/META-INF/spring/aot.factories

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
org.springframework.aot.hint.RuntimeHintsRegistrar=\
org.springframework.aot.hint.support.SpringFactoriesLoaderRuntimeHints,\
org.springframework.core.convert.support.ObjectToObjectConverterRuntimeHints
org.springframework.aot.hint.support.ObjectToObjectConverterRuntimeHints,\
org.springframework.aot.hint.support.SpringFactoriesLoaderRuntimeHints

2
spring-core/src/test/java/org/springframework/core/convert/support/ObjectToObjectConverterRuntimeHintsTests.java → spring-core/src/test/java/org/springframework/aot/hint/support/ObjectToObjectConverterRuntimeHintsTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.core.convert.support;
package org.springframework.aot.hint.support;
import java.time.LocalDate;
Loading…
Cancel
Save