for (StackTraceElement stackTraceElement : stackTraceElements) {
for (int i = 0; i < stackTraceElements.length ; i ++ ) { StackTraceElement stackTraceElement = stackTraceElements[i];
	public synchronized String auditThreads() {		String auditReport = null;		Map<Thread, StackTraceElement[]> stackTraces = null;		// Scan all monitored threads looking for non-responsive ones		for (ThreadHandle threadHandle : threadHandles.values()) {			if (!threadHandle.isThreadActive()) {				// Get the non-responsive thread				Thread thread = threadHandle.getThread();				// Update the audit report				if (auditReport == null) {					auditReport = "Thread Auditor Report:\n";				}				auditReport += "   Thread [" + thread.getName() + "] has failed to respond to an audit request.\n";				// Get stack traces for all live threads (do this only once per audit)				if (stackTraces == null) {					stackTraces = Thread.getAllStackTraces();				}				// Get the stack trace for the non-responsive thread				StackTraceElement[] stackTraceElements = stackTraces.get(thread);				if (stackTraceElements != null && stackTraceElements.length > 0) {					auditReport += "      Stack trace:\n";					for (StackTraceElement stackTraceElement : stackTraceElements) {						auditReport += "         " + stackTraceElement.toString() + "\n";					}				} else {					auditReport += "      Stack trace is not available.\n";				}			}			// Reset the ping status of the thread			threadHandle.setThreadActive(false);		}		return auditReport;	}