db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/core/proxy CollectionProxyDefaultImpl.java IndirectionHandlerDefaultImpl.java
Date Tue, 22 Mar 2005 15:43:30 GMT
arminw      2005/03/22 07:43:30

  Modified:    src/java/org/apache/ojb/broker/core/proxy Tag:
                        OJB_1_0_RELEASE CollectionProxyDefaultImpl.java
                        IndirectionHandlerDefaultImpl.java
  Log:
  avoid multiple add of same listener
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.7.2.6   +6 -2      db-ojb/src/java/org/apache/ojb/broker/core/proxy/CollectionProxyDefaultImpl.java
  
  Index: CollectionProxyDefaultImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/proxy/CollectionProxyDefaultImpl.java,v
  retrieving revision 1.7.2.5
  retrieving revision 1.7.2.6
  diff -u -r1.7.2.5 -r1.7.2.6
  --- CollectionProxyDefaultImpl.java	3 Mar 2005 21:45:26 -0000	1.7.2.5
  +++ CollectionProxyDefaultImpl.java	22 Mar 2005 15:43:30 -0000	1.7.2.6
  @@ -636,7 +636,11 @@
           {
               _listeners = new ArrayList();
           }
  -        _listeners.add(listener);
  +        // to avoid multi-add of same listener, do check
  +        if(!_listeners.contains(listener))
  +        {
  +            _listeners.add(listener);
  +        }
       }
   
       /**
  
  
  
  1.6.2.2   +6 -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.2.1
  retrieving revision 1.6.2.2
  diff -u -r1.6.2.1 -r1.6.2.2
  --- IndirectionHandlerDefaultImpl.java	7 Nov 2004 09:06:31 -0000	1.6.2.1
  +++ IndirectionHandlerDefaultImpl.java	22 Mar 2005 15:43:30 -0000	1.6.2.2
  @@ -119,7 +119,11 @@
           {
               _listeners = new ArrayList();
           }
  -        _listeners.add(listener);
  +        // add listener only once
  +        if(!_listeners.contains(listener))
  +        {
  +            _listeners.add(listener);
  +        }
       }
   
       /**
  @@ -369,7 +373,6 @@
           try
           {
               Object realSubject = getBroker().getObjectByIdentity(_id);
  -
               if (realSubject == null)
               {
                   LoggerFactory.getLogger(IndirectionHandler.class).warn("Can not materialize
object for Identity " + _id + " - using PBKey " + _brokerKey);
  @@ -395,5 +398,4 @@
       {
           return _realSubject != null;
       }
  -
   }
  
  
  

---------------------------------------------------------------------
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