Program: 62358
Project: 62358
Buggy source:
public void createFileTree(String tree,String type,String imagesDir,String imageTarget,String width,String height){
  Objects.requireNonNull(imageTarget);
  if (!imageTarget.endsWith("String_Node_Str") && !"String_Node_Str".equalsIgnoreCase(type))   return;
  if ("String_Node_Str".equalsIgnoreCase(type)) {
    return;
  }
 else {
    Path path=current.currentPath().get().getParent();
    Path treePath=path.resolve(imageTarget);
    if (!current.currentPath().isPresent())     controller.saveDoc();
    Integer cacheHit=current.getCache().get(imageTarget);
    int hashCode=(imageTarget + imagesDir + type+ tree+ width+ height).hashCode();
    if (Objects.isNull(cacheHit) || hashCode != cacheHit) {
      logger.debug("String_Node_Str",imageTarget);
      TreeView<Tuple<Integer,String>> fileView=new TreeView<>();
      fileView.getStyleClass().add("String_Node_Str");
      fileView.setLayoutX(-99999);
      fileView.setLayoutY(-99999);
      try {
        List<String> strings=Arrays.asList(tree.split("String_Node_Str"));
        List<TreeItem<Tuple<Integer,String>>> treeItems=strings.stream().map(s -> {
          int level=StringUtils.countOccurrencesOf(s,"String_Node_Str");
          String value=s.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
          return new Tuple<Integer,String>(level,value);
        }
).map(t -> {
          Node icon=awesomeService.getIcon(Paths.get(t.getValue()));
          TreeItem<Tuple<Integer,String>> treeItem=new TreeItem<>(t,icon);
          treeItem.setExpanded(true);
          return treeItem;
        }
).collect(Collectors.toList());
        for (int index=0; index < treeItems.size(); index++) {
          TreeItem<Tuple<Integer,String>> currentItem=treeItems.get(index);
          Tuple<Integer,String> currentItemValue=currentItem.getValue();
          if (Objects.isNull(fileView.getRoot())) {
            fileView.setRoot(currentItem);
            continue;
          }
          TreeItem<Tuple<Integer,String>> lastItem=treeItems.get(index - 1);
          int lastPos=lastItem.getValue().getKey();
          if (currentItemValue.getKey() > lastPos) {
            lastItem.getChildren().add(currentItem);
            continue;
          }
          if (currentItemValue.getKey() == lastPos) {
            TreeItem<Tuple<Integer,String>> parent=lastItem.getParent();
            if (Objects.isNull(parent))             parent=fileView.getRoot();
            parent.getChildren().add(currentItem);
            continue;
          }
          if (currentItemValue.getKey() < lastPos) {
            List<TreeItem<Tuple<Integer,String>>> collect=treeItems.stream().filter(t -> t.getValue().getKey() == currentItemValue.getKey()).collect(Collectors.toList());
            if (collect.size() > 0) {
              TreeItem<Tuple<Integer,String>> parent=fileView.getRoot();
              try {
                TreeItem<Tuple<Integer,String>> treeItem=collect.get(collect.indexOf(currentItem) - 1);
                parent=treeItem.getParent();
              }
 catch (              RuntimeException e) {
                logger.info(e.getMessage(),e);
              }
              parent.getChildren().add(currentItem);
            }
            continue;
          }
        }
        fileView.setMaxHeight(2500);
        fileView.setPrefWidth(250);
        fileView.setPrefHeight(treeItems.size() * 24);
        try {
          Double value=Double.valueOf(width);
          if (width.contains("String_Node_Str") || width.contains("String_Node_Str"))           fileView.setPrefWidth(fileView.getPrefWidth() + value);
 else           fileView.setPrefWidth(value);
        }
 catch (        Exception e) {
        }
        try {
          Double value=Double.valueOf(height);
          if (height.contains("String_Node_Str") || height.contains("String_Node_Str"))           fileView.setPrefHeight(fileView.getPrefHeight() + value);
 else           fileView.setPrefHeight(value);
        }
 catch (        Exception e) {
        }
        threadService.runActionLater(() -> {
          controller.getRootAnchor().getChildren().add(fileView);
          WritableImage writableImage=fileView.snapshot(new SnapshotParameters(),null);
          BufferedImage bufferedImage=SwingFXUtils.fromFXImage(writableImage,null);
          IOHelper.createDirectories(path.resolve(imagesDir));
          IOHelper.imageWrite(bufferedImage,"String_Node_Str",treePath.toFile());
          logger.debug("String_Node_Str",imageTarget);
          controller.clearImageCache();
          controller.getRootAnchor().getChildren().remove(fileView);
        }
);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",e);
      }
    }
    current.getCache().put(imageTarget,hashCode);
  }
}

