commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r890196 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang3/builder/EqualsBuilder.java test/org/apache/commons/lang3/builder/EqualsBuilderTest.java
Date Mon, 14 Dec 2009 06:40:42 GMT
Author: bayard
Date: Mon Dec 14 06:40:42 2009
New Revision: 890196

URL: http://svn.apache.org/viewvc?rev=890196&view=rev
Log:
Adding a reset() method to EqualsBuilder. LANG-466

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang3/builder/EqualsBuilder.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang3/builder/EqualsBuilderTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang3/builder/EqualsBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang3/builder/EqualsBuilder.java?rev=890196&r1=890195&r2=890196&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang3/builder/EqualsBuilder.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang3/builder/EqualsBuilder.java
Mon Dec 14 06:40:42 2009
@@ -840,4 +840,11 @@
     protected void setEquals(boolean isEquals) {
         this.isEquals = isEquals;
     }
+
+    /**
+     * Reset the EqualsBuilder so you can use the same object again
+     */
+    public void reset() {
+        this.isEquals = true;
+    }
 }

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang3/builder/EqualsBuilderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang3/builder/EqualsBuilderTest.java?rev=890196&r1=890195&r2=890196&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang3/builder/EqualsBuilderTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang3/builder/EqualsBuilderTest.java
Mon Dec 14 06:40:42 2009
@@ -391,6 +391,15 @@
         equalsBuilder.setEquals(false);
         assertFalse(equalsBuilder.isEquals());
     }
+
+    public void testReset() {
+        EqualsBuilder equalsBuilder = new EqualsBuilder();
+        assertTrue(equalsBuilder.isEquals());
+        equalsBuilder.setEquals(false);
+        assertFalse(equalsBuilder.isEquals());
+        equalsBuilder.reset();
+        assertTrue(equalsBuilder.isEquals());
+    }
     
     public void testBoolean() {
         boolean o1 = true;



Mime
View raw message