private void dumpThreadInfoWithLocks(StringBuilder dump){
  dump.append(getDumpDate());
  dump.append(dumpPrefix);
  dump.append("\n");
  ThreadInfo[] tinfos=tmbean.dumpAllThreads(true,true);
  for (int i=0; i < tinfos.length; i++) {
    ThreadInfo ti=tinfos[i];
    printThreadInfo(ti,dump);
    LockInfo[] syncs=ti.getLockedSynchronizers();
    printLockInfo(syncs,dump);
  }
  dump.append("\n");
}

private void dumpThreadInfoWithLocks ( StringBuilder dump ) { dump . append ( getDumpDate ( ) ) ; dump . append ( dumpPrefix ) ; dump . append ( "\n" ) ; ThreadInfo [ ] tinfos = tmbean . dumpAllThreads ( true , true ) ; for ( int i = 0 ; i < tinfos . length ; i ++ ) { ThreadInfo ti = tinfos [ i ] ; printThreadInfo ( ti , dump ) ; LockInfo [ ] syncs = ti . getLockedSynchronizers ( ) ; printLockInfo ( syncs , dump ) ; } dump . append ( "\n" ) ; }
prints the thread dump information with locks info to system . out .
