From 897184362609a2277735b866e85d367dbdbbc25f Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Wed, 1 Apr 2020 11:01:37 +0100 Subject: [PATCH] Fix compilation errors after merge --- .../StandardPojoEntityRepresentationStrategy.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/StandardPojoEntityRepresentationStrategy.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/StandardPojoEntityRepresentationStrategy.java index 3ad94b53a5..57ffb2027d 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/StandardPojoEntityRepresentationStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/StandardPojoEntityRepresentationStrategy.java @@ -7,7 +7,6 @@ package org.hibernate.metamodel.internal; import java.lang.reflect.Method; -import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -47,6 +46,7 @@ import org.hibernate.property.access.spi.PropertyAccess; import org.hibernate.property.access.spi.PropertyAccessStrategy; import org.hibernate.proxy.HibernateProxy; import org.hibernate.proxy.ProxyFactory; +import org.hibernate.proxy.pojo.ProxyFactoryHelper; import org.hibernate.type.CompositeType; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry; @@ -189,14 +189,8 @@ public class StandardPojoEntityRepresentationStrategy implements EntityRepresent Class clazz = bootDescriptor.getMappedClass(); while ( properties.hasNext() ) { Property property = (Property) properties.next(); - Method method = property.getGetter( clazz ).getMethod(); - if ( method != null && Modifier.isFinal( method.getModifiers() ) ) { - LOG.gettersOfLazyClassesCannotBeFinal( bootDescriptor.getEntityName(), property.getName() ); - } - method = property.getSetter( clazz ).getMethod(); - if ( method != null && Modifier.isFinal( method.getModifiers() ) ) { - LOG.settersOfLazyClassesCannotBeFinal( bootDescriptor.getEntityName(), property.getName() ); - } + ProxyFactoryHelper.validateGetterSetterMethodProxyability( "Getter", property.getGetter( clazz ).getMethod() ); + ProxyFactoryHelper.validateGetterSetterMethodProxyability( "Setter", property.getSetter( clazz ).getMethod() ); } final Method idGetterMethod = identifierPropertyAccess == null ? null : identifierPropertyAccess.getGetter().getMethod();