Program: 62359
Project: 62359
Buggy source:
public void createHighlightFileTree(String tree,String type,String imagesDir,String imageTarget,String width,String height){
  Objects.requireNonNull(imageTarget);
  if (!imageTarget.endsWith("String_Node_Str"))   return;
  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) {
    threadService.runActionLater(() -> {
      WebView treeview=new WebView();
      treeview.setMaxHeight(5000);
      treeview.setMaxWidth(5000);
      treeview.setPrefWidth(5000);
      treeview.setPrefHeight(5000);
      treeview.setLayoutX(-89999);
      treeview.setLayoutY(-89999);
      try {
        Double value=Double.valueOf(width);
        if (width.contains("String_Node_Str") || width.contains("String_Node_Str"))         treeview.setPrefWidth(treeview.getPrefWidth() + value);
 else         treeview.setPrefWidth(value);
      }
 catch (      Exception e) {
      }
      try {
        Double value=Double.valueOf(height);
        if (height.contains("String_Node_Str") || height.contains("String_Node_Str"))         treeview.setPrefHeight(treeview.getPrefHeight() + value);
 else         treeview.setPrefHeight(value);
      }
 catch (      Exception e) {
      }
      threadService.runActionLater(() -> {
        treeview.getEngine().load(String.format(treeviewUrl,controller.getPort()));
      }
);
      controller.getRootAnchor().getChildren().add(treeview);
      treeview.getEngine().setOnAlert(event -> {
        String data=event.getData();
        if ("String_Node_Str".equals(data)) {
          ((JSObject)treeview.getEngine().executeScript("String_Node_Str")).call("String_Node_Str",tree);
        }
        if ("String_Node_Str".equals(data)) {
          WritableImage writableImage=treeview.snapshot(new SnapshotParameters(),null);
          BufferedImage bufferedImage=SwingFXUtils.fromFXImage(writableImage,null);
          threadService.runTaskLater(() -> {
            TrimWhite trimWhite=new TrimWhite();
            BufferedImage trimmed=trimWhite.trim(bufferedImage);
            IOHelper.createDirectories(path.resolve(imagesDir));
            IOHelper.imageWrite(trimmed,"String_Node_Str",treePath.toFile());
            threadService.runActionLater(() -> {
              controller.clearImageCache();
              controller.getRootAnchor().getChildren().remove(treeview);
            }
);
          }
);
        }
      }
);
    }
);
  }
  current.getCache().put(imageTarget,hashCode);
}

Fixed version (ground truth):
public void createHighlightFileTree(String tree,String type,String imagesDir,String imageTarget,String width,String height){
  Objects.requireNonNull(imageTarget);
  if (!imageTarget.endsWith("String_Node_Str"))   return;
  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) {
    threadService.runActionLater(() -> {
      WebView treeview=new WebView();
      treeview.setMaxHeight(5000);
      treeview.setMaxWidth(5000);
      treeview.setPrefWidth(5000);
      treeview.setPrefHeight(5000);
      treeview.setLayoutX(-89999);
      treeview.setLayoutY(-89999);
      try {
        Double value=Double.valueOf(width);
        if (width.contains("String_Node_Str") || width.contains("String_Node_Str"))         treeview.setPrefWidth(treeview.getPrefWidth() + value);
 else         treeview.setPrefWidth(value);
      }
 catch (      Exception e) {
      }
      try {
        Double value=Double.valueOf(height);
        if (height.contains("String_Node_Str") || height.contains("String_Node_Str"))         treeview.setPrefHeight(treeview.getPrefHeight() + value);
 else         treeview.setPrefHeight(value);
      }
 catch (      Exception e) {
      }
      threadService.runActionLater(() -> {
        treeview.getEngine().load(String.format(treeviewUrl,controller.getPort()));
      }
);
      controller.getRootAnchor().getChildren().add(treeview);
      treeview.getEngine().setOnAlert(event -> {
        String data=event.getData();
        if ("String_Node_Str".equals(data)) {
          ((JSObject)treeview.getEngine().executeScript("String_Node_Str")).call("String_Node_Str",tree);
        }
        if ("String_Node_Str".equals(data)) {
          WritableImage writableImage=treeview.snapshot(new SnapshotParameters(),null);
          BufferedImage bufferedImage=SwingFXUtils.fromFXImage(writableImage,null);
          threadService.runTaskLater(() -> {
            TrimWhite trimWhite=new TrimWhite();
            BufferedImage trimmed=trimWhite.trim(bufferedImage);
            IOHelper.createDirectories(path.resolve(imagesDir));
            IOHelper.imageWrite(trimmed,"String_Node_Str",treePath.toFile());
            threadService.runActionLater(() -> {
              controller.clearImageCache();
              controller.getRootAnchor().getChildren().remove(treeview);
            }
);
          }
);
        }
      }
);
    }
);
  }
  current.getCache().put(imageTarget,hashCode);
}