Author: bayard
Date: Tue Sep 15 05:54:00 2009
New Revision: 815012
URL: http://svn.apache.org/viewvc?rev=815012&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
------------------------------------------------------------------------
r471201 | scolebourne | 2006-11-04 06:17:26 -0800 (Sat, 04 Nov 2006) | 1
line
Remove getBag() - use covariant decorated()
------------------------------------------------------------------------
Modified:
commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/AbstractSortedBagDecorator.java
Modified:
commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/AbstractSortedBagDecorator.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/AbstractSortedBagDecorator.java?rev=815012&r1=815011&r2=815012&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/AbstractSortedBagDecorator.java
(original)
+++
commons/proper/collections/trunk/src/java/org/apache/commons/collections/bag/AbstractSortedBagDecorator.java
Tue Sep 15 05:54:00 2009
@@ -30,8 +30,11 @@
*
* @author Stephen Colebourne
*/
-public abstract class AbstractSortedBagDecorator
- extends AbstractBagDecorator implements SortedBag {
+public abstract class AbstractSortedBagDecorator<E>
+ extends AbstractBagDecorator<E> implements SortedBag<E> {
+
+ /** Serialization version */
+ private static final long serialVersionUID = -8223473624050467718L;
/**
* Constructor only used in deserialization, do not use otherwise.
@@ -47,7 +50,7 @@
* @param bag the bag to decorate, must not be null
* @throws IllegalArgumentException if list is null
*/
- protected AbstractSortedBagDecorator(SortedBag bag) {
+ protected AbstractSortedBagDecorator(SortedBag<E> bag) {
super(bag);
}
@@ -56,21 +59,21 @@
*
* @return the decorated bag
*/
- protected SortedBag getSortedBag() {
- return (SortedBag) getCollection();
+ protected SortedBag<E> decorated() {
+ return (SortedBag<E>) super.decorated();
}
//-----------------------------------------------------------------------
- public Object first() {
- return getSortedBag().first();
+ public E first() {
+ return decorated().first();
}
- public Object last() {
- return getSortedBag().last();
+ public E last() {
+ return decorated().last();
}
- public Comparator comparator() {
- return getSortedBag().comparator();
+ public Comparator<? super E> comparator() {
+ return decorated().comparator();
}
}