commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r829487 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java
Date Sun, 25 Oct 2009 03:37:21 GMT
Author: bayard
Date: Sun Oct 25 03:37:21 2009
New Revision: 829487

URL: http://svn.apache.org/viewvc?rev=829487&view=rev
Log:
Rolling back 826960 - IOException would need to be added to the API

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.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=829487&r1=829486&r2=829487&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 Sun Oct 25
03:37:21 2009
@@ -158,7 +158,7 @@
         if (object == null) {
             return null;
         }
-        StringBuilder buffer = new StringBuilder();
+        StringBuffer buffer = new StringBuffer();
         identityToString(buffer, object);
         return buffer.toString();
     }
@@ -178,17 +178,13 @@
      * @param object  the object to create a toString for
      * @since 2.4
      */
-    public static void identityToString(Appendable buffer, Object object) {
+    public static void identityToString(StringBuffer buffer, Object object) {
         if (object == null) {
             throw new NullPointerException("Cannot get the toString of a null identity");
         }
-        try {
-            buffer.append(object.getClass().getName())
-                  .append('@')
-                  .append(Integer.toHexString(System.identityHashCode(object)));
-        } catch(java.io.IOException ioe) {
-            // can't happen - Appendable API forces it upon us
-        }
+        buffer.append(object.getClass().getName())
+              .append('@')
+              .append(Integer.toHexString(System.identityHashCode(object)));
     }
 
     // ToString



Mime
View raw message