diff --git a/hibernate-core/src/main/java/org/hibernate/proxy/ProxyFactory.java b/hibernate-core/src/main/java/org/hibernate/proxy/ProxyFactory.java index 0d690d738d..46e8d3745e 100644 --- a/hibernate-core/src/main/java/org/hibernate/proxy/ProxyFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/proxy/ProxyFactory.java @@ -63,11 +63,11 @@ public interface ProxyFactory { */ public void postInstantiate( String entityName, - Class persistentClass, - Set interfaces, - Method getIdentifierMethod, - Method setIdentifierMethod, - CompositeType componentIdType) throws HibernateException; + Class persistentClass, + Set interfaces, + Method getIdentifierMethod, + Method setIdentifierMethod, + CompositeType componentIdType) throws HibernateException; /** * Create a new proxy instance diff --git a/hibernate-core/src/main/java/org/hibernate/proxy/pojo/BasicLazyInitializer.java b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/BasicLazyInitializer.java index 8d1f20b489..309be39f14 100644 --- a/hibernate-core/src/main/java/org/hibernate/proxy/pojo/BasicLazyInitializer.java +++ b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/BasicLazyInitializer.java @@ -29,7 +29,6 @@ import java.lang.reflect.Method; import org.hibernate.engine.spi.EntityKey; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.internal.util.MarkerObject; -import org.hibernate.internal.util.ReflectHelper; import org.hibernate.proxy.AbstractLazyInitializer; import org.hibernate.type.CompositeType; diff --git a/hibernate-core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java index 3e350dc451..2ccf688aa9 100644 --- a/hibernate-core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java +++ b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java @@ -48,8 +48,7 @@ import org.hibernate.type.CompositeType; */ public class JavassistLazyInitializer extends BasicLazyInitializer implements MethodHandler { - private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, - JavassistLazyInitializer.class.getName()); + private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, JavassistLazyInitializer.class.getName()); private static final MethodFilter FINALIZE_FILTER = new MethodFilter() { public boolean isHandled(Method m) { @@ -63,39 +62,39 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me private JavassistLazyInitializer( final String entityName, - final Class persistentClass, - final Class[] interfaces, - final Serializable id, - final Method getIdentifierMethod, - final Method setIdentifierMethod, - final CompositeType componentIdType, - final SessionImplementor session, - final boolean overridesEquals) { + final Class persistentClass, + final Class[] interfaces, + final Serializable id, + final Method getIdentifierMethod, + final Method setIdentifierMethod, + final CompositeType componentIdType, + final SessionImplementor session, + final boolean overridesEquals) { super( entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, componentIdType, session, overridesEquals ); this.interfaces = interfaces; } public static HibernateProxy getProxy( final String entityName, - final Class persistentClass, - final Class[] interfaces, - final Method getIdentifierMethod, - final Method setIdentifierMethod, - CompositeType componentIdType, - final Serializable id, - final SessionImplementor session) throws HibernateException { + final Class persistentClass, + final Class[] interfaces, + final Method getIdentifierMethod, + final Method setIdentifierMethod, + CompositeType componentIdType, + final Serializable id, + final SessionImplementor session) throws HibernateException { // note: interface is assumed to already contain HibernateProxy.class try { final JavassistLazyInitializer instance = new JavassistLazyInitializer( entityName, - persistentClass, - interfaces, - id, - getIdentifierMethod, - setIdentifierMethod, - componentIdType, - session, - ReflectHelper.overridesEquals(persistentClass) + persistentClass, + interfaces, + id, + getIdentifierMethod, + setIdentifierMethod, + componentIdType, + session, + ReflectHelper.overridesEquals(persistentClass) ); ProxyFactory factory = new ProxyFactory(); factory.setSuperclass( interfaces.length == 1 ? persistentClass : null ); @@ -108,32 +107,32 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me return proxy; } catch ( Throwable t ) { - LOG.error(LOG.javassistEnhancementFailed(entityName), t); - throw new HibernateException(LOG.javassistEnhancementFailed(entityName), t); + LOG.error(LOG.javassistEnhancementFailed(entityName), t); + throw new HibernateException(LOG.javassistEnhancementFailed(entityName), t); } } public static HibernateProxy getProxy( final Class factory, - final String entityName, - final Class persistentClass, - final Class[] interfaces, - final Method getIdentifierMethod, - final Method setIdentifierMethod, - final CompositeType componentIdType, - final Serializable id, - final SessionImplementor session, - final boolean classOverridesEquals) throws HibernateException { + final String entityName, + final Class persistentClass, + final Class[] interfaces, + final Method getIdentifierMethod, + final Method setIdentifierMethod, + final CompositeType componentIdType, + final Serializable id, + final SessionImplementor session, + final boolean classOverridesEquals) throws HibernateException { final JavassistLazyInitializer instance = new JavassistLazyInitializer( entityName, - persistentClass, - interfaces, id, - getIdentifierMethod, - setIdentifierMethod, - componentIdType, - session, - classOverridesEquals + persistentClass, + interfaces, id, + getIdentifierMethod, + setIdentifierMethod, + componentIdType, + session, + classOverridesEquals ); final HibernateProxy proxy; @@ -153,7 +152,7 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me public static Class getProxyFactory( Class persistentClass, - Class[] interfaces) throws HibernateException { + Class[] interfaces) throws HibernateException { // note: interfaces is assumed to already contain HibernateProxy.class try { @@ -164,8 +163,8 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me return factory.createClass(); } catch ( Throwable t ) { - LOG.error(LOG.javassistEnhancementFailed(persistentClass.getName()), t); - throw new HibernateException(LOG.javassistEnhancementFailed(persistentClass.getName()), t); + LOG.error(LOG.javassistEnhancementFailed(persistentClass.getName()), t); + throw new HibernateException(LOG.javassistEnhancementFailed(persistentClass.getName()), t); } } @@ -220,16 +219,16 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me } @Override - protected Object serializableProxy() { + protected Object serializableProxy() { return new SerializableProxy( getEntityName(), - persistentClass, - interfaces, - getIdentifier(), - ( isReadOnlySettingAvailable() ? Boolean.valueOf( isReadOnly() ) : isReadOnlyBeforeAttachedToSession() ), - getIdentifierMethod, - setIdentifierMethod, - componentIdType + persistentClass, + interfaces, + getIdentifier(), + ( isReadOnlySettingAvailable() ? Boolean.valueOf( isReadOnly() ) : isReadOnlyBeforeAttachedToSession() ), + getIdentifierMethod, + setIdentifierMethod, + componentIdType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistProxyFactory.java b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistProxyFactory.java index 2f02812106..4c719cb1b8 100644 --- a/hibernate-core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistProxyFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistProxyFactory.java @@ -53,9 +53,9 @@ public class JavassistProxyFactory implements ProxyFactory, Serializable { public void postInstantiate( final String entityName, final Class persistentClass, - final Set interfaces, + final Set interfaces, final Method getIdentifierMethod, - final Method setIdentifierMethod, + final Method setIdentifierMethod, CompositeType componentIdType) throws HibernateException { this.entityName = entityName; this.persistentClass = persistentClass; @@ -69,18 +69,18 @@ public class JavassistProxyFactory implements ProxyFactory, Serializable { public HibernateProxy getProxy( Serializable id, - SessionImplementor session) throws HibernateException { + SessionImplementor session) throws HibernateException { return JavassistLazyInitializer.getProxy( factory, - entityName, + entityName, persistentClass, - interfaces, - getIdentifierMethod, + interfaces, + getIdentifierMethod, setIdentifierMethod, - componentIdType, - id, - session, - overridesEquals + componentIdType, + id, + session, + overridesEquals ); }