code: private String dumpQueuedThread(Thread t)
     {
        StringBuilder sb = new StringBuilder();
  
        // Header
        sb = sb.append("Queued thread: ");
        sb = sb.append(t.getName());
        sb = sb.append(newLine);
  
        // Body
        StackTraceElement[] stes = SecurityActions.getStackTrace(t);
        if (stes != null)
        {
           for (StackTraceElement ste : stes)
           {
              sb = sb.append("  ");
              sb = sb.append(ste.getClassName());
              sb = sb.append(":");
              sb = sb.append(ste.getMethodName());
              sb = sb.append(":");
              sb = sb.append(ste.getLineNumber());
              sb = sb.append(newLine);
           }
        }
  
        return sb.toString();
     }
docs: Dump a thread
  @param t The thread
  @return The stack trace