commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1557584 - in /commons/proper/lang/trunk/src: changes/ main/java/org/apache/commons/lang3/ main/java/org/apache/commons/lang3/concurrent/ main/java/org/apache/commons/lang3/reflect/ main/java/org/apache/commons/lang3/text/ main/java/org/apa...
Date Sun, 12 Jan 2014 18:26:49 GMT
Author: britter
Date: Sun Jan 12 18:26:49 2014
New Revision: 1557584

URL: http://svn.apache.org/r1557584
Log:
LANG-940: Fix deprecation warnings

Modified:
    commons/proper/lang/trunk/src/changes/changes.xml
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrBuilder.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/tuple/Pair.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/tuple/Triple.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java

Modified: commons/proper/lang/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/changes/changes.xml?rev=1557584&r1=1557583&r2=1557584&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/lang/trunk/src/changes/changes.xml [utf-8] Sun Jan 12 18:26:49 2014
@@ -22,6 +22,7 @@
   <body>
 
   <release version="3.3" date="TBA" description="Bugfix and Feature release">
+    <action issue="LANG-940" type="update" dev="britter">Fix deprecation warnings</action>
     <action issue="LANG-819" type="update" dev="mbenson">EnumUtils.generateBitVector
needs a "? extends"</action>
     <action issue="LANG-834" type="add" dev="britter">Validate: add inclusiveBetween
and exclusiveBetween overloads for primitive types</action>
     <action issue="LANG-900" type="add" dev="britter" due-to="Duncan Jones">New RandomUtils
class</action>

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java?rev=1557584&r1=1557583&r2=1557584&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java Sun
Jan 12 18:26:49 2014
@@ -207,6 +207,11 @@ public class ObjectUtils {
         return obj == null ? 0 : obj.hashCode();
     }
 
+    @Override
+    public String toString() {
+        return super.toString();
+    }
+
     /**
      * <p>Gets the hash code for multiple objects.</p>
      * 

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1557584&r1=1557583&r2=1557584&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Sun
Jan 12 18:26:49 2014
@@ -4039,7 +4039,9 @@ public class StringUtils {
         }
         final Object first = iterator.next();
         if (!iterator.hasNext()) {
-            return ObjectUtils.toString(first);
+            @SuppressWarnings( "deprecation" ) // ObjectUtils.toString(Object) has been deprecated
in 3.2
+            String result = ObjectUtils.toString(first);
+            return result;
         }
 
         // two or more elements
@@ -4083,7 +4085,9 @@ public class StringUtils {
         }
         final Object first = iterator.next();
         if (!iterator.hasNext()) {
-            return ObjectUtils.toString(first);
+            @SuppressWarnings( "deprecation" ) // ObjectUtils.toString(Object) has been deprecated
in 3.2
+            final String result = ObjectUtils.toString(first);
+            return result;
         }
 
         // two or more elements

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java?rev=1557584&r1=1557583&r2=1557584&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/concurrent/ConstantInitializer.java
Sun Jan 12 18:26:49 2014
@@ -101,6 +101,7 @@ public class ConstantInitializer<T> impl
      * @param obj the object to compare to
      * @return a flag whether the objects are equal
      */
