Add missing '@Deprecated' annotations.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1553927 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2013-12-28 21:17:57 +00:00
parent b671987817
commit 25b4ce9978
3 changed files with 7 additions and 0 deletions

View File

@ -202,6 +202,7 @@ public static int hashCode(final Object array) {
* @deprecated this method has been replaced by {@code java.util.Objects.deepEquals(Object, Object)} and will be * @deprecated this method has been replaced by {@code java.util.Objects.deepEquals(Object, Object)} and will be
* removed from future releases. * removed from future releases.
*/ */
@Deprecated
public static boolean isEquals(final Object array1, final Object array2) { public static boolean isEquals(final Object array1, final Object array2) {
return new EqualsBuilder().append(array1, array2).isEquals(); return new EqualsBuilder().append(array1, array2).isEquals();
} }

View File

@ -152,6 +152,7 @@ public static <T> T firstNonNull(final T... values) {
* @deprecated this method has been replaced by {@code java.util.Objects.equals(Object, Object)} in Java 7 and will * @deprecated this method has been replaced by {@code java.util.Objects.equals(Object, Object)} in Java 7 and will
* be removed from future releases. * be removed from future releases.
*/ */
@Deprecated
public static boolean equals(final Object object1, final Object object2) { public static boolean equals(final Object object1, final Object object2) {
if (object1 == object2) { if (object1 == object2) {
return true; return true;
@ -200,6 +201,7 @@ public static boolean notEqual(final Object object1, final Object object2) {
* @deprecated this method has been replaced by {@code java.util.Objects.hashCode(Object)} in Java 7 and will be * @deprecated this method has been replaced by {@code java.util.Objects.hashCode(Object)} in Java 7 and will be
* removed in future releases * removed in future releases
*/ */
@Deprecated
public static int hashCode(final Object obj) { public static int hashCode(final Object obj) {
// hashCode(Object) retained for performance, as hash code is often critical // hashCode(Object) retained for performance, as hash code is often critical
return obj == null ? 0 : obj.hashCode(); return obj == null ? 0 : obj.hashCode();
@ -227,6 +229,7 @@ public static int hashCode(final Object obj) {
* @deprecated this method has been replaced by {@code java.util.Objects.hash(Object...)} in Java 7 an will be * @deprecated this method has been replaced by {@code java.util.Objects.hash(Object...)} in Java 7 an will be
* removed in future releases. * removed in future releases.
*/ */
@Deprecated
public static int hashCodeMulti(final Object... objects) { public static int hashCodeMulti(final Object... objects) {
int hash = 1; int hash = 1;
if (objects != null) { if (objects != null) {
@ -383,6 +386,7 @@ public static void identityToString(final StringBuilder builder, final Object ob
* removed in future releases. Note however that said method will return "null" for null references, while this * removed in future releases. Note however that said method will return "null" for null references, while this
* method returns and empty String. To preserve behavior use {@code java.util.Objects.toString(myObject, "")} * method returns and empty String. To preserve behavior use {@code java.util.Objects.toString(myObject, "")}
*/ */
@Deprecated
public static String toString(final Object obj) { public static String toString(final Object obj) {
return obj == null ? "" : obj.toString(); return obj == null ? "" : obj.toString();
} }
@ -408,6 +412,7 @@ public static String toString(final Object obj) {
* @deprecated this method has been replaced by {@code java.util.Objects.toString(Object, String)} in Java 7 and * @deprecated this method has been replaced by {@code java.util.Objects.toString(Object, String)} in Java 7 and
* will be removed in future releases. * will be removed in future releases.
*/ */
@Deprecated
public static String toString(final Object obj, final String nullStr) { public static String toString(final Object obj, final String nullStr) {
return obj == null ? nullStr : obj.toString(); return obj == null ? nullStr : obj.toString();
} }

View File

@ -7452,6 +7452,7 @@ public static String prependIfMissingIgnoreCase(final String str, final CharSequ
* @deprecated use {@link StringUtils#toEncodedString(byte[], Charset)} instead to String constants in your code * @deprecated use {@link StringUtils#toEncodedString(byte[], Charset)} instead to String constants in your code
* @since 3.1 * @since 3.1
*/ */
@Deprecated
public static String toString(final byte[] bytes, final String charsetName) throws UnsupportedEncodingException { public static String toString(final byte[] bytes, final String charsetName) throws UnsupportedEncodingException {
return charsetName != null ? new String(bytes, charsetName) : new String(bytes, Charset.defaultCharset()); return charsetName != null ? new String(bytes, charsetName) : new String(bytes, Charset.defaultCharset());
} }