db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/core/proxy ProxyFactoryCGLIBImpl.java
Date Sat, 02 Apr 2005 17:19:20 GMT
tomdz       2005/04/02 09:19:20

  Modified:    src/java/org/apache/ojb/broker/core/proxy
                        ProxyFactoryCGLIBImpl.java
  Log:
  Small fix to the CGLib proxy factory implementation that removes a problem when used with
interfaces (as for example in the MultithreadedReadTest)
  
  Revision  Changes    Path
  1.2       +12 -1     db-ojb/src/java/org/apache/ojb/broker/core/proxy/ProxyFactoryCGLIBImpl.java
  
  Index: ProxyFactoryCGLIBImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/proxy/ProxyFactoryCGLIBImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProxyFactoryCGLIBImpl.java	2 Apr 2005 09:44:39 -0000	1.1
  +++ ProxyFactoryCGLIBImpl.java	2 Apr 2005 17:19:20 -0000	1.2
  @@ -51,7 +51,18 @@
   
           if (factory == null)
           {
  -            result = (Factory)Enhancer.create(baseClass, new Class[] { OJBProxy.class },
(Callback)handler);
  +            Class[] interfaces;
  +
  +            if (baseClass.isInterface())
  +            {
  +                interfaces = new Class[]{ baseClass, OJBProxy.class };
  +            }
  +            else
  +            {
  +                interfaces = new Class[]{ OJBProxy.class };
  +            }
  +            
  +            result = (Factory)Enhancer.create(baseClass, interfaces, (Callback)handler);
               proxyFactories.put(baseClass, result);
           }
           else
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message