Rolling back 826960 - IOException would need to be added to the API
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@829487 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dc200f42a4
commit
e2ccc014f8
|
@ -158,7 +158,7 @@ public class ObjectUtils {
|
|||
if (object == null) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
identityToString(buffer, object);
|
||||
return buffer.toString();
|
||||
}
|
||||
|
@ -178,17 +178,13 @@ public class ObjectUtils {
|
|||
* @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
|
||||
|
|
Loading…
Reference in New Issue