From 8d2b27c1d5a5804250de9ed59afd67437f8c6be6 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Tue, 15 Sep 2009 05:54:38 +0000 Subject: [PATCH] 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 ------------------------------------------------------------------------ git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@815016 13f79535-47bb-0310-9956-ffa450edef68 --- .../bag/SynchronizedSortedBag.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/java/org/apache/commons/collections/bag/SynchronizedSortedBag.java b/src/java/org/apache/commons/collections/bag/SynchronizedSortedBag.java index 1576e081e..394050fad 100644 --- a/src/java/org/apache/commons/collections/bag/SynchronizedSortedBag.java +++ b/src/java/org/apache/commons/collections/bag/SynchronizedSortedBag.java @@ -35,8 +35,8 @@ import org.apache.commons.collections.SortedBag; * * @author Stephen Colebourne */ -public class SynchronizedSortedBag - extends SynchronizedBag implements SortedBag { +public class SynchronizedSortedBag + extends SynchronizedBag implements SortedBag { /** Serialization version */ private static final long serialVersionUID = 722374056718497858L; @@ -48,8 +48,8 @@ public class SynchronizedSortedBag * @return a new synchronized SortedBag * @throws IllegalArgumentException if bag is null */ - public static SortedBag decorate(SortedBag bag) { - return new SynchronizedSortedBag(bag); + public static SortedBag decorate(SortedBag bag) { + return new SynchronizedSortedBag(bag); } //----------------------------------------------------------------------- @@ -59,7 +59,7 @@ public class SynchronizedSortedBag * @param bag the bag to decorate, must not be null * @throws IllegalArgumentException if bag is null */ - protected SynchronizedSortedBag(SortedBag bag) { + protected SynchronizedSortedBag(SortedBag bag) { super(bag); } @@ -70,7 +70,7 @@ public class SynchronizedSortedBag * @param lock the lock to use, must not be null * @throws IllegalArgumentException if bag is null */ - protected SynchronizedSortedBag(Bag bag, Object lock) { + protected SynchronizedSortedBag(Bag bag, Object lock) { super(bag, lock); } @@ -79,24 +79,24 @@ public class SynchronizedSortedBag * * @return the decorated bag */ - protected SortedBag getSortedBag() { - return (SortedBag) collection; + protected SortedBag getSortedBag() { + return (SortedBag) collection; } //----------------------------------------------------------------------- - public synchronized Object first() { + public synchronized E first() { synchronized (lock) { return getSortedBag().first(); } } - public synchronized Object last() { + public synchronized E last() { synchronized (lock) { return getSortedBag().last(); } } - public synchronized Comparator comparator() { + public synchronized Comparator comparator() { synchronized (lock) { return getSortedBag().comparator(); }