From 210709ed3d8739cafdb7b2ed7ca632d4e474706d Mon Sep 17 00:00:00 2001 From: Oliver Heger Date: Sat, 19 Mar 2011 16:01:06 +0000 Subject: [PATCH] Checkstyle and trailing spaces. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1083200 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/lang3/ObjectUtils.java | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/ObjectUtils.java b/src/main/java/org/apache/commons/lang3/ObjectUtils.java index 178de5ea4..beb8b28a2 100644 --- a/src/main/java/org/apache/commons/lang3/ObjectUtils.java +++ b/src/main/java/org/apache/commons/lang3/ObjectUtils.java @@ -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. @@ -25,7 +25,7 @@ /** *

Operations on {@code Object}.

- * + * *

This class tries to handle {@code null} input gracefully. * An exception will generally not be thrown for a {@code null} input. * Each method documents its behaviour in more detail.

@@ -60,7 +60,7 @@ public class ObjectUtils { *

This instance is Serializable.

*/ public static final Null NULL = new Null(); - + /** *

{@code ObjectUtils} instances should NOT be constructed in * standard programming. Instead, the static methods on the class should @@ -77,7 +77,7 @@ public ObjectUtils() { //----------------------------------------------------------------------- /** *

Returns a default value if the object passed is {@code null}.

- * + * *
      * ObjectUtils.defaultIfNull(null, null)      = null
      * ObjectUtils.defaultIfNull(null, "")        = ""
@@ -86,6 +86,7 @@ public ObjectUtils() {
      * ObjectUtils.defaultIfNull(Boolean.TRUE, *) = Boolean.TRUE
      * 
* + * @param the type of the object * @param object the {@code Object} to test, may be {@code null} * @param defaultValue the default value to return, may be {@code null} * @return {@code object} if it is not {@code null}, defaultValue otherwise @@ -98,7 +99,7 @@ public static T defaultIfNull(T object, T defaultValue) { *

Returns the first value in the array which is not {@code null}. * If all the values are {@code null} or the array is {@code null} * or empty then {@code null} is returned.

- * + * *
      * ObjectUtils.firstNonNull(null, null)      = null
      * ObjectUtils.firstNonNull(null, "")        = ""
@@ -110,6 +111,7 @@ public static  T defaultIfNull(T object, T defaultValue) {
      * ObjectUtils.firstNonNull()                = null
      * 
* + * @param the component type of the array * @param values the values to test, may be {@code null} or empty * @return the first value from {@code values} which is not {@code null}, * or {@code null} if there are no non-null values @@ -253,14 +255,14 @@ public static void identityToString(StringBuffer buffer, Object object) { /** *

Gets the {@code toString} of an {@code Object} returning * an empty string ("") if {@code null} input.

- * + * *
      * ObjectUtils.toString(null)         = ""
      * ObjectUtils.toString("")           = ""
      * ObjectUtils.toString("bat")        = "bat"
      * ObjectUtils.toString(Boolean.TRUE) = "true"
      * 
- * + * * @see StringUtils#defaultString(String) * @see String#valueOf(Object) * @param obj the Object to {@code toString}, may be null @@ -274,7 +276,7 @@ public static String toString(Object obj) { /** *

Gets the {@code toString} of an {@code Object} returning * a specified text if {@code null} input.

- * + * *
      * ObjectUtils.toString(null, null)           = null
      * ObjectUtils.toString(null, "null")         = "null"
@@ -282,7 +284,7 @@ public static String toString(Object obj) {
      * ObjectUtils.toString("bat", "null")        = "bat"
      * ObjectUtils.toString(Boolean.TRUE, "null") = "true"
      * 
- * + * * @see StringUtils#defaultString(String,String) * @see String#valueOf(Object) * @param obj the Object to {@code toString}, may be null @@ -298,7 +300,8 @@ public static String toString(Object obj, String nullStr) { //----------------------------------------------------------------------- /** *

Null safe comparison of Comparables.

- * + * + * @param type of the values processed by this method * @param values the set of comparable values, may be null * @return *
    @@ -322,7 +325,8 @@ public static > T min(T... values) { /** *

    Null safe comparison of Comparables.

    - * + * + * @param type of the values processed by this method * @param values the set of comparable values, may be null * @return *
      @@ -347,7 +351,8 @@ public static > T max(T... values) { /** *

      Null safe comparison of Comparables. * {@code null} is assumed to be less than a non-{@code null} value.

      - * + * + * @param type of the values processed by this method * @param c1 the first comparable, may be null * @param c2 the second comparable, may be null * @return a negative value if c1 < c2, zero if c1 = c2 @@ -359,7 +364,8 @@ public static > int compare(T c1, T c2) { /** *

      Null safe comparison of Comparables.

      - * + * + * @param type of the values processed by this method * @param c1 the first comparable, may be null * @param c2 the second comparable, may be null * @param nullGreater if true {@code null} is considered greater @@ -379,10 +385,10 @@ public static > int compare(T c1, T c2, boolean } return c1.compareTo(c2); } - + /** *

      Clone an object.

      - * + * * @param the type of the object * @param obj the object to clone, null returns null * @return the clone if the object implements {@link Cloneable} otherwise {@code null} @@ -429,14 +435,14 @@ public static T clone(final T obj) { /** *

      Clone an object if possible.

      - * + * *

      This method is similar to {@link #clone(Object)}, but will return the provided * instance as the return value instead of {@code null} if the instance * is not cloneable. This is more convenient if the caller uses different * implementations (e.g. of a service) and some of the implementations do not allow concurrent * processing or have state. In such cases the implementation can simply provide a proper * clone implementation and the caller's code does not have to change.

      - * + * * @param the type of the object * @param obj the object to clone, null returns null * @return the clone if the object implements {@link Cloneable} otherwise the object itself @@ -466,21 +472,21 @@ public static T cloneIfPossible(final T obj) { public static class Null implements Serializable { /** * Required for serialization support. Declare serialization compatibility with Commons Lang 1.0 - * + * * @see java.io.Serializable */ private static final long serialVersionUID = 7092611880189329093L; - + /** * Restricted constructor - singleton. */ Null() { super(); } - + /** *

      Ensure singleton.

      - * + * * @return the singleton value */ private Object readResolve() {