commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/builder HashCodeBuilder.java CompareToBuilder.java EqualsBuilder.java
Date Fri, 18 Apr 2003 09:12:16 GMT
ggregory    2003/04/18 02:12:16

  Modified:    lang/src/java/org/apache/commons/lang/builder
                        HashCodeBuilder.java CompareToBuilder.java
                        EqualsBuilder.java
  Log:
  Address Checkstyle report issues as reported by Henri (http://www.generationjava.com/maven/jakarta-commons/lang/)
  
  Revision  Changes    Path
  1.12      +14 -11    jakarta-commons/lang/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java
  
  Index: HashCodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- HashCodeBuilder.java	23 Mar 2003 17:54:16 -0000	1.11
  +++ HashCodeBuilder.java	18 Apr 2003 09:12:16 -0000	1.12
  @@ -263,8 +263,8 @@
        * these should be different for each class, however this is not vital.
        * Prime numbers are preferred, especially for the multiplier.</p>
        *
  -     * @param initialNonZeroOddNumber
  -     * @param multiplierNonZeroOddNumber
  +     * @param initialNonZeroOddNumber  a non-zero, odd number used as the initial value
  +     * @param multiplierNonZeroOddNumber  a non-zero, odd number used as the multiplier
        * @param object  the Object to create a <code>hashCode</code> for
        * @param testTransients  whether to include transient fields
        * @return int hash code
  @@ -297,8 +297,8 @@
        * these should be different for each class, however this is not vital.
        * Prime numbers are preferred, especially for the multiplier.</p>
        *
  -     * @param initialNonZeroOddNumber
  -     * @param multiplierNonZeroOddNumber
  +     * @param initialNonZeroOddNumber  a non-zero, odd number used as the initial value
  +     * @param multiplierNonZeroOddNumber  a non-zero, odd number used as the multiplier
        * @param object  the Object to create a <code>hashCode</code> for
        * @param testTransients  whether to include transient fields
        * @param reflectUpToClass  the superclass to reflect up to (inclusive), may be null
  @@ -307,8 +307,11 @@
        * @throws IllegalArgumentException if the number is zero or even
        */
       public static int reflectionHashCode(
  -            int initialNonZeroOddNumber, int multiplierNonZeroOddNumber,
  -            Object object, boolean testTransients, Class reflectUpToClass) {
  +        int initialNonZeroOddNumber,
  +        int multiplierNonZeroOddNumber,
  +        Object object,
  +        boolean testTransients,
  +        Class reflectUpToClass) {
   
           if (object == null) {
               throw new IllegalArgumentException("The object to build a hash code for must
not be null");
  @@ -337,9 +340,9 @@
           Field.setAccessible(fields, true);
           for (int i = 0; i < fields.length; i++) {
               Field f = fields[i];
  -            if ((f.getName().indexOf('$') == -1) &&
  -                (useTransients || !Modifier.isTransient(f.getModifiers())) &&
  -                (!Modifier.isStatic(f.getModifiers()))) {
  +            if ((f.getName().indexOf('$') == -1)
  +                && (useTransients || !Modifier.isTransient(f.getModifiers()))
  +                && (!Modifier.isStatic(f.getModifiers()))) {
                   try {
                       builder.append(f.get(object));
                   } catch (IllegalAccessException e) {
  @@ -349,7 +352,7 @@
                   }
               }
           }
  -     }
  +    }
   
       //-------------------------------------------------------------------------
   
  
  
  
  1.14      +10 -5     jakarta-commons/lang/src/java/org/apache/commons/lang/builder/CompareToBuilder.java
  
  Index: CompareToBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/CompareToBuilder.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CompareToBuilder.java	23 Mar 2003 17:54:16 -0000	1.13
  +++ CompareToBuilder.java	18 Apr 2003 09:12:16 -0000	1.14
  @@ -242,14 +242,19 @@
        * @param builder  the builder to append to
        * @param useTransients  whether to test transient fields
        */
  -    private static void reflectionAppend(Object lhs, Object rhs, Class clazz, CompareToBuilder
builder, boolean useTransients) {
  +    private static void reflectionAppend(
  +        Object lhs,
  +        Object rhs,
  +        Class clazz,
  +        CompareToBuilder builder,
  +        boolean useTransients) {
           Field[] fields = clazz.getDeclaredFields();
           Field.setAccessible(fields, true);
           for (int i = 0; i < fields.length && builder.comparison == 0; i++) {
               Field f = fields[i];
  -            if ((f.getName().indexOf('$') == -1) &&
  -                (useTransients || !Modifier.isTransient(f.getModifiers())) &&
  -                (!Modifier.isStatic(f.getModifiers()))) {
  +            if ((f.getName().indexOf('$') == -1)
  +                && (useTransients || !Modifier.isTransient(f.getModifiers()))
  +                && (!Modifier.isStatic(f.getModifiers()))) {
                   try {
                       builder.append(f.get(lhs), f.get(rhs));
                   } catch (IllegalAccessException e) {
  
  
  
  1.13      +10 -5     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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- EqualsBuilder.java	23 Mar 2003 17:54:16 -0000	1.12
  +++ EqualsBuilder.java	18 Apr 2003 09:12:16 -0000	1.13
  @@ -253,14 +253,19 @@
        * @param builder  the builder to append to
        * @param useTransients  whether to test transient fields
        */
  -    private static void reflectionAppend(Object lhs, Object rhs, Class clazz, EqualsBuilder
builder, boolean useTransients) {
  +    private static void reflectionAppend(
  +        Object lhs,
  +        Object rhs,
  +        Class clazz,
  +        EqualsBuilder builder,
  +        boolean useTransients) {
           Field[] fields = clazz.getDeclaredFields();
           Field.setAccessible(fields, true);
           for (int i = 0; i < fields.length && builder.isEquals; i++) {
               Field f = fields[i];
  -            if ((f.getName().indexOf('$') == -1) &&
  -                (useTransients || !Modifier.isTransient(f.getModifiers())) &&
  -                (!Modifier.isStatic(f.getModifiers()))) {
  +            if ((f.getName().indexOf('$') == -1)
  +                && (useTransients || !Modifier.isTransient(f.getModifiers()))
  +                && (!Modifier.isStatic(f.getModifiers()))) {
                   try {
                       builder.append(f.get(lhs), f.get(rhs));
                   } catch (IllegalAccessException e) {
  
  
  

---------------------------------------------------------------------
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