You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by br...@apache.org on 2004/11/07 10:06:32 UTC

cvs commit: db-ojb/src/java/org/apache/ojb/broker/core/proxy IndirectionHandlerDefaultImpl.java

brj         2004/11/07 01:06:32

  Modified:    src/java/org/apache/ojb/broker/core/proxy Tag:
                        OJB_1_0_RELEASE IndirectionHandlerDefaultImpl.java
  Log:
  if method is 'equals' materialize the argument
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.6.2.1   +12 -4     db-ojb/src/java/org/apache/ojb/broker/core/proxy/IndirectionHandlerDefaultImpl.java
  
  Index: IndirectionHandlerDefaultImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/proxy/IndirectionHandlerDefaultImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- IndirectionHandlerDefaultImpl.java	19 Jun 2004 09:21:37 -0000	1.6
  +++ IndirectionHandlerDefaultImpl.java	7 Nov 2004 09:06:31 -0000	1.6.2.1
  @@ -19,14 +19,14 @@
   import java.util.ArrayList;
   
   import org.apache.ojb.broker.Identity;
  +import org.apache.ojb.broker.OJBRuntimeException;
   import org.apache.ojb.broker.PBFactoryException;
  +import org.apache.ojb.broker.PBKey;
   import org.apache.ojb.broker.PersistenceBroker;
   import org.apache.ojb.broker.PersistenceBrokerException;
   import org.apache.ojb.broker.PersistenceBrokerFactory;
   import org.apache.ojb.broker.core.PersistenceBrokerThreadMapping;
   import org.apache.ojb.broker.util.logging.LoggerFactory;
  -import org.apache.ojb.broker.PBKey;
  -import org.apache.ojb.broker.OJBRuntimeException;
   
   /**
    * Default implementation for the indirection handler used by ojb's proxies.
  @@ -308,7 +308,15 @@
                   return "unmaterialized proxy for " + id;
               }
               */
  -
  +            
  +            // BRJ: make sure that the object to be compared is a real object
  +            // otherwise equals may return false.
  +            if ("equals".equals(methodName) && args[0] != null)
  +            {
  +                Object otherObj = ProxyHelper.getRealObject(args[0]);
  +                args[0] = otherObj;
  +            }
  +            
               subject = getRealSubject();
               return method.invoke(subject, args);
               // [olegnitz] I've changed the following strange lines
  
  
  

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