You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2009/09/15 07:56:37 UTC

svn commit: r815095 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/AbstractSetDecorator.java

Author: bayard
Date: Tue Sep 15 05:56:36 2009
New Revision: 815095

URL: http://svn.apache.org/viewvc?rev=815095&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:

    ------------------------------------------------------------------------
    r471186 | scolebourne | 2006-11-04 05:47:51 -0800 (Sat, 04 Nov 2006) | 1 line
    
    Remove getSet() and getSortedSet() - use decorated()
    ------------------------------------------------------------------------
    r471173 | scolebourne | 2006-11-04 04:07:39 -0800 (Sat, 04 Nov 2006) | 1 line
    
    Abstract*Decorator - Generify and use covariant return types
    ------------------------------------------------------------------------

Modified:
    commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/AbstractSetDecorator.java

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/AbstractSetDecorator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/AbstractSetDecorator.java?rev=815095&r1=815094&r2=815095&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/AbstractSetDecorator.java (original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/AbstractSetDecorator.java Tue Sep 15 05:56:36 2009
@@ -25,12 +25,17 @@
  * <p>
  * Methods are forwarded directly to the decorated set.
  *
+ * @param <E> the type of the elements in the set
  * @since Commons Collections 3.0
  * @version $Revision$ $Date$
  *
  * @author Stephen Colebourne
  */
-public abstract class AbstractSetDecorator extends AbstractCollectionDecorator implements Set {
+public abstract class AbstractSetDecorator<E> extends AbstractCollectionDecorator<E> implements
+        Set<E> {
+
+    /** Serialization version */
+    private static final long serialVersionUID = -4678668309576958546L;
 
     /**
      * Constructor only used in deserialization, do not use otherwise.
@@ -46,7 +51,7 @@
      * @param set  the set to decorate, must not be null
      * @throws IllegalArgumentException if set is null
      */
-    protected AbstractSetDecorator(Set set) {
+    protected AbstractSetDecorator(Set<E> set) {
         super(set);
     }
 
@@ -55,8 +60,8 @@
      * 
      * @return the decorated set
      */
-    protected Set getSet() {
-        return (Set) getCollection();
+    protected Set<E> decorated() {
+        return (Set<E>) super.decorated();
     }
 
 }