question: public void merge_contents ( ) { if ( contents . length == 0 ) return ; Arrays . sort ( contents ) ; List < CallChainInfo > unique_calls = new ArrayList < CallChainInfo > ( ) ; unique_calls . add ( contents [ 0 ] ) ; for ( int ii = 1 ; ii < contents . length ; ii ++ ) { CallChainInfo top = unique_calls . get ( unique_calls . size ( ) - 1 ) ; if ( contents [ ii ] . method == top . method ) top . merge ( contents [ ii ] ) ; else unique_calls . add ( contents [ ii ] ) ; } logger . info ( "merge_contents {}: old {} elems, new {} elems" , method , contents . length , unique_calls . size ( ) ) ; contents = unique_calls . toArray ( new CallChainInfo [ 0 ] ) ; }
target:  merge any duplicate method calls 