Program: 151530
Project: 151530
Buggy source:
@Override public boolean deploy(final AddonId addon,final List<AddonDependencyEntry> dependencies,final List<File> resources){
  return lock.performLocked(LockMode.WRITE,new Callable<Boolean>(){
    @SuppressWarnings("String_Node_Str") @Override public Boolean call() throws Exception {
      File addonSlotDir=getAddonBaseDir(addon);
      File descriptor=getAddonDescriptor(addon);
      try {
        if (resources != null && !resources.isEmpty()) {
          for (          File resource : resources) {
            if (resource.isDirectory()) {
              String child=addon.getName() + resource.getParentFile().getParentFile().getName();
              child=OperatingSystemUtils.getSafeFilename(child);
              Files.copyDirectory(resource,new File(addonSlotDir,child));
            }
 else {
              Files.copyFileToDirectory(resource,addonSlotDir);
            }
          }
        }
        Node addonXml=getXmlRoot(descriptor);
        Node dependenciesNode=addonXml.getOrCreate("String_Node_Str");
        for (        AddonDependencyEntry dependency : dependencies) {
          Node dep=dependenciesNode.createChild("String_Node_Str");
          dep.attribute(ATTR_NAME,dependency.getId().getName());
          dep.attribute(ATTR_VERSION,dependency.getId().getVersion());
          dep.attribute(ATTR_EXPORT,dependency.isExported());
          dep.attribute(ATTR_OPTIONAL,dependency.isOptional());
        }
        FileOutputStream fos=null;
        try {
          fos=new FileOutputStream(descriptor);
          Streams.write(XMLParser.toXMLInputStream(addonXml),fos);
        }
  finally {
          Streams.closeQuietly(fos);
        }
        return true;
      }
 catch (      IOException io) {
        io.printStackTrace();
        return false;
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public boolean deploy(final AddonId addon,final List<AddonDependencyEntry> dependencies,final List<File> resources){
  return lock.performLocked(LockMode.WRITE,new Callable<Boolean>(){
    @SuppressWarnings("String_Node_Str") @Override public Boolean call() throws Exception {
      File addonSlotDir=getAddonBaseDir(addon);
      File descriptor=getAddonDescriptor(addon);
      try {
        if (resources != null && !resources.isEmpty()) {
          for (          File resource : resources) {
            if (resource.isDirectory()) {
              String child=addon.getName() + resource.getParentFile().getParentFile().getName();
              child=OperatingSystemUtils.getSafeFilename(child);
              Files.copyDirectory(resource,new File(addonSlotDir,child));
            }
 else {
              Files.copyFileToDirectory(resource,addonSlotDir);
            }
          }
        }
        Node addonXml=getXmlRoot(descriptor);
        Node dependenciesNode=addonXml.getOrCreate(DEPENDENCIES_TAG_NAME);
        for (        AddonDependencyEntry dependency : dependencies) {
          String name=dependency.getId().getName();
          Node dep=null;
          for (          Node node : dependenciesNode.get(DEPENDENCY_TAG_NAME)) {
            if (name.equals(node.getAttribute(ATTR_NAME))) {
              dep=node;
              break;
            }
          }
          if (dep == null) {
            dep=dependenciesNode.createChild(DEPENDENCY_TAG_NAME);
            dep.attribute(ATTR_NAME,name);
          }
          dep.attribute(ATTR_VERSION,dependency.getId().getVersion());
          dep.attribute(ATTR_EXPORT,dependency.isExported());
          dep.attribute(ATTR_OPTIONAL,dependency.isOptional());
        }
        FileOutputStream fos=null;
        try {
          fos=new FileOutputStream(descriptor);
          Streams.write(XMLParser.toXMLInputStream(addonXml),fos);
        }
  finally {
          Streams.closeQuietly(fos);
        }
        return true;
      }
 catch (      IOException io) {
        io.printStackTrace();
        return false;
      }
    }
  }
);
}