Browse Source

Polishing.

Tweak naming.

Original pull request: #4352
See #4351
pull/4373/head
Mark Paluch 3 years ago
parent
commit
cc3b33e885
No known key found for this signature in database
GPG Key ID: 4406B84C1661DCD1
  1. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/aot/LazyLoadingProxyAotProcessor.java
  2. 10
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/LazyLoadingProxyFactory.java
  3. 2
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/aot/LazyLoadingProxyAotProcessorUnitTests.java

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/aot/LazyLoadingProxyAotProcessor.java

@ -74,7 +74,7 @@ public class LazyLoadingProxyAotProcessor {
} else { } else {
Class<?> proxyClass = LazyLoadingProxyFactory.resolveProxyType(field.getType(), Class<?> proxyClass = LazyLoadingProxyFactory.resolveProxyType(field.getType(),
() -> LazyLoadingInterceptor.none()); LazyLoadingInterceptor::none);
// see: spring-projects/spring-framework/issues/29309 // see: spring-projects/spring-framework/issues/29309
generationContext.getRuntimeHints().reflection().registerType(proxyClass, generationContext.getRuntimeHints().reflection().registerType(proxyClass,

10
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/LazyLoadingProxyFactory.java

@ -93,20 +93,20 @@ public final class LazyLoadingProxyFactory {
/** /**
* Create the {@link ProxyFactory} for the given type, already adding required additional interfaces. * Create the {@link ProxyFactory} for the given type, already adding required additional interfaces.
* *
* @param propertyType the type to proxy * @param targetType the type to proxy.
* @return the proxy type. * @return the prepared {@link ProxyFactory}.
* @since 4.0.5 * @since 4.0.5
*/ */
public static ProxyFactory prepareFactory(Class<?> propertyType) { public static ProxyFactory prepareFactory(Class<?> targetType) {
ProxyFactory proxyFactory = new ProxyFactory(); ProxyFactory proxyFactory = new ProxyFactory();
for (Class<?> type : propertyType.getInterfaces()) { for (Class<?> type : targetType.getInterfaces()) {
proxyFactory.addInterface(type); proxyFactory.addInterface(type);
} }
proxyFactory.addInterface(LazyLoadingProxy.class); proxyFactory.addInterface(LazyLoadingProxy.class);
proxyFactory.addInterface(propertyType); proxyFactory.addInterface(targetType);
return proxyFactory; return proxyFactory;
} }

2
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/aot/LazyLoadingProxyAotProcessorUnitTests.java

@ -29,6 +29,8 @@ import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.javapoet.ClassName; import org.springframework.javapoet.ClassName;
/** /**
* Unit tests for {@link LazyLoadingProxyAotProcessor}.
*
* @author Christoph Strobl * @author Christoph Strobl
*/ */
class LazyLoadingProxyAotProcessorUnitTests { class LazyLoadingProxyAotProcessorUnitTests {

Loading…
Cancel
Save