Stop using RuntimeHintsUtils#registerAnnotation

This commit is contained in:
Stephane Nicoll 2022-09-06 15:44:15 +02:00
parent e5d0e34268
commit 5e24b5a110
1 changed files with 2 additions and 2 deletions

View File

@ -18,9 +18,9 @@ package org.test;
import org.test.SampleApplication.SampleApplicationRuntimeHints; import org.test.SampleApplication.SampleApplicationRuntimeHints;
import org.springframework.aop.framework.AopProxyUtils;
import org.springframework.aot.hint.RuntimeHints; import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar; import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.support.RuntimeHintsUtils;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportRuntimeHints; import org.springframework.context.annotation.ImportRuntimeHints;
@ -39,7 +39,7 @@ public class SampleApplication {
@Override @Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) { public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
// Force creation of at least one JDK proxy // Force creation of at least one JDK proxy
RuntimeHintsUtils.registerAnnotation(hints, Service.class); hints.proxies().registerJdkProxy(AopProxyUtils.completeJdkProxyInterfaces(Service.class));
} }
} }