+    @SuppressWarnings( "deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated
in 3.2
     @Override
     public boolean equals(final Object obj) {
         if (this == obj) {

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java?rev=1557584&r1=1557583&r2=1557584&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
Sun Jan 12 18:26:49 2014
@@ -203,6 +203,7 @@ public class TypeUtils {
         /**
          * {@inheritDoc}
          */
+        @SuppressWarnings( "deprecation" )  // ObjectUtils.hashCode(Object) has been deprecated
in 3.2
         @Override
         public int hashCode() {
             int result = 71 << 4;
@@ -1566,6 +1567,7 @@ public class TypeUtils {
      * @return boolean
      * @since 3.2
      */
+    @SuppressWarnings( "deprecation" )  // ObjectUtils.equals(Object, Object) has been deprecated
in 3.2
     public static boolean equals(Type t1, Type t2) {
         if (ObjectUtils.equals(t1, t2)) {
             return true;

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java?rev=1557584&r1=1557583&r2=1557584&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
Sun Jan 12 18:26:49 2014
@@ -289,6 +289,7 @@ public class ExtendedMessageFormat exten
      *
      * @return the hashcode
      */
+    @SuppressWarnings( "deprecation" ) // ObjectUtils.hashCode(Object) has been deprecated
in 3.2
     @Override
     public int hashCode() {
         int result = super.hashCode();

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrBuilder.java?rev=1557584&r1=1557583&r2=1557584&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrBuilder.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrBuilder.java
Sun Jan 12 18:26:49 2014
@@ -1128,12 +1128,13 @@ public class StrBuilder implements CharS
      * @param separator  the separator to use, null means no separator
      * @return this, to enable chaining
      */
-    public StrBuilder appendWithSeparators(final Object[] array, String separator) {
+    public StrBuilder appendWithSeparators(final Object[] array, final String separator)
{
         if (array != null && array.length > 0) {
-            separator = ObjectUtils.toString(separator);
+            @SuppressWarnings( "deprecation" ) // ObjectUtils.toString(Object) has been deprecated
in 3.2
+            final String sep = ObjectUtils.toString(separator);
             append(array[0]);
             for (int i = 1; i < array.length; i++) {
-                append(separator);
+                append(sep);
                 append(array[i]);
             }
         }
@@ -1150,14 +1151,15 @@ public class StrBuilder implements CharS
      * @param separator  the separator to use, null means no separator
      * @return this, to enable chaining
      */
-    public StrBuilder appendWithSeparators(final Iterable<?> iterable, String separator)
{
+    public StrBuilder appendWithSeparators(final Iterable<?> iterable, final String
separator) {
         if (iterable != null) {
-            separator = ObjectUtils.toString(separator);
+            @SuppressWarnings( "deprecation" ) // ObjectUtils.toString(Object) has been deprecated
in 3.2
+            final String sep = ObjectUtils.toString(separator);
             final Iterator<?> it = iterable.iterator();
             while (it.hasNext()) {
                 append(it.next());
                 if (it.hasNext()) {
-                    append(separator);
+                    append(sep);
                 }
             }
         }
@@ -1174,13 +1176,14 @@ public class StrBuilder implements CharS
      * @param separator  the separator to use, null means no separator
      * @return this, to enable chaining
      */
-    public StrBuilder appendWithSeparators(final Iterator<?> it, String separator)
{
+    public StrBuilder appendWithSeparators(final Iterator<?> it, final String separator)
{
         if (it != null) {
-            separator = ObjectUtils.toString(separator);
+            @SuppressWarnings( "deprecation" ) // ObjectUtils.toString(Object) has been deprecated
in 3.2
+            final String sep = ObjectUtils.toString(separator);
             while (it.hasNext()) {
                 append(it.next());
                 if (it.hasNext()) {
-                    append(separator);
+                    append(sep);
                 }
             }
         }

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/tuple/Pair.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/tuple/Pair.java?rev=1557584&r1=1557583&r2=1557584&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/tuple/Pair.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/tuple/Pair.java Sun Jan
12 18:26:49 2014
@@ -125,6 +125,7 @@ public abstract class Pair<L, R> impleme
      * @param obj  the object to compare to, null returns false
      * @return true if the elements of the pair are equal
      */
+    @SuppressWarnings( "deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated
in 3.2
     @Override
     public boolean equals(final Object obj) {
         if (obj == this) {

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/tuple/Triple.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/tuple/Triple.java?rev=1557584&r1=1557583&r2=1557584&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/tuple/Triple.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/tuple/Triple.java Sun
Jan 12 18:26:49 2014
@@ -105,6 +105,7 @@ public abstract class Triple<L, M, R> im
      * @param obj  the object to compare to, null returns false
      * @return true if the elements of the triple are equal
      */
+    @SuppressWarnings( "deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated
in 3.2
     @Override
     public boolean equals(final Object obj) {
         if (obj == this) {

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java?rev=1557584&r1=1557583&r2=1557584&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
Sun Jan 12 18:26:49 2014
@@ -280,12 +280,14 @@ public class ObjectUtilsTest {
         }
     }
 
+    @SuppressWarnings( "deprecation" ) // ObjectUtils.toString(Object) has been deprecated
in 3.2
     @Test
     public void testToString_Object() {
         assertEquals("", ObjectUtils.toString((Object) null) );
         assertEquals(Boolean.TRUE.toString(), ObjectUtils.toString(Boolean.TRUE) );
     }
-            
+
+    @SuppressWarnings( "deprecation" ) // ObjectUtils.toString(Object) has been deprecated
in 3.2
     @Test
     public void testToString_ObjectString() {
         assertEquals(BAR, ObjectUtils.toString((Object) null, BAR) );



Mime
View raw message