You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by se...@apache.org on 2010/12/10 20:53:54 UTC

svn commit: r1044493 - /httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/LangUtils.java

Author: sebb
Date: Fri Dec 10 19:53:54 2010
New Revision: 1044493

URL: http://svn.apache.org/viewvc?rev=1044493&view=rev
Log:
Javadoc

Modified:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/LangUtils.java

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/LangUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/LangUtils.java?rev=1044493&r1=1044492&r2=1044493&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/LangUtils.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/LangUtils.java Fri Dec 10 19:53:54 2010
@@ -55,10 +55,32 @@ public final class LangUtils {
         return hashCode(seed, obj != null ? obj.hashCode() : 0);
     }
 
+    /**
+     * Check if two objects are equal.
+     * 
+     * @param obj1 first object to compare, may be {@code null}
+     * @param obj2 second object to compare, may be {@code null}
+     * @return {@code true} if the objects are equal or both null
+     */
     public static boolean equals(final Object obj1, final Object obj2) {
         return obj1 == null ? obj2 == null : obj1.equals(obj2);
     }
 
+    /**
+     * Check if two object arrays are equal.
+     * <p>
+     * <ul>
+     * <li>If both parameters are null, return {@code true}</li>
+     * <li>If one parameter is null, return {@code false}</li>
+     * <li>If the array lengths are different, return {@code false}</li>
+     * <li>Compare array elements using .equals(); return {@code false} if any comparisons fail.</li>
+     * <li>Return {@code true}</li>
+     * </ul>
+     *
+     * @param a1 first array to compare, may be {@code null}
+     * @param a2 second array to compare, may be {@code null}
+     * @return {@code true} if the arrays are equal or both null
+     */
     public static boolean equals(final Object[] a1, final Object[] a2) {
         if (a1 == null) {
             if (a2 == null) {