Fixed version (ground truth):
public void createFileTree(String tree,String type,String imagesDir,String imageTarget,String width,String height){
  Objects.requireNonNull(imageTarget);
  if (!imageTarget.endsWith("String_Node_Str") && !"String_Node_Str".equalsIgnoreCase(type))   return;
  if ("String_Node_Str".equalsIgnoreCase(type)) {
    return;
  }
 else {
    Path path=current.currentTab().getParentOrWorkdir();
    Path treePath=path.resolve(imageTarget);
    Integer cacheHit=current.getCache().get(imageTarget);
    int hashCode=(imageTarget + imagesDir + type+ tree+ width+ height).hashCode();
    if (Objects.isNull(cacheHit) || hashCode != cacheHit) {
      logger.debug("String_Node_Str",imageTarget);
      TreeView<Tuple<Integer,String>> fileView=new TreeView<>();
      fileView.getStyleClass().add("String_Node_Str");
      fileView.setLayoutX(-99999);
      fileView.setLayoutY(-99999);
      try {
        List<String> strings=Arrays.asList(tree.split("String_Node_Str"));
        List<TreeItem<Tuple<Integer,String>>> treeItems=strings.stream().map(s -> {
          int level=StringUtils.countOccurrencesOf(s,"String_Node_Str");
          String value=s.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
          return new Tuple<Integer,String>(level,value);
        }
).map(t -> {
          Node icon=awesomeService.getIcon(Paths.get(t.getValue()));
          TreeItem<Tuple<Integer,String>> treeItem=new TreeItem<>(t,icon);
          treeItem.setExpanded(true);
          return treeItem;
        }
).collect(Collectors.toList());
        for (int index=0; index < treeItems.size(); index++) {
          TreeItem<Tuple<Integer,String>> currentItem=treeItems.get(index);
          Tuple<Integer,String> currentItemValue=currentItem.getValue();
          if (Objects.isNull(fileView.getRoot())) {
            fileView.setRoot(currentItem);
            continue;
          }
          TreeItem<Tuple<Integer,String>> lastItem=treeItems.get(index - 1);
          int lastPos=lastItem.getValue().getKey();
          if (currentItemValue.getKey() > lastPos) {
            lastItem.getChildren().add(currentItem);
            continue;
          }
          if (currentItemValue.getKey() == lastPos) {
            TreeItem<Tuple<Integer,String>> parent=lastItem.getParent();
            if (Objects.isNull(parent))             parent=fileView.getRoot();
            parent.getChildren().add(currentItem);
            continue;
          }
          if (currentItemValue.getKey() < lastPos) {
            List<TreeItem<Tuple<Integer,String>>> collect=treeItems.stream().filter(t -> t.getValue().getKey() == currentItemValue.getKey()).collect(Collectors.toList());
            if (collect.size() > 0) {
              TreeItem<Tuple<Integer,String>> parent=fileView.getRoot();
              try {
                TreeItem<Tuple<Integer,String>> treeItem=collect.get(collect.indexOf(currentItem) - 1);
                parent=treeItem.getParent();
              }
 catch (              RuntimeException e) {
                logger.info(e.getMessage(),e);
              }
              parent.getChildren().add(currentItem);
            }
            continue;
          }
        }
        fileView.setMaxHeight(2500);
        fileView.setPrefWidth(250);
        fileView.setPrefHeight(treeItems.size() * 24);
        try {
          Double value=Double.valueOf(width);
          if (width.contains("String_Node_Str") || width.contains("String_Node_Str"))           fileView.setPrefWidth(fileView.getPrefWidth() + value);
 else           fileView.setPrefWidth(value);
        }
 catch (        Exception e) {
        }
        try {
          Double value=Double.valueOf(height);
          if (height.contains("String_Node_Str") || height.contains("String_Node_Str"))           fileView.setPrefHeight(fileView.getPrefHeight() + value);
 else           fileView.setPrefHeight(value);
        }
 catch (        Exception e) {
        }
        threadService.runActionLater(() -> {
          controller.getRootAnchor().getChildren().add(fileView);
          WritableImage writableImage=fileView.snapshot(new SnapshotParameters(),null);
          BufferedImage bufferedImage=SwingFXUtils.fromFXImage(writableImage,null);
          IOHelper.createDirectories(path.resolve(imagesDir));
          IOHelper.imageWrite(bufferedImage,"String_Node_Str",treePath.toFile());
          logger.debug("String_Node_Str",imageTarget);
          controller.clearImageCache();
          controller.getRootAnchor().getChildren().remove(fileView);
        }
);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",e);
      }
    }
    current.getCache().put(imageTarget,hashCode);
  }
}