Program: 46870
Project: 46870
Buggy source:
public void shutdown(final boolean terminate){
  long start=Clock.currentTimeMillis();
  if (logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + state);
  }
  if (!setShuttingDown()) {
    waitIfAlreadyShuttingDown();
    return;
  }
  if (!terminate) {
    final int maxWaitSeconds=groupProperties.getSeconds(GroupProperty.GRACEFUL_SHUTDOWN_MAX_WAIT);
    if (!partitionService.prepareToSafeShutdown(maxWaitSeconds,TimeUnit.SECONDS)) {
      logger.warning("String_Node_Str" + maxWaitSeconds + "String_Node_Str");
    }
    try {
      clusterService.sendShutdownMessage();
      if (logger.isFinestEnabled()) {
        logger.finest("String_Node_Str");
      }
    }
 catch (    Throwable t) {
      EmptyStatement.ignore(t);
    }
  }
 else {
    logger.warning("String_Node_Str");
  }
  joined.set(false);
  setMasterAddress(null);
  try {
    if (groupProperties.getBoolean(GroupProperty.SHUTDOWNHOOK_ENABLED)) {
      Runtime.getRuntime().removeShutdownHook(shutdownHookThread);
    }
    discoveryService.destroy();
  }
 catch (  Throwable ignored) {
  }
  nodeExtension.beforeShutdown();
  phoneHome.shutdown();
  if (managementCenterService != null) {
    managementCenterService.shutdown();
  }
  textCommandService.stop();
  if (multicastService != null) {
    logger.info("String_Node_Str");
    multicastService.stop();
  }
  logger.info("String_Node_Str");
  connectionManager.shutdown();
  logger.info("String_Node_Str");
  nodeEngine.shutdown(terminate);
  if (securityContext != null) {
    securityContext.destroy();
  }
  logger.finest("String_Node_Str");
  serializationService.destroy();
  hazelcastThreadGroup.destroy();
  nodeExtension.shutdown();
  logger.info("String_Node_Str" + (Clock.currentTimeMillis() - start) + "String_Node_Str");
  state=NodeState.SHUT_DOWN;
}

Fixed version (ground truth):
public void shutdown(final boolean terminate){
  long start=Clock.currentTimeMillis();
  if (logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + state);
  }
  if (!setShuttingDown()) {
    waitIfAlreadyShuttingDown();
    return;
  }
  if (!terminate) {
    final int maxWaitSeconds=groupProperties.getSeconds(GroupProperty.GRACEFUL_SHUTDOWN_MAX_WAIT);
    if (!partitionService.prepareToSafeShutdown(maxWaitSeconds,TimeUnit.SECONDS)) {
      logger.warning("String_Node_Str" + maxWaitSeconds + "String_Node_Str");
    }
    try {
      clusterService.sendShutdownMessage();
      if (logger.isFinestEnabled()) {
        logger.finest("String_Node_Str");
      }
    }
 catch (    Throwable t) {
      EmptyStatement.ignore(t);
    }
  }
 else {
    logger.warning("String_Node_Str");
  }
  joined.set(false);
  setMasterAddress(null);
  try {
    if (groupProperties.getBoolean(GroupProperty.SHUTDOWNHOOK_ENABLED)) {
      Runtime.getRuntime().removeShutdownHook(shutdownHookThread);
    }
    discoveryService.destroy();
  }
 catch (  Throwable ignored) {
  }
  try {
    shutdownServices(terminate);
    state=NodeState.SHUT_DOWN;
    logger.info("String_Node_Str" + (Clock.currentTimeMillis() - start) + "String_Node_Str");
  }
  finally {
    if (state != NodeState.SHUT_DOWN) {
      shuttingDown.compareAndSet(true,false);
    }
  }
}