scolebourne 2002/09/22 02:18:33 Modified: lang/src/java/org/apache/commons/lang/builder CompareToBuilder.java EqualsBuilder.java ToStringBuilder.java HashCodeBuilder.java ToStringStyle.java StandardToStringStyle.java lang/src/java/org/apache/commons/lang ObjectUtils.java Log: Checkstyle fixes Revision Changes Path 1.3 +19 -19 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CompareToBuilder.java 17 Sep 2002 22:06:37 -0000 1.2 +++ CompareToBuilder.java 22 Sep 2002 09:18:32 -0000 1.3 @@ -105,7 +105,7 @@ /** * If the fields tested are equals. */ - protected int comparison; + private int comparison; /** * Constructor for CompareToBuilder. @@ -178,7 +178,7 @@ for (int i = 0; i < fields.length && compareToBuilder.comparison == 0; ++i) { Field f = fields[i]; if (testTransients || !Modifier.isTransient(f.getModifiers())) { - if ( !Modifier.isStatic(f.getModifiers())) { + if (!Modifier.isStatic(f.getModifiers())) { try { compareToBuilder.append(f.get(lhs), f.get(rhs)); } catch (IllegalAccessException e) { @@ -219,7 +219,7 @@ Class lhsClass = lhs.getClass(); if (!lhsClass.isArray()) { //the simple case, not an array, just test the element - comparison = ((Comparable)lhs).compareTo(rhs); + comparison = ((Comparable) lhs).compareTo(rhs); } else { //'Switch' on type of array, to dispatch to the correct handler // This handles multi dimensional arrays @@ -360,12 +360,12 @@ return this; } if (lhs == rhs) { - return this; + return this; } if (lhs == false) { - comparison = -1; + comparison = -1; } else { - comparison = +1; + comparison = +1; } return this; } @@ -391,18 +391,18 @@ } if (lhs == null || rhs == null) { throw new NullPointerException(); - } - + } + int length = (lhs.length < rhs.length) ? lhs.length : rhs.length; for (int i = 0; i < length && comparison == 0; ++i) { Class lhsClass = lhs[i].getClass(); if (!lhsClass.isInstance(rhs[i])) { - throw new ClassCastException(); + throw new ClassCastException(); } append(lhs[i], rhs[i]); } if (comparison == 0 && lhs.length != rhs.length) { - comparison = (lhs.length < rhs.length) ? -1 : +1; + comparison = (lhs.length < rhs.length) ? -1 : +1; } return this; } @@ -429,7 +429,7 @@ append(lhs[i], rhs[i]); } if (comparison == 0 && lhs.length != rhs.length) { - comparison = (lhs.length < rhs.length) ? -1 : +1; + comparison = (lhs.length < rhs.length) ? -1 : +1; } return this; } @@ -456,7 +456,7 @@ append(lhs[i], rhs[i]); } if (comparison == 0 && lhs.length != rhs.length) { - comparison = (lhs.length < rhs.length) ? -1 : +1; + comparison = (lhs.length < rhs.length) ? -1 : +1; } return this; } @@ -483,7 +483,7 @@ append(lhs[i], rhs[i]); } if (comparison == 0 && lhs.length != rhs.length) { - comparison = (lhs.length < rhs.length) ? -1 : +1; + comparison = (lhs.length < rhs.length) ? -1 : +1; } return this; } @@ -510,7 +510,7 @@ append(lhs[i], rhs[i]); } if (comparison == 0 && lhs.length != rhs.length) { - comparison = (lhs.length < rhs.length) ? -1 : +1; + comparison = (lhs.length < rhs.length) ? -1 : +1; } return this; } @@ -537,7 +537,7 @@ append(lhs[i], rhs[i]); } if (comparison == 0 && lhs.length != rhs.length) { - comparison = (lhs.length < rhs.length) ? -1 : +1; + comparison = (lhs.length < rhs.length) ? -1 : +1; } return this; } @@ -564,7 +564,7 @@ append(lhs[i], rhs[i]); } if (comparison == 0 && lhs.length != rhs.length) { - comparison = (lhs.length < rhs.length) ? -1 : +1; + comparison = (lhs.length < rhs.length) ? -1 : +1; } return this; } @@ -591,7 +591,7 @@ append(lhs[i], rhs[i]); } if (comparison == 0 && lhs.length != rhs.length) { - comparison = (lhs.length < rhs.length) ? -1 : +1; + comparison = (lhs.length < rhs.length) ? -1 : +1; } return this; } @@ -618,7 +618,7 @@ append(lhs[i], rhs[i]); } if (comparison == 0 && lhs.length != rhs.length) { - comparison = (lhs.length < rhs.length) ? -1 : +1; + comparison = (lhs.length < rhs.length) ? -1 : +1; } return this; } 1.3 +2 -2 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- EqualsBuilder.java 17 Sep 2002 22:06:38 -0000 1.2 +++ EqualsBuilder.java 22 Sep 2002 09:18:32 -0000 1.3 @@ -108,7 +108,7 @@ /** * If the fields tested are equals. */ - protected boolean isEquals; + private boolean isEquals; /** * Constructor for EqualsBuilder. 1.3 +22 -26 jakarta-commons/lang/src/java/org/apache/commons/lang/builder/ToStringBuilder.java Index: ToStringBuilder.java =================================================================== RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/ToStringBuilder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ToStringBuilder.java 19 Sep 2002 19:42:59 -0000 1.2 +++ ToStringBuilder.java 22 Sep 2002 09:18:32 -0000 1.3 @@ -55,9 +55,6 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import java.util.Arrays; -import java.util.Collection; -import java.util.Map; /** * <code>ToString</code> generation routine. * <p> @@ -296,7 +293,7 @@ /** * Append to the toString an Object value. * - * @param value the value to add to the toString + * @param object the value to add to the toString * @return this */ public ToStringBuilder append(Object object) { @@ -307,7 +304,7 @@ /** * Append to the toString an Object value. * - * @param value the value to add to the toString + * @param object the value to add to the toString * @param fieldName the field name * @return this */ @@ -319,7 +316,7 @@ /** * Append to the toString an Object value. * - * @param value the value to add to the toString + * @param object the value to add to the toString * @param fieldName the field name * @param fullDetail true for detail, false for summary info * @return this @@ -535,7 +532,6 @@ * Append to the toString an Object array. * * @param array the array to add to the toString - * @param fieldName the field name * @return this */ public ToStringBuilder append(Object[] array) { @@ -546,8 +542,8 @@ /** * Append to the toString an Object array. * - * @param array the array to add to the toString * @param fieldName the field name + * @param array the array to add to the toString * @return this */ public ToStringBuilder append(String fieldName, Object[] array) { @@ -562,8 +558,8 @@ * will output the array in full. Setting false will output a summary, * typically the size of the array. * - * @param array the array to add to the toString * @param fieldName the field name + * @param array the array to add to the toString * @param fullDetail true for detail, false for summary info * @return this */ @@ -578,7 +574,6 @@ * Append to the toString a long array. * * @param array the array to add to the toString - * @param fieldName the field name * @return this */ public ToStringBuilder append(long[] array) { @@ -589,6 +584,7 @@ /** * Append a hashCode for a long array. * + * @param fieldName the field name * @param array the array to add to the hashCode * @return this */ @@ -604,8 +600,8 @@ * will output the array in full. Setting false will output a summary, * typically the size of the array. * - * @param array the array to add to the toString * @param fieldName the field name + * @param array the array to add to the toString * @param fullDetail true for detail, false for summary info * @return this */ @@ -620,7 +616,6 @@ * Append to the toString a int array. * * @param array the array to add to the toString - * @param fieldName the field name * @return this */ public ToStringBuilder append(int[] array) { @@ -631,6 +626,7 @@ /** * Append a hashCode for an int array. * + * @param fieldName the field name * @param array the array to add to the hashCode * @return this */ @@ -646,8 +642,8 @@ * will output the array in full. Setting false will output a summary, * typically the size of the array. * - * @param array the array to add to the toString * @param fieldName the field name + * @param array the array to add to the toString * @param fullDetail true for detail, false for summary info * @return this */ @@ -662,7 +658,6 @@ * Append to the toString a short array. * * @param array the array to add to the toString - * @param fieldName the field name * @return this */ public ToStringBuilder append(short[] array) { @@ -673,6 +668,7 @@ /** * Append a hashCode for a short array. * + * @param fieldName the field name * @param array the array to add to the hashCode * @return this */ @@ -688,8 +684,8 @@ * will output the array in full. Setting false will output a summary, * typically the size of the array. * - * @param array the array to add to the toString * @param fieldName the field name + * @param array the array to add to the toString * @param fullDetail true for detail, false for summary info * @return this */ @@ -704,7 +700,6 @@ * Append to the toString a char array. * * @param array the array to add to the toString - * @param fieldName the field name * @return this */ public ToStringBuilder append(char[] array) { @@ -715,6 +710,7 @@ /** * Append a hashCode for a char array. * + * @param fieldName the field name * @param array the array to add to the hashCode * @return this */ @@ -730,8 +726,8 @@ * will output the array in full. Setting false will output a summary, * typically the size of the array. * - * @param array the array to add to the toString * @param fieldName the field name + * @param array the array to add to the toString * @param fullDetail true for detail, false for summary info * @return this */ @@ -746,7 +742,6 @@ * Append to the toString a byte array. * * @param array the array to add to the toString - * @param fieldName the field name * @return this */ public ToStringBuilder append(byte[] array) { @@ -757,6 +752,7 @@ /** * Append a hashCode for a byte array. * + * @param fieldName the field name * @param array the array to add to the hashCode * @return this */ @@ -772,8 +768,8 @@ * will output the array in full. Setting false will output a summary, * typically the size of the array. * - * @param array the array to add to the toString * @param fieldName the field name + * @param array the array to add to the toString * @param fullDetail true for detail, false for summary info * @return this */ @@ -788,7 +784,6 @@ * Append to the toString a double array. * * @param array the array to add to the toString - * @param fieldName the field name * @return this */ public ToStringBuilder append(double[] array) { @@ -799,6 +794,7 @@ /** * Append a hashCode for a double array. * + * @param fieldName the field name * @param array the array to add to the hashCode * @return this */ @@ -814,8 +810,8 @@ * will output the array in full. Setting false will output a summary, * typically the size of the array. * - * @param array the array to add to the toString * @param fieldName the field name + * @param array the array to add to the toString * @param fullDetail true for detail, false for summary info * @return this */ @@ -830,7 +826,6 @@ * Append to the toString a float array. * * @param array the array to add to the toString - * @param fieldName the field name * @return this */ public ToStringBuilder append(float[] array) { @@ -841,6 +836,7 @@ /** * Append a hashCode for a float array. * + * @param fieldName the field name * @param array the array to add to the hashCode * @return this */ @@ -856,8 +852,8 @@ * will output the array in full. Setting false will output a summary, * typically the size of the array. * - * @param array the array to add to the toString * @param fieldName the field name + * @param array the array to add to the toString * @param fullDetail true for detail, false for summary info * @return this */ @@ -872,7 +868,6 @@ * Append to the toString a boolean array. * * @param array the array to add to the toString - * @param fieldName the field name * @return this */ public ToStringBuilder append(boolean[] array) { @@ -883,6 +878,7 @@ /** * Append a hashCode for a boolean array. * + * @param fieldName the field name * @param array the array to add to the hashCode * @return this */ @@ -898,8 +894,8 @@ * will output the array in full. Setting false will output a summary, * typically the size of the array. * - * @param array the array to add to the toString * @param fieldName the field name + * @param array the array to add to the toString * @param fullDetail true for detail, false for summary info * @return this */ 1.3 +6 -6 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- HashCodeBuilder.java 17 Sep 2002 22:06:38 -0000 1.2 +++ HashCodeBuilder.java 22 Sep 2002 09:18:32 -0000 1.3 @@ -132,8 +132,8 @@ * these should be different for each class, however this is not vital. * Prime numbers are preferred, especially for the multiplier. * - * @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 * @throws IllegalArgumentException if the number is zero or even */ public HashCodeBuilder(int initialNonZeroOddNumber, int multiplierNonZeroOddNumber) { @@ -215,15 +215,15 @@ * these should be different for each class, however this is not vital. * Prime numbers are preferred, especially for the multiplier. * - * @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 hash code for * @return int hash code * @throws IllegalArgumentException if the object is null * @throws IllegalArgumentException if the number is zero or even */ public static int reflectionHashCode( - int initialNonZeroOddNumber, int multiplierNonZeroOddNumber, + int initialNonZeroOddNumber, int multiplierNonZeroOddNumber, Object object) { return reflectionHashCode(initialNonZeroOddNumber, multiplierNonZeroOddNumber, object, false); } 1.4 +9 -3 jakarta-commons/lang/src/java/org/apache/commons/lang/builder/ToStringStyle.java Index: ToStringStyle.java =================================================================== RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/ToStringStyle.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ToStringStyle.java 19 Sep 2002 19:44:10 -0000 1.3 +++ ToStringStyle.java 22 Sep 2002 09:18:32 -0000 1.4 @@ -1086,6 +1086,7 @@ /** * Append the class name. * + * @param buffer the StringBuffer to populate * @param object the object whose name to output */ protected void appendClassName(StringBuffer buffer, Object object) { @@ -1101,6 +1102,7 @@ /** * Append the IdentityHashCode. * + * @param buffer the StringBuffer to populate * @param object the object whose id to output */ protected void appendIdentityHashCode(StringBuffer buffer, Object object) { @@ -1201,7 +1203,7 @@ * return false. The calling code may pass in null indicating that it doesn't * care about the detail level. In this case the default detail level is used. * - * @param fullDetail the detail level requested + * @param fullDetailRequest the detail level requested * @return whether full detail is to be shown */ protected boolean isFullDetail(Boolean fullDetailRequest) { @@ -1279,7 +1281,7 @@ /** * Sets whether to use the identity hash code. - * @param useFieldNames the new useIdentityHashCode flag + * @param useIdentityHashCode the new useIdentityHashCode flag */ protected void setUseIdentityHashCode(boolean useIdentityHashCode) { this.useIdentityHashCode = useIdentityHashCode; @@ -1631,6 +1633,7 @@ /** * Ensure singleton after serialization. + * @return the singleton */ private Object readResolve() { return ToStringStyle.DEFAULT_STYLE; @@ -1657,6 +1660,7 @@ /** * Ensure singleton after serialization. + * @return the singleton */ private Object readResolve() { return ToStringStyle.NO_FIELD_NAMES_STYLE; @@ -1688,6 +1692,7 @@ /** * Ensure singleton after serialization. + * @return the singleton */ private Object readResolve() { return ToStringStyle.SIMPLE_STYLE; @@ -1716,6 +1721,7 @@ /** * Ensure singleton after serialization. + * @return the singleton */ private Object readResolve() { return ToStringStyle.MULTI_LINE_STYLE; 1.4 +2 -2 jakarta-commons/lang/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java Index: StandardToStringStyle.java =================================================================== RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- StandardToStringStyle.java 19 Sep 2002 19:45:22 -0000 1.3 +++ StandardToStringStyle.java 22 Sep 2002 09:18:32 -0000 1.4 @@ -122,7 +122,7 @@ /** * Sets whether to use the identity hash code. - * @param useFieldNames the new useIdentityHashCode flag + * @param useIdentityHashCode the new useIdentityHashCode flag */ public void setUseIdentityHashCode(boolean useIdentityHashCode) { super.setUseIdentityHashCode(useIdentityHashCode); 1.4 +3 -2 jakarta-commons/lang/src/java/org/apache/commons/lang/ObjectUtils.java Index: ObjectUtils.java =================================================================== RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/ObjectUtils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ObjectUtils.java 18 Sep 2002 20:11:53 -0000 1.3 +++ ObjectUtils.java 22 Sep 2002 09:18:33 -0000 1.4 @@ -155,7 +155,8 @@ } /** - * Ensure singleton + * Ensure singleton. + * @return the singleton value */ private Object readResolve() { return ObjectUtils.NULL;
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>