db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/util/collections RemovalAwareList.java RemovalAwareCollection.java
Date Wed, 15 Sep 2004 18:12:51 GMT
brj         2004/09/15 11:12:51

  Modified:    src/java/org/apache/ojb/broker/util/collections
                        RemovalAwareList.java RemovalAwareCollection.java
  Log:
  fixed issue OJB285, patch by Carsten Ziegeler
  
  Revision  Changes    Path
  1.5       +19 -1     db-ojb/src/java/org/apache/ojb/broker/util/collections/RemovalAwareList.java
  
  Index: RemovalAwareList.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/collections/RemovalAwareList.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemovalAwareList.java	30 Apr 2004 20:14:24 -0000	1.4
  +++ RemovalAwareList.java	15 Sep 2004 18:12:51 -0000	1.5
  @@ -92,6 +92,24 @@
       }
   
   
  +    protected void removeFromDeletion(Object toBeReadded)
  +    {
  +        if (allObjectsToBeRemoved.contains(toBeReadded))
  +        {
  +            this.allObjectsToBeRemoved.remove(toBeReadded);
  +        }
  +    }
  +
  +    /**
  +     * @see java.util.Collection#add(Object)
  +     */
  +    public boolean add(Object o) 
  +    {
  +        boolean result = super.add(o);
  +        removeFromDeletion(o);
  +        return result;
  +    }
  +
       /**
        * @see java.util.Vector#removeElementAt(int)
        */
  
  
  
  1.8       +19 -1     db-ojb/src/java/org/apache/ojb/broker/util/collections/RemovalAwareCollection.java
  
  Index: RemovalAwareCollection.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/collections/RemovalAwareCollection.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RemovalAwareCollection.java	30 Apr 2004 20:14:24 -0000	1.7
  +++ RemovalAwareCollection.java	15 Sep 2004 18:12:51 -0000	1.8
  @@ -82,6 +82,24 @@
           return result;
       }
   
  +    protected void removeFromDeletion(Object toBeReadded)
  +    {
  +        if (allObjectsToBeRemoved.contains(toBeReadded))
  +        {
  +            this.allObjectsToBeRemoved.remove(toBeReadded);
  +        }
  +    }
  +
  +    /**
  +     * @see java.util.Collection#add(Object)
  +     */
  +    public boolean add(Object o) 
  +    {
  +        boolean result = super.add(o);
  +        removeFromDeletion(o);
  +        return result;
  +    }
  +    
       /**
        * @see java.util.Vector#removeAllElements()
        */
  
  
  

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