private static String createLoggingString(Object object)
    {
        if (object == null)
        {
            return "null";
        }
        Class<? extends Object> objectClass = object.getClass();
        if (!objectClass.isArray())
        {
            return String.valueOf(object);
        }
        StringBuilder sb = new StringBuilder();
        int length = Array.getLength(object);
        sb.append("[");
        for (int i = 0; i < length; i++)
        {
            if (i > 0)
            {
                sb.append(", ");
            }
            Object element = Array.get(object, i);
            sb.append(createLoggingString(element));
        }
        sb.append("]");
        return sb.toString();
    }
private static String createLoggingString ( Object object ) { if ( object == null ) { return "null" ; } Class < ? extends Object > objectClass = object . getClass ( ) ; if ( ! objectClass . isArray ( ) ) { return String . valueOf ( object ) ; } StringBuilder sb = new StringBuilder ( ) ; int length = Array . getLength ( object ) ; sb . append ( "[" ) ; for ( int i = 0 ; i < length ; i ++ ) { if ( i > 0 ) { sb . append ( ", " ) ; } Object element = Array . get ( object , i ) ; sb . append ( createLoggingString ( element ) ) ; } sb . append ( "]" ) ; return sb . toString ( ) ; }
Create a string suitable for logging the given object

@param object The object
@return The string