Program: 116790
Project: 116790
Buggy source:
@SuppressWarnings("String_Node_Str") public static Cartridge toCartridge(CartridgeConfig config){
  if (config == null) {
    return null;
  }
  Cartridge cartridge=new Cartridge();
  cartridge.setType(config.getType());
  cartridge.setDisplayName(config.getDisplayName());
  cartridge.setDescription(config.getDescription());
  cartridge.setHostName(config.getHostName());
  String[] deploymentDirs=config.getDeploymentDirs();
  if (deploymentDirs != null) {
    cartridge.setDeploymentDirs(Arrays.asList(deploymentDirs));
  }
  cartridge.setProvider(config.getProvider());
  cartridge.setVersion(config.getVersion());
  cartridge.setBaseDir(config.getBaseDir());
  cartridge.setPortMappings(Arrays.asList(config.getPortMappings()));
  cartridge.setMultiTenant(config.isMultiTenant());
  cartridge.setDefaultAutoscalingPolicy(config.getDefaultAutoscalingPolicy());
  org.apache.stratos.cloud.controller.pojo.Properties props=config.getProperties();
  if (props != null) {
    for (    Property prop : props.getProperties()) {
      cartridge.addProperty(prop.getName(),prop.getValue());
    }
  }
  cartridge.setLbConfig(config.getLbConfig());
  List<IaasProvider> iaases=FasterLookUpDataHolder.getInstance().getIaasProviders();
  IaasConfig[] iaasConfigs=config.getIaasConfigs();
  if (iaasConfigs != null) {
    for (    IaasConfig iaasConfig : iaasConfigs) {
      if (iaasConfig != null) {
        IaasProvider iaasProvider=null;
        if (iaases != null) {
          for (          IaasProvider iaas : iaases) {
            if (iaas.getType().equals(iaasConfig.getType())) {
              iaasProvider=new IaasProvider(iaas);
              break;
            }
          }
        }
        if (iaasProvider == null) {
          iaasProvider=new IaasProvider();
          iaasProvider.setType(iaasConfig.getType());
        }
        String className=iaasConfig.getClassName();
        if (className != null) {
          iaasProvider.setClassName(className);
        }
        String name=iaasConfig.getName();
        if (name != null) {
          iaasProvider.setName(name);
        }
        String identity=iaasConfig.getIdentity();
        if (identity != null) {
          iaasProvider.setIdentity(identity);
        }
        String credential=iaasConfig.getCredential();
        if (credential != null) {
          iaasProvider.setCredential(credential);
        }
        String provider=iaasConfig.getProvider();
        if (provider != null) {
          iaasProvider.setProvider(provider);
        }
        String imageId=iaasConfig.getImageId();
        if (imageId != null) {
          iaasProvider.setImage(imageId);
        }
        byte[] payload=iaasConfig.getPayload();
        if (payload != null) {
          iaasProvider.setPayload(payload);
        }
        org.apache.stratos.cloud.controller.pojo.Properties props1=config.getProperties();
        if (props1 != null) {
          for (          Property prop : props1.getProperties()) {
            iaasProvider.addProperty(prop.getName(),prop.getValue());
          }
        }
      }
    }
  }
  return cartridge;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static Cartridge toCartridge(CartridgeConfig config){
  if (config == null) {
    return null;
  }
  Cartridge cartridge=new Cartridge();
  cartridge.setType(config.getType());
  cartridge.setDisplayName(config.getDisplayName());
  cartridge.setDescription(config.getDescription());
  cartridge.setHostName(config.getHostName());
  String[] deploymentDirs=config.getDeploymentDirs();
  if ((deploymentDirs != null) && (deploymentDirs.length > 0)) {
    cartridge.setDeploymentDirs(Arrays.asList(deploymentDirs));
  }
  cartridge.setProvider(config.getProvider());
  cartridge.setVersion(config.getVersion());
  cartridge.setBaseDir(config.getBaseDir());
  cartridge.setPortMappings(Arrays.asList(config.getPortMappings()));
  cartridge.setMultiTenant(config.isMultiTenant());
  cartridge.setDefaultAutoscalingPolicy(config.getDefaultAutoscalingPolicy());
  org.apache.stratos.cloud.controller.pojo.Properties props=config.getProperties();
  if (props != null) {
    for (    Property prop : props.getProperties()) {
      cartridge.addProperty(prop.getName(),prop.getValue());
    }
  }
  cartridge.setLbConfig(config.getLbConfig());
  List<IaasProvider> iaases=FasterLookUpDataHolder.getInstance().getIaasProviders();
  IaasConfig[] iaasConfigs=config.getIaasConfigs();
  if (iaasConfigs != null) {
    for (    IaasConfig iaasConfig : iaasConfigs) {
      if (iaasConfig != null) {
        IaasProvider iaasProvider=null;
        if (iaases != null) {
          for (          IaasProvider iaas : iaases) {
            if (iaas.getType().equals(iaasConfig.getType())) {
              iaasProvider=new IaasProvider(iaas);
              break;
            }
          }
        }
        if (iaasProvider == null) {
          iaasProvider=new IaasProvider();
          iaasProvider.setType(iaasConfig.getType());
        }
        String className=iaasConfig.getClassName();
        if (className != null) {
          iaasProvider.setClassName(className);
        }
        String name=iaasConfig.getName();
        if (name != null) {
          iaasProvider.setName(name);
        }
        String identity=iaasConfig.getIdentity();
        if (identity != null) {
          iaasProvider.setIdentity(identity);
        }
        String credential=iaasConfig.getCredential();
        if (credential != null) {
          iaasProvider.setCredential(credential);
        }
        String provider=iaasConfig.getProvider();
        if (provider != null) {
          iaasProvider.setProvider(provider);
        }
        String imageId=iaasConfig.getImageId();
        if (imageId != null) {
          iaasProvider.setImage(imageId);
        }
        byte[] payload=iaasConfig.getPayload();
        if (payload != null) {
          iaasProvider.setPayload(payload);
        }
        org.apache.stratos.cloud.controller.pojo.Properties props1=config.getProperties();
        if (props1 != null) {
          for (          Property prop : props1.getProperties()) {
            iaasProvider.addProperty(prop.getName(),prop.getValue());
          }
        }
      }
    }
  }
  return cartridge;
}