[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/pojo/test ...

Jason Thomas Greene jgreene at jboss.com
Wed Apr 4 21:29:22 EDT 2007


  User: jgreene 
  Date: 07/04/04 21:29:22

  Modified:    tests/functional/org/jboss/cache/pojo/test  Address.java
  Log:
  Fix JBCACHE-1017
  Fix Set sync test case
  
  Revision  Changes    Path
  1.2       +21 -1     JBossCache/tests/functional/org/jboss/cache/pojo/test/Address.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Address.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/test/Address.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- Address.java	13 Jan 2007 15:55:01 -0000	1.1
  +++ Address.java	5 Apr 2007 01:29:22 -0000	1.2
  @@ -10,7 +10,7 @@
   /**
    * Test class for PojoCache.
    *
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    *          <p>Below is the annotation that signifies this class is "prepared" under JBossAop. This is used in
    *          conjunction with a special jboss-aop.xml (supplied by JBossCache). In addition, this is JDK1.4 style,
    *          so a annoc Ant build target is needed to pre-compile it.</p>
  @@ -59,6 +59,26 @@
         return "street=" + getStreet() + ", city=" + getCity() + ", zip=" + getZip();
      }
   
  +   public int hashCode()
  +   {
  +      return 1241 * zip + 37 * (city != null ? city.hashCode() : 0)
  +                        + 37 * (street != null ? street.hashCode() : 0);
  +   }
  +   
  +   private boolean equals(Object o1, Object o2)
  +   {
  +      return o1 == o2 || (o1 != null && o1.equals(o2));
  +   }
  +
  +   public boolean equals(Object o)
  +   {
  +      if (!(o instanceof Address))
  +         return false;
  +
  +      Address addr = (Address)o;
  +      return addr.zip == zip && equals(addr.city, city) && equals(addr.street, street);
  +   }
  +   
   //    public Object writeReplace() {
   //	return this;
   //    }
  
  
  



More information about the jboss-cvs-commits mailing list