[Jboss-cvs] JBossAS SVN: r54984 - branches/Branch_4_0/cluster/src/main/org/jboss/ha/framework/interfaces

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 1 13:12:24 EDT 2006


Author: bstansberry at jboss.com
Date: 2006-08-01 13:12:23 -0400 (Tue, 01 Aug 2006)
New Revision: 54984

Modified:
   branches/Branch_4_0/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java
Log:
[JBAS-2225] ImmutableArrayList uses delegation and serializes the delegate via writeReplace()

Modified: branches/Branch_4_0/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java
===================================================================
--- branches/Branch_4_0/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java	2006-08-01 17:11:18 UTC (rev 54983)
+++ branches/Branch_4_0/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java	2006-08-01 17:12:23 UTC (rev 54984)
@@ -22,9 +22,6 @@
 package org.jboss.ha.framework.interfaces;
 
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ListIterator;
 
 import org.jboss.ha.framework.interfaces.FamilyClusterInfo;
 
@@ -166,153 +163,4 @@
    // Private -------------------------------------------------------
    
    // Inner classes -------------------------------------------------
-   
-   private class ImmutableArrayList extends ArrayList
-   {
-      /** The serialVersionUID */
-      private static final long serialVersionUID = -991188901511748496L;
-
-      ImmutableArrayList(ArrayList source)
-      {
-         super(source);
-      }
-      
-      public void add(int arg0, Object arg1)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public boolean add(Object arg0)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public boolean addAll(Collection arg0)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public boolean addAll(int arg0, Collection arg1)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public void clear()
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public void ensureCapacity(int arg0)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public Object remove(int arg0)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public boolean remove(Object arg0)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      protected void removeRange(int arg0, int arg1)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public Object set(int arg0, Object arg1)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public void trimToSize()
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public Iterator iterator()
-      {
-         return new ImmutableArrayListIterator(super.listIterator());
-      }
-      
-      public ListIterator listIterator()
-      {
-         return new ImmutableArrayListIterator(super.listIterator());
-      }
-      
-      public ListIterator listIterator(int index)
-      {
-         return new ImmutableArrayListIterator(super.listIterator(index));
-      }
-      
-      public boolean removeAll(Collection arg0)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }
-      
-      public boolean retainAll(Collection arg0)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-      }      
-      
-   }
-   
-   private class ImmutableArrayListIterator implements ListIterator
-   {
-      private ListIterator delegate;
-      
-      ImmutableArrayListIterator(ListIterator delegate)
-      {
-         this.delegate = delegate;
-      }
-
-      public boolean hasNext()
-      {
-         return delegate.hasNext();
-      }
-
-      public Object next()
-      {
-         return delegate.next();
-      }
-
-      public void remove()
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
-         
-      }
-
-      public void add(Object o)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported"); 
-      }
-
-      public boolean hasPrevious()
-      {
-         return delegate.hasPrevious();
-      }
-
-      public int nextIndex()
-      {
-         return delegate.nextIndex();
-      }
-
-      public Object previous()
-      {
-         return delegate.previous();
-      }
-
-      public int previousIndex()
-      {
-         return delegate.previousIndex();
-      }
-
-      public void set(Object o)
-      {
-         throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");         
-      }
-      
-   }
 }




More information about the jboss-cvs-commits mailing list