private String makeDescription ( Object value ) { String answer ; // Not initialized, so the compiler tells if we miss a // case if ( value == null ) { answer = "null" ; } else if ( value instanceof String ) { answer = "\"" + value + "\"" ; } else { Class < ? > objClass = value . getClass ( ) ; if ( ( objClass == Boolean . class ) || ( objClass == Character . class ) || ( objClass == Byte . class ) || ( objClass == Short . class ) || ( objClass == Integer . class ) || ( objClass == Long . class ) || ( objClass == Float . class ) || ( objClass == Double . class ) ) { answer = value . toString ( ) ; } else if ( objClass . isArray ( ) ) { if ( objClass . getComponentType ( ) . isPrimitive ( ) ) { answer = convertSimpleArrayToString ( value ) ; } else { answer = objClass . getComponentType ( ) + "[" + Array . getLength ( value ) + "]" ; } } else { answer = value . getClass ( ) . toString ( ) + "@" + Integer . toHexString ( System . identityHashCode ( value ) ) ; } } return answer ; }
Make a string that describes this object