From: <one...@us...> - 2003-04-05 07:48:48
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy In directory sc8-pr-cvs1:/tmp/cvs-serv4078/proxy Modified Files: CGLIBLazyInitializer.java LazyInitializer.java Log Message: use CGLIB MethodProxy Index: CGLIBLazyInitializer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy/CGLIBLazyInitializer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CGLIBLazyInitializer.java 15 Feb 2003 08:00:51 -0000 1.4 --- CGLIBLazyInitializer.java 5 Apr 2003 07:48:45 -0000 1.5 *************** *** 42,47 **** } ! public Object intercept(Object obj, Method method, Object args[], MethodProxy proxy) throws Throwable{ ! return invoke(method, args); } --- 42,53 ---- } ! public Object intercept(Object obj, Method method, Object args[], MethodProxy proxy) throws Throwable { ! Object result = invoke(method, args); ! if (result==INVOKE_IMPLEMENTATION) { ! return proxy.invoke( getImplementation(), args ); ! } ! else { ! return result; ! } } Index: LazyInitializer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy/LazyInitializer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LazyInitializer.java 29 Mar 2003 04:08:48 -0000 1.6 --- LazyInitializer.java 5 Apr 2003 07:48:45 -0000 1.7 *************** *** 3,7 **** import java.io.Serializable; - import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; --- 3,6 ---- *************** *** 19,22 **** --- 18,23 ---- public abstract class LazyInitializer { + protected static final Object INVOKE_IMPLEMENTATION = new Object(); + protected Object target = null; protected Serializable id; *************** *** 105,114 **** // otherwise: ! try { return method.invoke( getImplementation(), args ); } catch (InvocationTargetException ite) { throw ite.getTargetException(); ! } } --- 106,117 ---- // otherwise: ! return INVOKE_IMPLEMENTATION; ! ! /*try { return method.invoke( getImplementation(), args ); } catch (InvocationTargetException ite) { throw ite.getTargetException(); ! }*/ } |