Use blocks.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1199893 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2011-11-09 17:42:00 +00:00
parent 57251859b6
commit 725ca33769
1 changed files with 12 additions and 6 deletions

View File

@ -936,12 +936,15 @@ public class EqualsBuilderTest {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (o == this) if (o == this) {
return true; return true;
if (o instanceof TestACanEqualB) }
if (o instanceof TestACanEqualB) {
return this.a == ((TestACanEqualB) o).getA(); return this.a == ((TestACanEqualB) o).getA();
if (o instanceof TestBCanEqualA) }
if (o instanceof TestBCanEqualA) {
return this.a == ((TestBCanEqualA) o).getB(); return this.a == ((TestBCanEqualA) o).getB();
}
return false; return false;
} }
@ -959,12 +962,15 @@ public class EqualsBuilderTest {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (o == this) if (o == this) {
return true; return true;
if (o instanceof TestACanEqualB) }
if (o instanceof TestACanEqualB) {
return this.b == ((TestACanEqualB) o).getA(); return this.b == ((TestACanEqualB) o).getA();
if (o instanceof TestBCanEqualA) }
if (o instanceof TestBCanEqualA) {
return this.b == ((TestBCanEqualA) o).getB(); return this.b == ((TestBCanEqualA) o).getB();
}
return false; return false;
} }