commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r905076 - in /commons/proper/lang/branches/LANG_2_X/src: main/java/org/apache/commons/lang/builder/EqualsBuilder.java test/java/org/apache/commons/lang/builder/EqualsBuilderTest.java
Date Sun, 31 Jan 2010 17:15:51 GMT
Author: niallp
Date: Sun Jan 31 17:15:51 2010
New Revision: 905076

URL: http://svn.apache.org/viewvc?rev=905076&view=rev
Log:
Port LANG-466 to 2.x branch - Add a reset() method to EqualsBuilder

Modified:
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/builder/EqualsBuilder.java
    commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/builder/EqualsBuilderTest.java

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/builder/EqualsBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/builder/EqualsBuilder.java?rev=905076&r1=905075&r2=905076&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/builder/EqualsBuilder.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/builder/EqualsBuilder.java
Sun Jan 31 17:15:51 2010
@@ -842,4 +842,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/branches/LANG_2_X/src/test/java/org/apache/commons/lang/builder/EqualsBuilderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/builder/EqualsBuilderTest.java?rev=905076&r1=905075&r2=905076&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/builder/EqualsBuilderTest.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/builder/EqualsBuilderTest.java
Sun Jan 31 17:15:51 2010
@@ -393,6 +393,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