Program: 115560
Project: 115560
Buggy source:
public static List<CartridgeBean> getAvailableCartridges(String cartridgeSearchString,Boolean multiTenant,ConfigurationContext configurationContext,int tenantId) throws RestAPIException {
  List<CartridgeBean> cartridges=new ArrayList<CartridgeBean>();
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + cartridgeSearchString + "String_Node_Str"+ multiTenant);
  }
  try {
    Pattern searchPattern=getSearchStringPattern(cartridgeSearchString);
    String[] availableCartridges=CloudControllerServiceClient.getInstance().getRegisteredCartridges();
    if (availableCartridges != null) {
      for (      String cartridgeType : availableCartridges) {
        Cartridge cartridgeInfo=null;
        try {
          cartridgeInfo=CloudControllerServiceClient.getInstance().getCartridgeByTenant(cartridgeType,tenantId);
        }
 catch (        Exception e) {
          if (log.isWarnEnabled()) {
            log.warn("String_Node_Str" + cartridgeType + "String_Node_Str"+ e.getMessage());
          }
        }
        if (cartridgeInfo == null) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + cartridgeType);
          }
          continue;
        }
        if (multiTenant != null && !multiTenant && cartridgeInfo.getMultiTenant()) {
          continue;
        }
 else         if (multiTenant != null && multiTenant && !cartridgeInfo.getMultiTenant()) {
          continue;
        }
        if (!StratosApiV41Utils.cartridgeMatches(cartridgeInfo,searchPattern)) {
          continue;
        }
        if (cartridgeInfo.getTenantId() == tenantId) {
          CartridgeBean cartridge=ObjectConverter.convertCartridgeToCartridgeDefinitionBean(cartridgeInfo);
          cartridges.add(cartridge);
        }
      }
    }
 else {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str");
      }
    }
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e.getMessage();
    log.error(msg,e);
    throw new RestAPIException(msg,e);
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + cartridges.size());
  }
  return cartridges;
}

Fixed version (ground truth):
public static List<CartridgeBean> getAvailableCartridges(String cartridgeSearchString,Boolean multiTenant,ConfigurationContext configurationContext,int tenantId) throws RestAPIException {
  List<CartridgeBean> cartridges=new ArrayList<CartridgeBean>();
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + cartridgeSearchString + "String_Node_Str"+ multiTenant);
  }
  try {
    Pattern searchPattern=getSearchStringPattern(cartridgeSearchString);
    Cartridge[] availableCartridges=CloudControllerServiceClient.getInstance().getCartridgesByTenant(tenantId);
    if (availableCartridges != null) {
      for (      Cartridge cartridgeDefinition : availableCartridges) {
        Cartridge cartridgeInfo=null;
        try {
          cartridgeInfo=cartridgeDefinition;
        }
 catch (        Exception e) {
          if (log.isWarnEnabled()) {
            log.warn("String_Node_Str" + cartridgeDefinition.getType() + "String_Node_Str"+ e.getMessage());
          }
        }
        if (cartridgeInfo == null) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + cartridgeDefinition.getType());
          }
          continue;
        }
        if (multiTenant != null && !multiTenant && cartridgeInfo.getMultiTenant()) {
          continue;
        }
 else         if (multiTenant != null && multiTenant && !cartridgeInfo.getMultiTenant()) {
          continue;
        }
        if (!StratosApiV41Utils.cartridgeMatches(cartridgeInfo,searchPattern)) {
          continue;
        }
        if (cartridgeInfo.getTenantId() == tenantId) {
          CartridgeBean cartridge=ObjectConverter.convertCartridgeToCartridgeDefinitionBean(cartridgeInfo);
          cartridges.add(cartridge);
        }
      }
    }
 else {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str");
      }
    }
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e.getMessage();
    log.error(msg,e);
    throw new RestAPIException(msg,e);
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + cartridges.size());
  }
  return cartridges;
}