From dbe97c09cad3ba2c7473c15778773fa4d071e7de Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Mon, 21 Jul 2003 23:14:37 +0000 Subject: [PATCH] Javadoc fixes bug 21758, from Pete Gieser git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137487 13f79535-47bb-0310-9956-ffa450edef68 --- .../lang/builder/CompareToBuilder.java | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/src/java/org/apache/commons/lang/builder/CompareToBuilder.java b/src/java/org/apache/commons/lang/builder/CompareToBuilder.java index 53c166d9e..d8eb64d97 100644 --- a/src/java/org/apache/commons/lang/builder/CompareToBuilder.java +++ b/src/java/org/apache/commons/lang/builder/CompareToBuilder.java @@ -63,18 +63,18 @@ import org.apache.commons.lang.math.NumberUtils; /** *

CompareTo generation routines.

* - *

This class provides methods to build a good compareTo() - * method for any class. It is consistent with the equals and - * hashcode built with {@link EqualsBuilder} and + *

This class provides methods to build a good compareTo + * method for any class. It is consistent with the equals() and + * hashcode() built with {@link EqualsBuilder} and * {@link HashCodeBuilder}.

* - *

Two object that compare equal using equals should normally compare - * equals using compareTo

. + *

Two Objects that compare equal using equals() should normally + * also compare equal using compareTo()

. * *

All relevant fields should be included in the calculation of the * comparison. Derived fields may be ignored. The same fields, in the same - * order, should be used in both compareTo and - * equals.

+ * order, should be used in both compareTo() and + * equals().

* *

Typical use for the code is as follows:

* @@ -107,8 +107,9 @@ import org.apache.commons.lang.math.NumberUtils; * @author Steve Downey * @author Stephen Colebourne * @author Gary Gregory + * @author Pete Gieser * @since 1.0 - * @version $Id: CompareToBuilder.java,v 1.17 2003/07/19 03:25:38 ggregory Exp $ + * @version $Id: CompareToBuilder.java,v 1.18 2003/07/21 23:14:37 scolebourne Exp $ */ public class CompareToBuilder { @@ -137,7 +138,7 @@ public class CompareToBuilder { * *

It uses AccessibleObject.setAccessible to gain access to private * fields. This means that it will throw a security exception if run under - * a security manger, if the permissions are not set up correctly. It is + * a security manager, if the permissions are not set up correctly. It is * also not as efficient as testing explicitly.

* *

Transient members will be not be tested, as they are likely derived @@ -164,7 +165,7 @@ public class CompareToBuilder { * *

It uses AccessibleObject.setAccessible to gain access to private * fields. This means that it will throw a security exception if run under - * a security manger, if the permissions are not set up correctly. It is + * a security manager, if the permissions are not set up correctly. It is * also not as efficient as testing explicitly.

* *

If the testTransients is set to true, @@ -193,7 +194,7 @@ public class CompareToBuilder { * *

It uses AccessibleObject.setAccessible to gain access to private * fields. This means that it will throw a security exception if run under - * a security manger, if the permissions are not set up correctly. It is + * a security manager, if the permissions are not set up correctly. It is * also not as efficient as testing explicitly.

* *

If the testTransients is set to true, @@ -274,10 +275,10 @@ public class CompareToBuilder { /** *

Adds the result of super.hashCode() to this builder.

* - * @param superHashCode the result of calling super.equals() + * @param superCompareTo the result of calling super.compareTo() * @return CompareToBuilder - used to chain calls. */ - public CompareToBuilder appendSuper(int superHashCode) { + public CompareToBuilder appendSuper(int superCompareTo) { if (comparison != 0) { return this; } @@ -522,7 +523,7 @@ public class CompareToBuilder { *

Deep comparison of an Object array.

* *
    - *
  1. Check if arrays are same using ==
  2. + *
  3. Check if arrays are the same using ==
  4. *
  5. Check if either is null, a null array is less than a non-null
  6. *
  7. Check array length, a short length array is less than a long length array
  8. *
  9. Check array contents element by element using {@link #append(long, long)}
  10. @@ -545,7 +546,7 @@ public class CompareToBuilder { *

    Deep comparison of an Object array.

    * *
      - *
    1. Check if arrays are same using ==
    2. + *
    3. Check if arrays are the same using ==
    4. *
    5. Check if either is null, a null array is less than a non-null
    6. *
    7. Check array length, a shorter length array is less than a longer length array
    8. *
    9. Check array contents element by element using {@link #append(Object, Object, Comparator)}
    10. @@ -591,7 +592,7 @@ public class CompareToBuilder { *

      Deep comparison of a long array.

      * *
        - *
      1. Check if arrays are same using ==
      2. + *
      3. Check if arrays are the same using ==
      4. *
      5. Check if either is null, a null array is less than a non-null
      6. *
      7. Check array length, a shorter length array is less than a longer length array
      8. *
      9. Check array contents element by element using {@link #append(long, long)}
      10. @@ -630,7 +631,7 @@ public class CompareToBuilder { *

        Deep comparison of an int array.

        * *
          - *
        1. Check if arrays are same using ==
        2. + *
        3. Check if arrays are the same using ==
        4. *
        5. Check if either is null, a null array is less than a non-null
        6. *
        7. Check array length, a shorter length array is less than a longer length array
        8. *
        9. Check array contents element by element using {@link #append(int, int)}
        10. @@ -669,7 +670,7 @@ public class CompareToBuilder { *

          Deep comparison of a short array.

          * *
            - *
          1. Check if arrays are same using ==
          2. + *
          3. Check if arrays are the same using ==
          4. *
          5. Check if either is null, a null array is less than a non-null
          6. *
          7. Check array length, a shorter length array is less than a longer length array
          8. *
          9. Check array contents element by element using {@link #append(short, short)}
          10. @@ -708,7 +709,7 @@ public class CompareToBuilder { *

            Deep comparison of a char array.

            * *
              - *
            1. Check if arrays are same using ==
            2. + *
            3. Check if arrays are the same using ==
            4. *
            5. Check if either is null, a null array is less than a non-null
            6. *
            7. Check array length, a shorter length array is less than a longer length array
            8. *
            9. Check array contents element by element using {@link #append(char, char)}
            10. @@ -747,7 +748,7 @@ public class CompareToBuilder { *

              Deep comparison of a byte array.

              * *
                - *
              1. Check if arrays are same using ==
              2. + *
              3. Check if arrays are the same using ==
              4. *
              5. Check if either is null, a null array is less than a non-null
              6. *
              7. Check array length, a shorter length array is less than a longer length array
              8. *
              9. Check array contents element by element using {@link #append(byte, byte)}
              10. @@ -786,7 +787,7 @@ public class CompareToBuilder { *

                Deep comparison of a double array.

                * *
                  - *
                1. Check if arrays are same using ==
                2. + *
                3. Check if arrays are the same using ==
                4. *
                5. Check if either is null, a null array is less than a non-null
                6. *
                7. Check array length, a shorter length array is less than a longer length array
                8. *
                9. Check array contents element by element using {@link #append(double, double)}
                10. @@ -825,7 +826,7 @@ public class CompareToBuilder { *

                  Deep comparison of a float array.

                  * *
                    - *
                  1. Check if arrays are same using ==
                  2. + *
                  3. Check if arrays are the same using ==
                  4. *
                  5. Check if either is null, a null array is less than a non-null
                  6. *
                  7. Check array length, a shorter length array is less than a longer length array
                  8. *
                  9. Check array contents element by element using {@link #append(float, float)} @@ -864,7 +865,7 @@ public class CompareToBuilder { *

                    Deep comparison of a boolean/code> array.

                    * *
                      - *
                    1. Check if arrays are same using ==
                    2. + *
                    3. Check if arrays are the same using ==
                    4. *
                    5. Check if either is null, a null array is less than a non-null
                    6. *
                    7. Check array length, a shorter length array is less than a longer length array
                    8. *
                    9. Check array contents element by element using {@link #append(boolean, boolean)}
                    10. @@ -900,9 +901,10 @@ public class CompareToBuilder { } /** - *

                      Return a negative integer if the Object is less - * than, a positive integer if the Object is greater than, - * or 0 if the Object is equal.

                      + *

                      Return a negative integer if this Object is less + * than, a positive integer if this Object is greater than, + * or 0 if this Object is equal to the specified + * Object.

                      * * @return int - a negative integer, zero, or a positive integer as this * Object is less than, equal to, or greater than the specified Object.