Author: bayard
Date: Mon Nov 12 11:55:14 2007
New Revision: 594276
URL: http://svn.apache.org/viewvc?rev=594276&view=rev
Log:
Applying the suggested change in use to the unit test as per LANG-353
Modified:
commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java
Modified:
commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java?rev=594276&r1=594275&r2=594276&view=diff
==============================================================================
---
commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java
(original)
+++
commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java
Mon Nov 12 11:55:14 2007
@@ -66,12 +66,12 @@
this.a = a;
}
public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof TestObject)) {
+ if (o == null) { return false; }
+ if (o == this) { return true; }
+ if (o.getClass() != getClass()) {
return false;
}
+
TestObject rhs = (TestObject) o;
return (a == rhs.a);
}
@@ -95,12 +95,12 @@
this.b = b;
}
public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof TestSubObject)) {
+ if (o == null) { return false; }
+ if (o == this) { return true; }
+ if (o.getClass() != getClass()) {
return false;
}
+
TestSubObject rhs = (TestSubObject) o;
return super.equals(o) && (b == rhs.b);
}