From 9da40ba6b5bcc7b6071fa7fe11eaeb1b97e53d81 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Fri, 26 Oct 2007 06:14:10 +0000 Subject: [PATCH] Applying the javadoc sample usage change from LANG-353 as reported by Christoph Kutzinski git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@588536 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/lang/builder/EqualsBuilder.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/commons/lang/builder/EqualsBuilder.java b/src/java/org/apache/commons/lang/builder/EqualsBuilder.java index f70477e4e..641c5a219 100644 --- a/src/java/org/apache/commons/lang/builder/EqualsBuilder.java +++ b/src/java/org/apache/commons/lang/builder/EqualsBuilder.java @@ -46,12 +46,11 @@ import java.util.List; *

Typical use for the code is as follows:

*
  * public boolean equals(Object obj) {
- *   if (obj instanceof MyClass == false) {
+ *   if (obj == null) { return false; }
+ *   if (obj == this) { return true; }
+ *   if (obj.getClass() == getClass()) {
  *     return false;
  *   }
- *   if (this == obj) {
- *     return true;
- *   }
  *   MyClass rhs = (MyClass) obj;
  *   return new EqualsBuilder()
  *                 .appendSuper(super.equals(obj))