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

Manik Surtani msurtani at jboss.com
Tue Aug 22 09:42:43 EDT 2006


  User: msurtani
  Date: 06/08/22 09:42:43

  Modified:    src/org/jboss/cache  Fqn.java
  Log:
  more efficient cloning
  
  Revision  Changes    Path
  1.36      +20 -9     JBossCache/src/org/jboss/cache/Fqn.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Fqn.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Fqn.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -b -r1.35 -r1.36
  --- Fqn.java	7 Aug 2006 17:58:15 -0000	1.35
  +++ Fqn.java	22 Aug 2006 13:42:43 -0000	1.36
  @@ -8,6 +8,7 @@
   
   
   import org.apache.commons.logging.LogFactory;
  +import org.apache.commons.logging.Log;
   
   import java.io.Externalizable;
   import java.io.IOException;
  @@ -39,7 +40,7 @@
    * The latter will result in 3 Fqns, called "a", "b" and "c", where "c" is a child of "b", "b" is a child of "a", and "a" hangs off Fqn.ROOT.
    * <p />
    * Another way to look at it is that the "/" separarator is only parsed when it form sa  part of a String passed in to Fqn.fromString() and not otherwise.
  - * @version $Revision: 1.35 $
  + * @version $Revision: 1.36 $
    */
   public class Fqn implements Cloneable, Externalizable {
   
  @@ -96,6 +97,7 @@
       * Immutable root FQN.
       */
      public static final Fqn ROOT = new Fqn();
  +   private static Log log = LogFactory.getLog(Fqn.class);
   
      /**
       * Constructs a root FQN.
  @@ -276,8 +278,17 @@
      /**
       * Clones the FQN.
       */
  -   public Object clone() {
  -      return new Fqn(elements);
  +   public Fqn clone()
  +   {
  +       try
  +       {
  +           return (Fqn) super.clone();
  +       }
  +       catch (CloneNotSupportedException e)
  +       {
  +           log.error("Unable to clone Fqn " + this, e);
  +           return null;
  +       }
      }
   
      /**
  
  
  



More information about the jboss-cvs-commits mailing list