Program: 62428
Project: 62428
Buggy source:
public String plantUml(String uml,String type,String fileName) throws IOException {
  Objects.requireNonNull(fileName);
  if (!fileName.endsWith("String_Node_Str") && !"String_Node_Str".equalsIgnoreCase(type))   return "String_Node_Str";
  String defaultScale="String_Node_Str";
  if (!uml.contains("String_Node_Str") && !uml.contains("String_Node_Str")) {
    uml=defaultScale + uml;
    uml="String_Node_Str" + uml + "String_Node_Str";
  }
 else {
    uml=uml.replaceFirst("String_Node_Str","String_Node_Str" + defaultScale);
  }
  SourceStringReader reader=new SourceStringReader(uml);
  try (ByteArrayOutputStream os=new ByteArrayOutputStream()){
    if ("String_Node_Str".equalsIgnoreCase(type)) {
      String desc=reader.generateImage(os,new FileFormatOption(FileFormat.ATXT));
      return os.toString("String_Node_Str");
    }
 else {
      if (!current.currentPath().isPresent())       controller.saveDoc();
      Path path=current.currentPath().get().getParent();
      Path umlPath=path.resolve("String_Node_Str").resolve(fileName);
      Integer cacheHit=current.getCache().get(fileName);
      int hashCode=(fileName + type + uml).hashCode();
      if (Objects.isNull(cacheHit) || hashCode != cacheHit) {
        threadService.runTaskLater(task -> {
          try {
            String desc=reader.generateImage(os,new FileFormatOption(FileFormat.PNG));
            Files.createDirectories(path.resolve("String_Node_Str"));
            IOHelper.writeToFile(umlPath,os.toByteArray(),CREATE,WRITE,TRUNCATE_EXISTING);
            controller.getLastRenderedChangeListener().changed(null,controller.getLastRendered().getValue(),controller.getLastRendered().getValue());
          }
 catch (          Exception e) {
            logger.error(e.getMessage(),e);
          }
        }
);
      }
      current.getCache().put(fileName,hashCode);
      String umlRelativePath=Paths.get("String_Node_Str") + "String_Node_Str" + umlPath.getFileName();
      return umlRelativePath;
    }
  }
 }

Fixed version (ground truth):
public void plantUml(String uml,String type,String fileName){
  Objects.requireNonNull(fileName);
  if (!fileName.endsWith("String_Node_Str") && !"String_Node_Str".equalsIgnoreCase(type))   return;
  String defaultScale="String_Node_Str";
  if (!uml.contains("String_Node_Str") && !uml.contains("String_Node_Str")) {
    uml=defaultScale + uml;
    uml="String_Node_Str" + uml + "String_Node_Str";
  }
 else {
    uml=uml.replaceFirst("String_Node_Str","String_Node_Str" + defaultScale);
  }
  SourceStringReader reader=new SourceStringReader(uml);
  try (ByteArrayOutputStream os=new ByteArrayOutputStream()){
    if ("String_Node_Str".equalsIgnoreCase(type)) {
      String desc=reader.generateImage(os,new FileFormatOption(FileFormat.ATXT));
      return;
    }
 else {
      if (!current.currentPath().isPresent())       controller.saveDoc();
      Path path=current.currentPath().get().getParent();
      Path umlPath=path.resolve("String_Node_Str").resolve(fileName);
      Integer cacheHit=current.getCache().get(fileName);
      int hashCode=(fileName + type + uml).hashCode();
      if (Objects.isNull(cacheHit) || hashCode != cacheHit) {
        threadService.runTaskLater(task -> {
          try {
            String desc=reader.generateImage(os,new FileFormatOption(FileFormat.PNG));
            Files.createDirectories(path.resolve("String_Node_Str"));
            IOHelper.writeToFile(umlPath,os.toByteArray(),CREATE,WRITE,TRUNCATE_EXISTING);
            controller.getLastRenderedChangeListener().changed(null,controller.getLastRendered().getValue(),controller.getLastRendered().getValue());
          }
 catch (          Exception e) {
            logger.error(e.getMessage(),e);
          }
        }
);
      }
      current.getCache().put(fileName,hashCode);
    }
  }
 catch (  IOException e) {
    logger.info(e.getMessage(),e);
  }
}