Program: 15281
Project: 15281
Buggy source:
@Override public void check() throws EucalyptusCloudException {
  try {
    boolean notConnected=false;
    if (!isConnected()) {
      connectResource();
      if (!isConnected()) {
        LOG.warn("String_Node_Str");
        notConnected=true;
      }
    }
    boolean notUpToDate=false;
    if (!isUpToDate()) {
      LOG.warn("String_Node_Str");
      notUpToDate=true;
    }
    if (Component.State.ENABLED.equals(Components.lookup("String_Node_Str").getState())) {
      if (!isPrimary()) {
        throw new EucalyptusCloudException("String_Node_Str");
      }
      return;
    }
 else {
      if (Component.State.DISABLED.equals(Components.lookup("String_Node_Str").getState())) {
        if (!isSecondary()) {
          LOG.warn("String_Node_Str");
          makeSecondary();
          if (!isSecondary()) {
            throw new EucalyptusCloudException("String_Node_Str");
          }
        }
        NavigableSet<ServiceConfiguration> hii=Components.lookup("String_Node_Str").lookupServiceConfigurations();
        boolean isOtherPrimary=false;
        for (        ServiceConfiguration ii : hii) {
          isOtherPrimary|=Component.State.ENABLED.equals(ii.lookupStateMachine().getState()) && !ii.isVmLocal() ? true : false;
        }
        if (!isOtherPrimary) {
          return;
        }
      }
      if (!notConnected) {
        throw new EucalyptusCloudException("String_Node_Str");
      }
      if (!notUpToDate) {
        throw new EucalyptusCloudException("String_Node_Str");
      }
    }
  }
 catch (  ExecutionException ex) {
    throw new EucalyptusCloudException(ex);
  }
}

Fixed version (ground truth):
@Override public void check() throws EucalyptusCloudException {
  try {
    boolean notConnected=false;
    if (!isConnected()) {
      connectResource();
      if (!isConnected()) {
        LOG.warn("String_Node_Str");
        notConnected=true;
      }
    }
    boolean notUpToDate=false;
    if (!isUpToDate()) {
      LOG.warn("String_Node_Str");
      notUpToDate=true;
    }
    if (Component.State.ENABLED.equals(Components.lookup("String_Node_Str").getState())) {
      if (!isPrimary()) {
        throw new EucalyptusCloudException("String_Node_Str");
      }
      return;
    }
 else {
      if (Component.State.DISABLED.equals(Components.lookup("String_Node_Str").getState())) {
        if (!isSecondary()) {
          LOG.warn("String_Node_Str");
          makeSecondary();
          if (!isSecondary()) {
            throw new EucalyptusCloudException("String_Node_Str");
          }
        }
        NavigableSet<ServiceConfiguration> hii=Components.lookup("String_Node_Str").lookupServiceConfigurations();
        boolean isOtherPrimary=false;
        for (        ServiceConfiguration ii : hii) {
          isOtherPrimary|=Component.State.ENABLED.equals(ii.lookupState()) && !ii.isVmLocal() ? true : false;
        }
        if (!isOtherPrimary) {
          return;
        }
      }
      if (!notConnected) {
        throw new EucalyptusCloudException("String_Node_Str");
      }
      if (!notUpToDate) {
        throw new EucalyptusCloudException("String_Node_Str");
      }
    }
  }
 catch (  ExecutionException ex) {
    throw new EucalyptusCloudException(ex);
  }
}