Buggy code:
public class ServerInventoryImpl implements ServerInventory { private static final Logger log = Logger . getLogger ( "org.jboss.as.host.controller" ) ; private final Map < String , ManagedServer > servers = Collections . synchronizedMap ( new HashMap < String , ManagedServer > ( ) ) ; private final HostControllerEnvironment environment ; private final ProcessControllerClient processControllerClient ; private final InetSocketAddress managementAddress ; private final DomainController domainController ; private final Object shutdownCondition = new Object ( ) ; private volatile CountDownLatch processInventoryLatch ; private volatile Map < String , ProcessInfo > processInfos ; private volatile boolean stopped ; ServerInventoryImpl ( final DomainController domainController , final HostControllerEnvironment environment , final InetSocketAddress managementAddress , final ProcessControllerClient processControllerClient ) { } public String getServerProcessName ( String serverName ) { } public String getProcessServerName ( String processName ) { } public synchronized Map < String , ProcessInfo > determineRunningProcesses ( ) { } public Map < String , ProcessInfo > determineRunningProcesses ( boolean serversOnly ) { } @ Override public void processInventory ( Map < String , ProcessInfo > processInfos ) { } public ServerStatus determineServerStatus ( final String serverName ) { } public ServerStatus startServer ( final String serverName , final ModelNode domainModel ) { } public void reconnectServer ( final String serverName , final ModelNode domainModel , final boolean running ) { } public ServerStatus restartServer ( String serverName , final int gracefulTimeout , final ModelNode domainModel ) { } public ServerStatus stopServer ( final String serverName , final int gracefulTimeout ) { } @ Override public void serverRegistered ( final String serverProcessName , final Channel channel , ProxyCreatedCallback callback ) { } @ Override public void serverStartFailed ( String serverProcessName ) { } @ Override public void serverStopped ( String serverProcessName ) { } public void stopServers ( int gracefulTimeout ) { } void stopServers ( int gracefulTimeout , boolean blockUntilStopped ) { stopped = true ; Map < String , ProcessInfo > processInfoMap = determineRunningProcesses ( ) ; for ( String serverProcessName : processInfoMap . keySet ( ) ) { if ( ManagedServer . isServerProcess ( serverProcessName ) ) { String serverName = ManagedServer . getServerName ( serverProcessName ) ; stopServer ( serverName , gracefulTimeout ) ; } } if ( blockUntilStopped ) { synchronized ( shutdownCondition ) { for ( ; ; ) { int count = 0 ; try { processInfoMap = determineRunningProcesses ( ) ; } catch ( RuntimeException e ) { return ; } for ( ManagedServer server : servers . values ( ) ) { final ProcessInfo info = processInfoMap . get ( server . getServerProcessName ( ) ) ; switch ( server . getState ( ) ) { case FAILED : case MAX_FAILED : case STOPPED : break ; default : <START_BUG> if ( ( info != null ) && ( info . isRunning ( ) ) ) { <END_BUG> count ++ ; } } } if ( count == 0 ) { break ; } try { shutdownCondition . wait ( 500 ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; break ; } } } } } private void checkState ( final ManagedServer server , final ServerState expected ) { } private ManagedServer createManagedServer ( final String serverName , final ModelNode domainModel ) { } public CallbackHandler getServerCallbackHandler ( ) { } }

Fix:
if ( info != null ) {