From 491b7771d02a6ce0d6f1e26f9c26a7522c221bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Tue, 16 Aug 2022 16:28:27 +0200 Subject: [PATCH] Register proper caching annotation runtime hints See gh-28943 --- .../java/org/springframework/cache/annotation/CacheEvict.java | 2 ++ .../java/org/springframework/cache/annotation/CachePut.java | 2 ++ .../java/org/springframework/cache/annotation/Cacheable.java | 2 ++ .../java/org/springframework/cache/annotation/Caching.java | 3 +++ 4 files changed, 9 insertions(+) diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java b/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java index 7ae0930580..43f095236a 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java @@ -23,6 +23,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.aot.hint.annotation.Reflective; import org.springframework.core.annotation.AliasFor; /** @@ -42,6 +43,7 @@ import org.springframework.core.annotation.AliasFor; @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented +@Reflective public @interface CacheEvict { /** diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java b/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java index d711fe4fc0..9bf3c5706c 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java @@ -23,6 +23,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.aot.hint.annotation.Reflective; import org.springframework.core.annotation.AliasFor; /** @@ -50,6 +51,7 @@ import org.springframework.core.annotation.AliasFor; @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented +@Reflective public @interface CachePut { /** diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java index 6d626e7832..51ea3ec258 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java @@ -24,6 +24,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.util.concurrent.Callable; +import org.springframework.aot.hint.annotation.Reflective; import org.springframework.core.annotation.AliasFor; /** @@ -58,6 +59,7 @@ import org.springframework.core.annotation.AliasFor; @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented +@Reflective public @interface Cacheable { /** diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java b/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java index 7deb26ad90..02b291eb24 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java @@ -23,6 +23,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.aot.hint.annotation.Reflective; + /** * Group annotation for multiple cache annotations (of different or the same type). * @@ -37,6 +39,7 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented +@Reflective public @interface Caching { Cacheable[] cacheable() default {};