commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r754522 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/ObjectUtils.java test/org/apache/commons/lang/ObjectUtilsTest.java
Date Sat, 14 Mar 2009 21:24:07 GMT
Author: sebb
Date: Sat Mar 14 21:24:04 2009
New Revision: 754522

URL: http://svn.apache.org/viewvc?rev=754522&view=rev
Log:
Remove deprecated methods

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java?rev=754522&r1=754521&r2=754522&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java Sat Mar 14
21:24:04 2009
@@ -35,6 +35,7 @@
  * @since 1.0
  * @version $Id$
  */
+//@Immutable
 public class ObjectUtils {
 
     /**
@@ -186,38 +187,6 @@
               .append(Integer.toHexString(System.identityHashCode(object)));
     }
 
-    /**
-     * <p>Appends the toString that would be produced by <code>Object</code>
-     * if a class did not override toString itself. <code>null</code>
-     * will return <code>null</code>.</p>
-     *
-     * <pre>
-     * ObjectUtils.appendIdentityToString(*, null)            = null
-     * ObjectUtils.appendIdentityToString(null, "")           = "java.lang.String@1e23"
-     * ObjectUtils.appendIdentityToString(null, Boolean.TRUE) = "java.lang.Boolean@7fa"
-     * ObjectUtils.appendIdentityToString(buf, Boolean.TRUE)  = buf.append("java.lang.Boolean@7fa")
-     * </pre>
-     *
-     * @param buffer  the buffer to append to, may be <code>null</code>
-     * @param object  the object to create a toString for, may be <code>null</code>
-     * @return the default toString text, or <code>null</code> if
-     *  <code>null</code> passed in
-     * @since 2.0
-     * @deprecated The design of this method is bad - see LANG-360. Instead, use identityToString(StringBuffer,
Object).
-     */
-    public static StringBuffer appendIdentityToString(StringBuffer buffer, Object object)
{
-        if (object == null) {
-            return null;
-        }
-        if (buffer == null) {
-            buffer = new StringBuffer();
-        }
-        return buffer
-            .append(object.getClass().getName())
-            .append('@')
-            .append(Integer.toHexString(System.identityHashCode(object)));
-    }
-
     // ToString
     //-----------------------------------------------------------------------
     /**

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java?rev=754522&r1=754521&r2=754522&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/ObjectUtilsTest.java Sat Mar
14 21:24:04 2009
@@ -158,24 +158,6 @@
         }
     }
 
-    public void testAppendIdentityToString() {
-        assertEquals(null, ObjectUtils.appendIdentityToString(null, null));
-        assertEquals(null, ObjectUtils.appendIdentityToString(new StringBuffer(), null));
-        assertEquals(
-            "java.lang.String@" + Integer.toHexString(System.identityHashCode(FOO)),
-            ObjectUtils.appendIdentityToString(null, FOO).toString());
-        assertEquals(
-            "java.lang.String@" + Integer.toHexString(System.identityHashCode(FOO)),
-            ObjectUtils.appendIdentityToString(new StringBuffer(), FOO).toString());
-        Integer val = new Integer(90);
-        assertEquals(
-            "java.lang.Integer@" + Integer.toHexString(System.identityHashCode(val)),
-            ObjectUtils.appendIdentityToString(null, val).toString());
-        assertEquals(
-            "java.lang.Integer@" + Integer.toHexString(System.identityHashCode(val)),
-            ObjectUtils.appendIdentityToString(new StringBuffer(), val).toString());
-    }
-
     public void testToString_Object() {
         assertEquals("", ObjectUtils.toString((Object) null) );
         assertEquals(Boolean.TRUE.toString(), ObjectUtils.toString(Boolean.TRUE) );



Mime
View raw message