[jboss-cvs] JBossCache/src/org/jboss/cache/aop/collection ...

Manik Surtani msurtani at jboss.com
Fri Oct 13 06:24:46 EDT 2006


  User: msurtani
  Date: 06/10/13 06:24:46

  Modified:    src/org/jboss/cache/aop/collection  CachedSetImpl.java
  Log:
  Charset problems
  
  Revision  Changes    Path
  1.16      +66 -31    JBossCache/src/org/jboss/cache/aop/collection/CachedSetImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CachedSetImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/aop/collection/CachedSetImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- CachedSetImpl.java	1 Jun 2006 03:56:44 -0000	1.15
  +++ CachedSetImpl.java	13 Oct 2006 10:24:46 -0000	1.16
  @@ -13,14 +13,19 @@
   import org.jboss.cache.aop.util.AopUtil;
   import org.jboss.cache.aop.util.Null;
   
  -import java.util.*;
  +import java.util.AbstractSet;
  +import java.util.Collection;
  +import java.util.Collections;
  +import java.util.Iterator;
  +import java.util.Map;
  +import java.util.Set;
   
   /**
    * Set that uses cache as a underlying backend store
    *
    * @author Ben Wang
    * @author Scott Marlow
  - * @author Jussi Pyörre
  + * @author Jussi Pyorre
    */
   public class CachedSetImpl extends AbstractSet
   {
  @@ -37,9 +42,12 @@
   
      protected DataNode getNode()
      {
  -      try {
  +      try
  +      {
            return cache_._get(getFqn());
  -      } catch (Exception e) {
  +      }
  +      catch (Exception e)
  +      {
            throw new RuntimeException(e);
         }
      }
  @@ -81,25 +89,36 @@
         while (keys.contains((keyString = Integer.toString(key))))
            key++;
   
  -      try {
  +      try
  +      {
            cache_.putObject(AopUtil.constructFqn(getFqn(), keyString), Null.toNullObject(o));
            return true;
  -      } catch (CacheException e) {
  +      }
  +      catch (CacheException e)
  +      {
            throw new RuntimeException(e);
         }
      }
   
  -   public boolean contains(Object o) {
  +   public boolean contains(Object o)
  +   {
         Iterator iter = iterator();
  -      if (o==null) {
  -         while (iter.hasNext()) {
  -            if (iter.next()==null) {
  +      if (o == null)
  +      {
  +         while (iter.hasNext())
  +         {
  +            if (iter.next() == null)
  +            {
                  return true;
               }
            }
  -     } else {
  -         while (iter.hasNext()) {
  -            if (o.equals(iter.next())) {
  +      }
  +      else
  +      {
  +         while (iter.hasNext())
  +         {
  +            if (o.equals(iter.next()))
  +            {
                return true;
               }
            }
  @@ -108,12 +127,14 @@
        }
   
   
  -   public String toString() {
  +   public String toString()
  +   {
         StringBuffer buf = new StringBuffer();
  -      for(Iterator it = iterator(); it.hasNext();) {
  +      for (Iterator it = iterator(); it.hasNext();)
  +      {
            Object key = it.next();
            buf.append("[").append(key).append("]");
  -         if(it.hasNext()) buf.append(", ");
  +         if (it.hasNext()) buf.append(", ");
         }
   
         return buf.toString();
  @@ -127,14 +148,18 @@
         if (o == this)
            return true;
   
  -      try {
  +      try
  +      {
            Set set = (Set) o;
   
            return (set.size() == keySet().size() && this.containsAll(set));
  -      } catch (ClassCastException e) {
  +      }
  +      catch (ClassCastException e)
  +      {
            return false;
         }
  -      catch (NullPointerException unused) {
  +      catch (NullPointerException unused)
  +      {
            return false;
         }
      }
  @@ -143,10 +168,12 @@
      {
         DataNode node = getNode();
   
  -      if (node != null) {
  +      if (node != null)
  +      {
            Map children = node.getChildren();
   
  -         if (children != null) {
  +         if (children != null)
  +         {
               return children.keySet();
            }
         }
  @@ -179,21 +206,29 @@
   
            this.key = iterator.next();
   
  -         try {
  +         try
  +         {
               return Null.toNullValue(cache_.getObject(AopUtil.constructFqn(getFqn(), this.key)));
  -         } catch (CacheException e) {
  +         }
  +         catch (CacheException e)
  +         {
               throw new RuntimeException(e);
            }
         }
   
  -      public void remove() throws IllegalStateException {
  -         if (this.key == null) {
  +      public void remove() throws IllegalStateException
  +      {
  +         if (this.key == null)
  +         {
               throw new IllegalStateException();
            }
   
  -         try {
  +         try
  +         {
               cache_.removeObject(AopUtil.constructFqn(getFqn(), this.key));
  -         } catch (CacheException e) {
  +         }
  +         catch (CacheException e)
  +         {
               throw new RuntimeException(e);
            }
         }
  
  
  



More information about the jboss-cvs-commits mailing list