commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/builder EqualsBuilder.java
Date Sat, 16 Oct 2004 17:27:11 GMT
scolebourne    2004/10/16 10:27:11

  Modified:    lang/src/java/org/apache/commons/lang/builder
                        EqualsBuilder.java
  Log:
  Improve example
  
  Revision  Changes    Path
  1.28      +12 -9     jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java
  
  Index: EqualsBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- EqualsBuilder.java	8 Oct 2004 00:07:59 -0000	1.27
  +++ EqualsBuilder.java	16 Oct 2004 17:27:11 -0000	1.28
  @@ -40,13 +40,16 @@
    *
    * <p>Typical use for the code is as follows:</p>
    * <pre>
  - * public boolean equals(Object o) {
  - *   if ( !(o instanceof MyClass) ) {
  - *    return false;
  + * public boolean equals(Object obj) {
  + *   if (obj instanceof MyClass == false) {
  + *     return false;
    *   }
  - *  MyClass rhs = (MyClass) o;
  - *  return new EqualsBuilder()
  - *                 .appendSuper(super.equals(o))
  + *   if (this == obj) {
  + *     return true;
  + *   }
  + *   MyClass rhs = (MyClass) obj;
  + *   return new EqualsBuilder()
  + *                 .appendSuper(super.equals(obj))
    *                 .append(field1, rhs.field1)
    *                 .append(field2, rhs.field2)
    *                 .append(field3, rhs.field3)
  @@ -63,8 +66,8 @@
    *
    * <p> A typical invocation for this method would look like:</p>
    * <pre>
  - * public boolean equals(Object o) {
  - *   return EqualsBuilder.reflectionEquals(this, o);
  + * public boolean equals(Object obj) {
  + *   return EqualsBuilder.reflectionEquals(this, obj);
    * }
    * </pre>
    *
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message