From commits-return-8612-apmail-commons-commits-archive=commons.apache.org@commons.apache.org Tue Sep 15 05:55:16 2009 Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 18015 invoked from network); 15 Sep 2009 05:55:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Sep 2009 05:55:16 -0000 Received: (qmail 98768 invoked by uid 500); 15 Sep 2009 05:55:15 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 98684 invoked by uid 500); 15 Sep 2009 05:55:15 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 98675 invoked by uid 99); 15 Sep 2009 05:55:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Sep 2009 05:55:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Sep 2009 05:55:11 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9ECB223889C6; Tue, 15 Sep 2009 05:54:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r815015 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/SynchronizedBag.java Date: Tue, 15 Sep 2009 05:54:03 -0000 To: commits@commons.apache.org From: bayard@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090915055403.9ECB223889C6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bayard Date: Tue Sep 15 05:54:03 2009 New Revision: 815015 URL: http://svn.apache.org/viewvc?rev=815015&view=rev Log: Merging from -r468106:814127 of collections_jdk5_branch - namely where this code was generified; mostly in r738956. Also see the following revisions: ------------------------------------------------------------------------ r555925 | skestle | 2007-07-13 03:39:24 -0700 (Fri, 13 Jul 2007) | 2 lines Added Edwin Tellman's patch for COLLECTIONS-243. It all seems pretty reasonable, and it should all be checked again as the project is worked through ------------------------------------------------------------------------ Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/SynchronizedBag.java Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/SynchronizedBag.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/SynchronizedBag.java?rev=815015&r1=815014&r2=815015&view=diff ============================================================================== --- commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/SynchronizedBag.java (original) +++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/SynchronizedBag.java Tue Sep 15 05:54:03 2009 @@ -36,8 +36,8 @@ * * @author Stephen Colebourne */ -public class SynchronizedBag - extends SynchronizedCollection implements Bag { +public class SynchronizedBag + extends SynchronizedCollection implements Bag { /** Serialization version */ private static final long serialVersionUID = 8084674570753837109L; @@ -49,8 +49,8 @@ * @return a new synchronized Bag * @throws IllegalArgumentException if bag is null */ - public static Bag decorate(Bag bag) { - return new SynchronizedBag(bag); + public static Bag decorate(Bag bag) { + return new SynchronizedBag(bag); } //----------------------------------------------------------------------- @@ -60,7 +60,7 @@ * @param bag the bag to decorate, must not be null * @throws IllegalArgumentException if bag is null */ - protected SynchronizedBag(Bag bag) { + protected SynchronizedBag(Bag bag) { super(bag); } @@ -71,7 +71,7 @@ * @param lock the lock to use, must not be null * @throws IllegalArgumentException if bag is null */ - protected SynchronizedBag(Bag bag, Object lock) { + protected SynchronizedBag(Bag bag, Object lock) { super(bag, lock); } @@ -80,12 +80,12 @@ * * @return the decorated bag */ - protected Bag getBag() { - return (Bag) collection; + protected Bag getBag() { + return (Bag) collection; } //----------------------------------------------------------------------- - public boolean add(Object object, int count) { + public boolean add(E object, int count) { synchronized (lock) { return getBag().add(object, count); } @@ -97,9 +97,9 @@ } } - public Set uniqueSet() { + public Set uniqueSet() { synchronized (lock) { - Set set = getBag().uniqueSet(); + Set set = getBag().uniqueSet(); return new SynchronizedBagSet(set, lock); } } @@ -114,13 +114,16 @@ /** * Synchronized Set for the Bag class. */ - class SynchronizedBagSet extends SynchronizedSet { + class SynchronizedBagSet extends SynchronizedSet { + /** Serialization version */ + private static final long serialVersionUID = 2990565892366827855L; + /** * Constructor. * @param set the set to decorate * @param lock the lock to use, shared with the bag */ - SynchronizedBagSet(Set set, Object lock) { + SynchronizedBagSet(Set set, Object lock) { super(set, lock); } }