commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang/builder EqualsBuilderTest.java
Date Wed, 11 Feb 2004 20:08:49 GMT
ggregory    2004/02/11 12:08:49

  Modified:    lang/src/java/org/apache/commons/lang/builder
                        EqualsBuilder.java
               lang/src/test/org/apache/commons/lang/builder
                        EqualsBuilderTest.java
  Log:
  
  PR: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23174
  Submitted by:	Maarten Coene, Arun Mammen Thomas
  Reviewed by:	Gary Gregory
  
  Revision  Changes    Path
  1.23      +2 -6      jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java
  
  Index: EqualsBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- EqualsBuilder.java	26 Dec 2003 22:04:49 -0000	1.22
  +++ EqualsBuilder.java	11 Feb 2004 20:08:49 -0000	1.23
  @@ -110,6 +110,7 @@
    * @author Stephen Colebourne
    * @author Gary Gregory
    * @author Pete Gieser
  + * @author Arun Mammen Thomas
    * @since 1.0
    * @version $Id$
    */
  @@ -510,11 +511,6 @@
               return this;
           }
           for (int i = 0; i < lhs.length && isEquals; ++i) {
  -            Class lhsClass = lhs[i].getClass();
  -            if (!lhsClass.isInstance(rhs[i])) {
  -                isEquals = false; //If the types don't match, not equal
  -                break;
  -            }
               append(lhs[i], rhs[i]);
           }
           return this;
  
  
  
  1.8       +15 -4     jakarta-commons/lang/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java
  
  Index: EqualsBuilderTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EqualsBuilderTest.java	18 Aug 2003 02:22:26 -0000	1.7
  +++ EqualsBuilderTest.java	11 Feb 2004 20:08:49 -0000	1.8
  @@ -64,6 +64,7 @@
    * @author <a href="mailto:sdowney@panix.com">Steve Downey</a>
    * @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
    * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
  + * @author Maarten Coene
    * @version $Id$
    */
   public class EqualsBuilderTest extends TestCase {
  @@ -418,17 +419,27 @@
       }
   
       public void testObjectArray() {
  -        TestObject[] obj1 = new TestObject[2];
  +        TestObject[] obj1 = new TestObject[3];
           obj1[0] = new TestObject(4);
           obj1[1] = new TestObject(5);
  -        TestObject[] obj2 = new TestObject[2];
  +        obj1[2] = null;
  +        TestObject[] obj2 = new TestObject[3];
           obj2[0] = new TestObject(4);
           obj2[1] = new TestObject(5);
  +        obj2[2] = null;
  +        
           assertTrue(new EqualsBuilder().append(obj1, obj1).isEquals());
  +        assertTrue(new EqualsBuilder().append(obj2, obj2).isEquals());
           assertTrue(new EqualsBuilder().append(obj1, obj2).isEquals());
           obj1[1].setA(6);
           assertTrue(!new EqualsBuilder().append(obj1, obj2).isEquals());
  -
  +        obj1[1].setA(5);
  +        assertTrue(new EqualsBuilder().append(obj1, obj2).isEquals());
  +        obj1[2] = obj1[1];
  +        assertTrue(!new EqualsBuilder().append(obj1, obj2).isEquals());
  +        obj1[2] = null;
  +        assertTrue(new EqualsBuilder().append(obj1, obj2).isEquals());
  +                       
           obj2 = null;
           assertTrue(!new EqualsBuilder().append(obj1, obj2).isEquals());
           obj1 = null;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message