diff --git a/src/java/org/apache/commons/lang/ObjectUtils.java b/src/java/org/apache/commons/lang/ObjectUtils.java index 20bf7ec6c..054b1cd89 100644 --- a/src/java/org/apache/commons/lang/ObjectUtils.java +++ b/src/java/org/apache/commons/lang/ObjectUtils.java @@ -61,7 +61,7 @@ * @author Janek Bogucki * @author Daniel Rall * @author Stephen Colebourne - * @version $Id: ObjectUtils.java,v 1.3 2002/09/18 20:11:53 scolebourne Exp $ + * @version $Id: ObjectUtils.java,v 1.4 2002/09/22 09:18:33 scolebourne Exp $ */ public class ObjectUtils { @@ -155,7 +155,8 @@ private Null() { } /** - * Ensure singleton + * Ensure singleton. + * @return the singleton value */ private Object readResolve() { return ObjectUtils.NULL; diff --git a/src/java/org/apache/commons/lang/builder/CompareToBuilder.java b/src/java/org/apache/commons/lang/builder/CompareToBuilder.java index 8e2061f8f..9a1163ff3 100644 --- a/src/java/org/apache/commons/lang/builder/CompareToBuilder.java +++ b/src/java/org/apache/commons/lang/builder/CompareToBuilder.java @@ -99,13 +99,13 @@ * * @author Steve Downey * @author Stephen Colebourne - * @version $Id: CompareToBuilder.java,v 1.2 2002/09/17 22:06:37 scolebourne Exp $ + * @version $Id: CompareToBuilder.java,v 1.3 2002/09/22 09:18:32 scolebourne Exp $ */ public class CompareToBuilder { /** * If the fields tested are equals. */ - protected int comparison; + private int comparison; /** * Constructor for CompareToBuilder. @@ -178,7 +178,7 @@ public static int reflectionCompare(Object lhs, Object rhs, 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 @@ public CompareToBuilder append(Object lhs, Object rhs) { 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 @@ public CompareToBuilder append(boolean lhs, boolean rhs) { 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 @@ public CompareToBuilder append(Object[] lhs, Object[] rhs) { } 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 @@ public CompareToBuilder append(long[] lhs, long[] rhs) { 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 @@ public CompareToBuilder append(int[] lhs, int[] rhs) { 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 @@ public CompareToBuilder append(short[] lhs, short[] rhs) { 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 @@ public CompareToBuilder append(char[] lhs, char[] rhs) { 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 @@ public CompareToBuilder append(byte[] lhs, byte[] rhs) { 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 @@ public CompareToBuilder append(double[] lhs, double[] rhs) { 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 @@ public CompareToBuilder append(float[] lhs, float[] rhs) { 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 @@ public CompareToBuilder append(boolean[] lhs, boolean[] rhs) { 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; } diff --git a/src/java/org/apache/commons/lang/builder/EqualsBuilder.java b/src/java/org/apache/commons/lang/builder/EqualsBuilder.java index 19d7a4e5d..e7938e61a 100644 --- a/src/java/org/apache/commons/lang/builder/EqualsBuilder.java +++ b/src/java/org/apache/commons/lang/builder/EqualsBuilder.java @@ -102,13 +102,13 @@ * * @author Steve Downey * @author Stephen Colebourne - * @version $Id: EqualsBuilder.java,v 1.2 2002/09/17 22:06:38 scolebourne Exp $ + * @version $Id: EqualsBuilder.java,v 1.3 2002/09/22 09:18:32 scolebourne Exp $ */ public class EqualsBuilder { /** * If the fields tested are equals. */ - protected boolean isEquals; + private boolean isEquals; /** * Constructor for EqualsBuilder. diff --git a/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java b/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java index f861e9361..54b6d6ece 100644 --- a/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java +++ b/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java @@ -102,7 +102,7 @@ * * * @author Stephen Colebourne - * @version $Id: HashCodeBuilder.java,v 1.2 2002/09/17 22:06:38 scolebourne Exp $ + * @version $Id: HashCodeBuilder.java,v 1.3 2002/09/22 09:18:32 scolebourne Exp $ */ public class HashCodeBuilder { @@ -132,8 +132,8 @@ public HashCodeBuilder() { * 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 @@ public static int reflectionHashCode(Object object, boolean testTransients) { * 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); } diff --git a/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java b/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java index 3237ea810..17b646612 100644 --- a/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java +++ b/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java @@ -63,7 +63,7 @@ * public static final variable for the rest of the program to access. * * @author Stephen Colebourne - * @version $Id: StandardToStringStyle.java,v 1.3 2002/09/19 19:45:22 scolebourne Exp $ + * @version $Id: StandardToStringStyle.java,v 1.4 2002/09/22 09:18:32 scolebourne Exp $ */ public class StandardToStringStyle extends ToStringStyle { @@ -122,7 +122,7 @@ public boolean isUseIdentityHashCode() { /** * 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); diff --git a/src/java/org/apache/commons/lang/builder/ToStringBuilder.java b/src/java/org/apache/commons/lang/builder/ToStringBuilder.java index 5ec874b89..00194e2e3 100644 --- a/src/java/org/apache/commons/lang/builder/ToStringBuilder.java +++ b/src/java/org/apache/commons/lang/builder/ToStringBuilder.java @@ -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; /** * ToString generation routine. *

@@ -96,7 +93,7 @@ * passed into the constructor. * * @author Stephen Colebourne - * @version $Id: ToStringBuilder.java,v 1.2 2002/09/19 19:42:59 scolebourne Exp $ + * @version $Id: ToStringBuilder.java,v 1.3 2002/09/22 09:18:32 scolebourne Exp $ */ public class ToStringBuilder { @@ -296,7 +293,7 @@ public static String reflectionToString(Object object, ToStringStyle style, /** * 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 @@ public ToStringBuilder append(Object object) { /** * 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 @@ public ToStringBuilder append(String fieldName, Object object) { /** * 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 @@ public ToStringBuilder append(String fieldName, boolean value) { * 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 @@ public ToStringBuilder append(Object[] array) { /** * 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 @@ public ToStringBuilder append(String fieldName, Object[] array) { * 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 @@ public ToStringBuilder append(String fieldName, Object[] array, boolean fullDeta * 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 @@ public ToStringBuilder append(long[] array) { /** * 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 @@ public ToStringBuilder append(String fieldName, long[] array) { * 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 @@ public ToStringBuilder append(String fieldName, long[] array, boolean fullDetail * 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 @@ public ToStringBuilder append(int[] array) { /** * 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 @@ public ToStringBuilder append(String fieldName, int[] array) { * 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 @@ public ToStringBuilder append(String fieldName, int[] array, boolean fullDetail) * 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 @@ public ToStringBuilder append(short[] array) { /** * 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 @@ public ToStringBuilder append(String fieldName, short[] array) { * 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 @@ public ToStringBuilder append(String fieldName, short[] array, boolean fullDetai * 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 @@ public ToStringBuilder append(char[] array) { /** * 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 @@ public ToStringBuilder append(String fieldName, char[] array) { * 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 @@ public ToStringBuilder append(String fieldName, char[] array, boolean fullDetail * 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 @@ public ToStringBuilder append(byte[] array) { /** * 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 @@ public ToStringBuilder append(String fieldName, byte[] array) { * 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 @@ public ToStringBuilder append(String fieldName, byte[] array, boolean fullDetail * 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 @@ public ToStringBuilder append(double[] array) { /** * 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 @@ public ToStringBuilder append(String fieldName, double[] array) { * 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 @@ public ToStringBuilder append(String fieldName, double[] array, boolean fullDeta * 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 @@ public ToStringBuilder append(float[] array) { /** * 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 @@ public ToStringBuilder append(String fieldName, float[] array) { * 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 @@ public ToStringBuilder append(String fieldName, float[] array, boolean fullDetai * 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 @@ public ToStringBuilder append(boolean[] array) { /** * 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 @@ public ToStringBuilder append(String fieldName, boolean[] array) { * 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 */ diff --git a/src/java/org/apache/commons/lang/builder/ToStringStyle.java b/src/java/org/apache/commons/lang/builder/ToStringStyle.java index deef7b94b..1bf7607f5 100644 --- a/src/java/org/apache/commons/lang/builder/ToStringStyle.java +++ b/src/java/org/apache/commons/lang/builder/ToStringStyle.java @@ -75,7 +75,7 @@ * whole array, whereas the summary method will just output the array length. * * @author Stephen Colebourne - * @version $Id: ToStringStyle.java,v 1.3 2002/09/19 19:44:10 scolebourne Exp $ + * @version $Id: ToStringStyle.java,v 1.4 2002/09/22 09:18:32 scolebourne Exp $ */ public abstract class ToStringStyle implements Serializable { @@ -1086,6 +1086,7 @@ protected void appendSummary(StringBuffer buffer, String fieldName, boolean[] ar /** * 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 @@ protected void appendClassName(StringBuffer buffer, Object object) { /** * 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 @@ protected void appendSummarySize(StringBuffer buffer, String fieldName, int size * 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 @@ protected boolean isUseIdentityHashCode() { /** * 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 @@ private DefaultToStringStyle() { /** * Ensure singleton after serialization. + * @return the singleton */ private Object readResolve() { return ToStringStyle.DEFAULT_STYLE; @@ -1657,6 +1660,7 @@ private NoFieldNameToStringStyle() { /** * Ensure singleton after serialization. + * @return the singleton */ private Object readResolve() { return ToStringStyle.NO_FIELD_NAMES_STYLE; @@ -1688,6 +1692,7 @@ private SimpleToStringStyle() { /** * Ensure singleton after serialization. + * @return the singleton */ private Object readResolve() { return ToStringStyle.SIMPLE_STYLE; @@ -1716,6 +1721,7 @@ private MultiLineToStringStyle() { /** * Ensure singleton after serialization. + * @return the singleton */ private Object readResolve() { return ToStringStyle.MULTI_LINE_STYLE;