common/src/main/java/HTTPClient/DefaultAuthHandler.java
/**
     * Try and figure out if the AWT is running. This is done by searching all
     * threads and looking for one whose name starts with "AWT-".
     */
Try and figure out if the AWT is running. This is done by searching all
threads and looking for one whose name starts with "AWT-".
Try and figure out if the AWT is running . This is done by searching all threads and looking for one whose name starts with " AWT - " .
private static final boolean isAWTRunning() {
	ThreadGroup root = Thread.currentThread().getThreadGroup();
	while (root.getParent() != null)
	    root = root.getParent();
	Thread[] t_list = new Thread[root.activeCount() + 5];
	int t_num = root.enumerate(t_list);
	for (int idx=0; idx<t_num; idx++)
	{
	    if (t_list[idx].getName().startsWith("AWT-"))
		return true;
	}
	return false;
    }
private static final boolean isAWTRunning ( ) { ThreadGroup root = Thread . currentThread ( ) . getThreadGroup ( ) ; while ( root . getParent ( ) != null ) root = root . getParent ( ) ; Thread [ ] t_list = new Thread [ root . activeCount ( ) + 5 ] ; int t_num = root . enumerate ( t_list ) ; for ( int idx = 0 ; idx < t_num ; idx ++ ) { if ( t_list [ idx ] . getName ( ) . startsWith ( "AWT-" ) ) return true ; } return false ; }
Try and figure out if the AWT is running.
Try and figure out if the AWT is running .
// find top-level thread group // search all threads