Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 24084 invoked from network); 19 Mar 2011 16:39:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Mar 2011 16:39:21 -0000 Received: (qmail 59053 invoked by uid 500); 19 Mar 2011 16:39:21 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 58999 invoked by uid 500); 19 Mar 2011 16:39:21 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 58992 invoked by uid 99); 19 Mar 2011 16:39:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Mar 2011 16:39:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Mar 2011 16:39:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 122F8238897A; Sat, 19 Mar 2011 16:38:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1083216 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java Date: Sat, 19 Mar 2011 16:38:58 -0000 To: commits@commons.apache.org From: oheger@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110319163858.122F8238897A@eris.apache.org> Author: oheger Date: Sat Mar 19 16:38:57 2011 New Revision: 1083216 URL: http://svn.apache.org/viewvc?rev=1083216&view=rev Log: Checkstyle and trailing spaces. Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java?rev=1083216&r1=1083215&r2=1083216&view=diff ============================================================================== --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java Sat Mar 19 16:38:57 2011 @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -87,12 +87,12 @@ import org.apache.commons.lang3.Pair; * @version $Id$ */ public class EqualsBuilder implements Builder { - + /** *

* A registry of objects used by reflection methods to detect cyclical object references and avoid infinite loops. *

- * + * * @since 3.0 */ private static final ThreadLocal>> REGISTRY = new ThreadLocal>>(); @@ -100,16 +100,16 @@ public class EqualsBuilder implements Bu /* * N.B. we cannot store the actual objects in a HashSet, as that would use the very hashCode() * we are in the process of calculating. - * + * * So we generate a one-to-one mapping from the original object to a new object. - * + * * Now HashSet uses equals() to determine if two elements with the same hashcode really * are equal, so we also need to ensure that the replacement objects are only equal * if the original objects are identical. - * + * * The original implementation (2.4 and before) used the System.indentityHashCode() * method - however this is not guaranteed to generate unique ids (e.g. LANG-459) - * + * * We now use the IDKey helper class (adapted from org.apache.axis.utils.IDKey) * to disambiguate the duplicate ids. */ @@ -119,7 +119,7 @@ public class EqualsBuilder implements Bu * Returns the registry of object pairs being traversed by the reflection * methods in the current thread. *

- * + * * @return Set the registry of objects being traversed * @since 3.0 */ @@ -131,11 +131,11 @@ public class EqualsBuilder implements Bu *

* Converters value pair into a register pair. *

- * + * * @param lhs this object * @param rhs the other object - * - * @return + * + * @return the pair */ static Pair getRegisterPair(Object lhs, Object rhs) { IDKey left = new IDKey(lhs); @@ -150,7 +150,7 @@ public class EqualsBuilder implements Bu * Objects might be swapped therefore a check is needed if the object pair * is registered in given or swapped order. *

- * + * * @param lhs this object to lookup in registry * @param rhs the other object to lookup on registry * @return boolean true if the registry contains the given object. @@ -170,7 +170,7 @@ public class EqualsBuilder implements Bu * Registers the given object pair. * Used by the reflection methods to avoid infinite loops. *

- * + * * @param lhs this object to register * @param rhs the other object to register */ @@ -190,10 +190,10 @@ public class EqualsBuilder implements Bu *

* Unregisters the given object pair. *

- * + * *

* Used by the reflection methods to avoid infinite loops. - * + * * @param lhs this object to unregister * @param rhs the other object to unregister * @since 3.0 @@ -212,7 +212,7 @@ public class EqualsBuilder implements Bu } } } - + /** * If the fields tested are equals. * The default value is true. @@ -386,9 +386,9 @@ public class EqualsBuilder implements Bu if (lhs == null || rhs == null) { return false; } - // Find the leaf class since there may be transients in the leaf + // Find the leaf class since there may be transients in the leaf // class or in classes between the leaf and root. - // If we are not testing transients or a subclass has no ivars, + // If we are not testing transients or a subclass has no ivars, // then a subclass can test equals to a superclass. Class lhsClass = lhs.getClass(); Class rhsClass = rhs.getClass(); @@ -418,7 +418,7 @@ public class EqualsBuilder implements Bu } } catch (IllegalArgumentException e) { // In this case, we tried to test a subclass vs. a superclass and - // the subclass has ivars or the ivars are transient and + // the subclass has ivars or the ivars are transient and // we are testing transients. // If a subclass has ivars that we are trying to test them, we get an // exception and we know that the objects are not equal. @@ -430,7 +430,7 @@ public class EqualsBuilder implements Bu /** *

Appends the fields and values defined by the given object of the * given Class.

- * + * * @param lhs the left hand object * @param rhs the right hand object * @param clazz the class to append details of @@ -445,11 +445,11 @@ public class EqualsBuilder implements Bu EqualsBuilder builder, boolean useTransients, String[] excludeFields) { - + if (isRegistered(lhs, rhs)) { return; } - + try { register(lhs, rhs); Field[] fields = clazz.getDeclaredFields(); @@ -517,7 +517,7 @@ public class EqualsBuilder implements Bu // The simple case, not an array, just test the element isEquals = lhs.equals(rhs); } else if (lhs.getClass() != rhs.getClass()) { - // Here when we compare different dimensions, for example: a boolean[][] to a boolean[] + // Here when we compare different dimensions, for example: a boolean[][] to a boolean[] this.setEquals(false); } // 'Switch' on type of array, to dispatch to the correct handler @@ -549,7 +549,7 @@ public class EqualsBuilder implements Bu *

* Test if two long s are equal. *

- * + * * @param lhs * the left hand long * @param rhs @@ -967,14 +967,14 @@ public class EqualsBuilder implements Bu public boolean isEquals() { return this.isEquals; } - + /** *

Returns true if the fields that have been checked * are all equal.

* * @return true if all of the fields that have been checked * are equal, false otherwise. - * + * * @since 3.0 */ public Boolean build() { @@ -983,7 +983,7 @@ public class EqualsBuilder implements Bu /** * Sets the isEquals value. - * + * * @param isEquals The value to set. * @since 2.1 */