static String id ( Object o ) { if ( o == null ) return "(null)" ; Thread t = Thread . currentThread ( ) ; StringBuilder sb = new StringBuilder ( 128 ) ; sb . append ( "(T[" ) . append ( t . getName ( ) ) . append ( "]@" ) ; sb . append ( Long . toString ( t . getId ( ) , Character . MAX_RADIX ) ) ; sb . append ( ":O[" ) . append ( o . getClass ( ) . getSimpleName ( ) ) ; sb . append ( "]@" ) ; sb . append ( Long . toString ( System . identityHashCode ( o ) , Character . MAX_RADIX ) ) ; sb . append ( ")" ) ; return sb . toString ( ) ; }
Tracing utility method useful for debugging