Checkstyle and trailing spaces.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1083200 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oliver Heger 2011-03-19 16:01:06 +00:00
parent cd23f77879
commit 210709ed3d
1 changed files with 28 additions and 22 deletions

View File

@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -25,7 +25,7 @@
/** /**
* <p>Operations on {@code Object}.</p> * <p>Operations on {@code Object}.</p>
* *
* <p>This class tries to handle {@code null} input gracefully. * <p>This class tries to handle {@code null} input gracefully.
* An exception will generally not be thrown for a {@code null} input. * An exception will generally not be thrown for a {@code null} input.
* Each method documents its behaviour in more detail.</p> * Each method documents its behaviour in more detail.</p>
@ -60,7 +60,7 @@ public class ObjectUtils {
* <p>This instance is Serializable.</p> * <p>This instance is Serializable.</p>
*/ */
public static final Null NULL = new Null(); public static final Null NULL = new Null();
/** /**
* <p>{@code ObjectUtils} instances should NOT be constructed in * <p>{@code ObjectUtils} instances should NOT be constructed in
* standard programming. Instead, the static methods on the class should * standard programming. Instead, the static methods on the class should
@ -77,7 +77,7 @@ public ObjectUtils() {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
/** /**
* <p>Returns a default value if the object passed is {@code null}.</p> * <p>Returns a default value if the object passed is {@code null}.</p>
* *
* <pre> * <pre>
* ObjectUtils.defaultIfNull(null, null) = null * ObjectUtils.defaultIfNull(null, null) = null
* ObjectUtils.defaultIfNull(null, "") = "" * ObjectUtils.defaultIfNull(null, "") = ""
@ -86,6 +86,7 @@ public ObjectUtils() {
* ObjectUtils.defaultIfNull(Boolean.TRUE, *) = Boolean.TRUE * ObjectUtils.defaultIfNull(Boolean.TRUE, *) = Boolean.TRUE
* </pre> * </pre>
* *
* @param <T> the type of the object
* @param object the {@code Object} to test, may be {@code null} * @param object the {@code Object} to test, may be {@code null}
* @param defaultValue the default value to return, 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 * @return {@code object} if it is not {@code null}, defaultValue otherwise
@ -98,7 +99,7 @@ public static <T> T defaultIfNull(T object, T defaultValue) {
* <p>Returns the first value in the array which is not {@code null}. * <p>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} * If all the values are {@code null} or the array is {@code null}
* or empty then {@code null} is returned.</p> * or empty then {@code null} is returned.</p>
* *
* <pre> * <pre>
* ObjectUtils.firstNonNull(null, null) = null * ObjectUtils.firstNonNull(null, null) = null
* ObjectUtils.firstNonNull(null, "") = "" * ObjectUtils.firstNonNull(null, "") = ""
@ -110,6 +111,7 @@ public static <T> T defaultIfNull(T object, T defaultValue) {
* ObjectUtils.firstNonNull() = null * ObjectUtils.firstNonNull() = null
* </pre> * </pre>
* *
* @param <T> the component type of the array
* @param values the values to test, may be {@code null} or empty * @param values the values to test, may be {@code null} or empty
* @return the first value from {@code values} which is not {@code null}, * @return the first value from {@code values} which is not {@code null},
* or {@code null} if there are no non-null values * or {@code null} if there are no non-null values
@ -253,14 +255,14 @@ public static void identityToString(StringBuffer buffer, Object object) {
/** /**
* <p>Gets the {@code toString} of an {@code Object} returning * <p>Gets the {@code toString} of an {@code Object} returning
* an empty string ("") if {@code null} input.</p> * an empty string ("") if {@code null} input.</p>
* *
* <pre> * <pre>
* ObjectUtils.toString(null) = "" * ObjectUtils.toString(null) = ""
* ObjectUtils.toString("") = "" * ObjectUtils.toString("") = ""
* ObjectUtils.toString("bat") = "bat" * ObjectUtils.toString("bat") = "bat"
* ObjectUtils.toString(Boolean.TRUE) = "true" * ObjectUtils.toString(Boolean.TRUE) = "true"
* </pre> * </pre>
* *
* @see StringUtils#defaultString(String) * @see StringUtils#defaultString(String)
* @see String#valueOf(Object) * @see String#valueOf(Object)
* @param obj the Object to {@code toString}, may be null * @param obj the Object to {@code toString}, may be null
@ -274,7 +276,7 @@ public static String toString(Object obj) {
/** /**
* <p>Gets the {@code toString} of an {@code Object} returning * <p>Gets the {@code toString} of an {@code Object} returning
* a specified text if {@code null} input.</p> * a specified text if {@code null} input.</p>
* *
* <pre> * <pre>
* ObjectUtils.toString(null, null) = null * ObjectUtils.toString(null, null) = null
* 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("bat", "null") = "bat"
* ObjectUtils.toString(Boolean.TRUE, "null") = "true" * ObjectUtils.toString(Boolean.TRUE, "null") = "true"
* </pre> * </pre>
* *
* @see StringUtils#defaultString(String,String) * @see StringUtils#defaultString(String,String)
* @see String#valueOf(Object) * @see String#valueOf(Object)
* @param obj the Object to {@code toString}, may be null * @param obj the Object to {@code toString}, may be null
@ -298,7 +300,8 @@ public static String toString(Object obj, String nullStr) {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
/** /**
* <p>Null safe comparison of Comparables.</p> * <p>Null safe comparison of Comparables.</p>
* *
* @param <T> type of the values processed by this method
* @param values the set of comparable values, may be null * @param values the set of comparable values, may be null
* @return * @return
* <ul> * <ul>
@ -322,7 +325,8 @@ public static <T extends Comparable<? super T>> T min(T... values) {
/** /**
* <p>Null safe comparison of Comparables.</p> * <p>Null safe comparison of Comparables.</p>
* *
* @param <T> type of the values processed by this method
* @param values the set of comparable values, may be null * @param values the set of comparable values, may be null
* @return * @return
* <ul> * <ul>
@ -347,7 +351,8 @@ public static <T extends Comparable<? super T>> T max(T... values) {
/** /**
* <p>Null safe comparison of Comparables. * <p>Null safe comparison of Comparables.
* {@code null} is assumed to be less than a non-{@code null} value.</p> * {@code null} is assumed to be less than a non-{@code null} value.</p>
* *
* @param <T> type of the values processed by this method
* @param c1 the first comparable, may be null * @param c1 the first comparable, may be null
* @param c2 the second comparable, may be null * @param c2 the second comparable, may be null
* @return a negative value if c1 < c2, zero if c1 = c2 * @return a negative value if c1 < c2, zero if c1 = c2
@ -359,7 +364,8 @@ public static <T extends Comparable<? super T>> int compare(T c1, T c2) {
/** /**
* <p>Null safe comparison of Comparables.</p> * <p>Null safe comparison of Comparables.</p>
* *
* @param <T> type of the values processed by this method
* @param c1 the first comparable, may be null * @param c1 the first comparable, may be null
* @param c2 the second comparable, may be null * @param c2 the second comparable, may be null
* @param nullGreater if true {@code null} is considered greater * @param nullGreater if true {@code null} is considered greater
@ -379,10 +385,10 @@ public static <T extends Comparable<? super T>> int compare(T c1, T c2, boolean
} }
return c1.compareTo(c2); return c1.compareTo(c2);
} }
/** /**
* <p>Clone an object.</p> * <p>Clone an object.</p>
* *
* @param <T> the type of the object * @param <T> the type of the object
* @param obj the object to clone, null returns null * @param obj the object to clone, null returns null
* @return the clone if the object implements {@link Cloneable} otherwise {@code null} * @return the clone if the object implements {@link Cloneable} otherwise {@code null}
@ -429,14 +435,14 @@ public static <T> T clone(final T obj) {
/** /**
* <p>Clone an object if possible.</p> * <p>Clone an object if possible.</p>
* *
* <p>This method is similar to {@link #clone(Object)}, but will return the provided * <p>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 * instance as the return value instead of {@code null} if the instance
* is not cloneable. This is more convenient if the caller uses different * 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 * 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 * 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.</p> * clone implementation and the caller's code does not have to change.</p>
* *
* @param <T> the type of the object * @param <T> the type of the object
* @param obj the object to clone, null returns null * @param obj the object to clone, null returns null
* @return the clone if the object implements {@link Cloneable} otherwise the object itself * @return the clone if the object implements {@link Cloneable} otherwise the object itself
@ -466,21 +472,21 @@ public static <T> T cloneIfPossible(final T obj) {
public static class Null implements Serializable { public static class Null implements Serializable {
/** /**
* Required for serialization support. Declare serialization compatibility with Commons Lang 1.0 * Required for serialization support. Declare serialization compatibility with Commons Lang 1.0
* *
* @see java.io.Serializable * @see java.io.Serializable
*/ */
private static final long serialVersionUID = 7092611880189329093L; private static final long serialVersionUID = 7092611880189329093L;
/** /**
* Restricted constructor - singleton. * Restricted constructor - singleton.
*/ */
Null() { Null() {
super(); super();
} }
/** /**
* <p>Ensure singleton.</p> * <p>Ensure singleton.</p>
* *
* @return the singleton value * @return the singleton value
*/ */
private Object readResolve() { private Object readResolve() {