Program: 167462
Project: 167462
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.getAgentOverrides();
      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):
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);
    }
  }
}