Program: 167434
Project: 167434
Buggy source:
protected void deployResources(Flow flow){
  Set<Resource> flowResources=flow.findResources();
  for (  Resource flowResource : flowResources) {
    IResourceRuntime alreadyDeployed=deployedResources.get(flowResource.getId());
    Map<String,SettingDefinition> settings=resourceFactory.getSettingDefinitionsForResourceType(flowResource.getType());
    TypedProperties defaultSettings=flowResource.toTypedProperties(settings);
    TypedProperties overrideSettings=agent.toTypedProperties(flowResource);
    TypedProperties combined=new TypedProperties(defaultSettings);
    combined.putAll(overrideSettings);
    boolean deploy=true;
    if (alreadyDeployed != null) {
      deploy=false;
      Resource deployedResource=alreadyDeployed.getResource();
      TypedProperties alreadyDeployedOverrides=alreadyDeployed.getResourceRuntimeSettings();
      TypedProperties alreadyDeployedDefaultSettings=deployedResource.toTypedProperties(settings);
      TypedProperties alreadyDeployedCombined=new TypedProperties(alreadyDeployedDefaultSettings);
      alreadyDeployedCombined.putAll(alreadyDeployedOverrides);
      for (      Object key : combined.keySet()) {
        Object newObj=combined.get(key);
        Object oldObj=alreadyDeployedCombined.get(key);
        if (!ObjectUtils.equals(newObj,oldObj)) {
          deploy=true;
          break;
        }
      }
      if (deploy) {
        log.info("String_Node_Str",flowResource.getName(),agent.getName());
        alreadyDeployed.stop();
      }
    }
    if (deploy) {
      log.info("String_Node_Str",flowResource.getName(),agent.getName());
      IResourceRuntime resource=resourceFactory.create(flowResource,overrideSettings);
      deployedResources.put(flowResource.getId(),resource);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected void deployResources(Flow flow){
  Set<Resource> flowResources=flow.findResources();
  for (  Resource flowResource : flowResources) {
    IResourceRuntime alreadyDeployed=deployedResources.get(flowResource.getId());
    Map<String,SettingDefinition> settings=resourceFactory.getSettingDefinitionsForResourceType(flowResource.getType());
    TypedProperties defaultSettings=flowResource.toTypedProperties(settings);
    TypedProperties overrideSettings=agent.toTypedProperties(flowResource);
    TypedProperties combined=new TypedProperties(defaultSettings);
    combined.putAll(overrideSettings);
    Set<Entry<Object,Object>> entries=combined.entrySet();
    for (    Entry<Object,Object> entry : entries) {
      String value=(String)entry.getValue();
      if (value != null) {
        value=FormatUtils.replaceTokens(value,(Map)System.getProperties(),true);
        entry.setValue(value);
      }
    }
    boolean deploy=true;
    if (alreadyDeployed != null) {
      deploy=false;
      Resource deployedResource=alreadyDeployed.getResource();
      TypedProperties alreadyDeployedOverrides=alreadyDeployed.getResourceRuntimeSettings();
      TypedProperties alreadyDeployedDefaultSettings=deployedResource.toTypedProperties(settings);
      TypedProperties alreadyDeployedCombined=new TypedProperties(alreadyDeployedDefaultSettings);
      alreadyDeployedCombined.putAll(alreadyDeployedOverrides);
      for (      Object key : combined.keySet()) {
        Object newObj=combined.get(key);
        Object oldObj=alreadyDeployedCombined.get(key);
        if (!ObjectUtils.equals(newObj,oldObj)) {
          deploy=true;
          break;
        }
      }
      if (deploy) {
        log.info("String_Node_Str",flowResource.getName(),agent.getName());
        alreadyDeployed.stop();
      }
    }
    if (deploy) {
      log.info("String_Node_Str",flowResource.getName(),agent.getName());
      IResourceRuntime resource=resourceFactory.create(flowResource,combined);
      deployedResources.put(flowResource.getId(),resource);
    }
  }
}