You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by mb...@apache.org on 2005/04/20 23:46:52 UTC

svn commit: r162080 - /incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/WeakHashSet.java

Author: mbo
Date: Wed Apr 20 14:46:52 2005
New Revision: 162080

URL: http://svn.apache.org/viewcvs?rev=162080&view=rev
Log:
Change WeakHashSet implementation: cleanup WeakHashSet on remove but not on size

Modified:
    incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/WeakHashSet.java

Modified: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/WeakHashSet.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/WeakHashSet.java?rev=162080&r1=162079&r2=162080&view=diff
==============================================================================
--- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/WeakHashSet.java (original)
+++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/WeakHashSet.java Wed Apr 20 14:46:52 2005
@@ -92,17 +92,9 @@
      * @return <code>true</code> if the set contained the specified element.
      */
     public boolean remove(Object o) {
-        return super.remove(WeakElement.create(o));
-    }
-
-    /**
-     * Returns the number of elements in this set (its cardinality).
-     *
-     * @return the number of elements in this set (its cardinality).
-     */
-    public int size() {
+        boolean ret = super.remove(WeakElement.create(o));
         processQueue();
-        return super.size();
+        return ret;
     }
 
     /**