Program: 36595
Project: 36595
Buggy source:
public PlaylistTable(Playlist playlist){
  super(NAME,playlist);
  playlist.setTransformation(getItems());
  VBox.setVgrow(this,Priority.ALWAYS);
  setFixedCellSize(GUI.font.getValue().getSize() + 5);
  getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
  setColumnStateFacory(f -> {
    boolean visible=f == NAME || f == LENGTH;
    return new ColumnInfo(f.toString(),f.ordinal(),visible,60);
  }
);
  setColumnFactory(f -> {
    TableColumn<PlaylistItem,?> c=new TableColumn(f.toString());
    c.setCellValueFactory(f == NAME || f == LENGTH ? new PropertyValueFactory(f.name().toLowerCase()) : cf -> cf.getValue() == null ? null : new PojoV(cf.getValue().getField(f)));
    c.setCellFactory((Callback)col -> buildDefaultCell(f));
    c.setResizable(true);
    return c;
  }
);
  setColumnState(getDefaultColumnInfo());
  columnName=(TableColumn)getColumn(NAME).get();
  columnTime=(TableColumn)getColumn(LENGTH).get();
  setRowFactory(t -> new ImprovedTableRow<PlaylistItem>(){
{
      setOnMousePressed(e -> last=e.getScreenY());
      setOnMouseReleased(e -> {
        if (getItem() == null)         selectNone();
      }
);
      onLeftDoubleClick((r,e) -> getPlaylist().playItem(r.getItem()));
      onRightSingleClick((r,e) -> {
        if (!isSelected())         getSelectionModel().clearAndSelect(getIndex());
        contxt_menu.show(PlaylistTable.this,e);
      }
);
      setOnDragDropped(e -> dropDrag(e,isEmpty() ? getItems().size() : getIndex()));
      styleRuleAdd("String_Node_Str",p -> getPlaylist().isItemPlaying(p));
      styleRuleAdd("String_Node_Str",PlaylistItem::isCorruptCached);
    }
  }
);
  d1=Player.playingtem.onChange(o -> refreshColumn(columnIndex));
  setColumnResizePolicy(resize -> {
    if (resize != null && resize.getColumn() != null && resize.getColumn() != columnIndex) {
      if (getColumns().contains(columnName))       columnName.setPrefWidth(columnName.getWidth() - resize.getDelta());
      resize.getColumn().setPrefWidth(resize.getColumn().getWidth() + resize.getDelta());
    }
    double W=resize.getTable().getWidth();
    double W1=calculateIndexColumnWidth();
    double mt=getItems().stream().mapToDouble(PlaylistItem::getTimeMs).max().orElse(6000);
    Text t2=new Text(new FormattedDuration(mt).toString());
    t2.setFont(GUI.font.getValue());
    double W3=t2.getLayoutBounds().getWidth() + 5;
    double H=getItems().size() * getFixedCellSize();
    double S=H > getHeight() - getTableHeaderHeight() ? 15 : 0;
    double G=3;
    columnIndex.setPrefWidth(W1);
    columnTime.setPrefWidth(W3);
    List<TableColumn> cs=new ArrayList(resize.getTable().getColumns());
    TableColumn mc=isColumnVisible(NAME) ? columnName : getColumn(TITLE).orElse(null);
    if (mc != null) {
      cs.remove(mc);
      double W4=cs.stream().mapToDouble(c -> c.getWidth()).sum();
      mc.setPrefWidth(W - W4 - S- G);
    }
    return true;
  }
);
  addEventFilter(MOUSE_PRESSED,consumeOnSecondaryButton);
  addEventHandler(MOUSE_CLICKED,e -> {
    if (headerVisible.get() && e.getY() < getTableHeaderHeight())     return;
    if (e.getButton() == PRIMARY && e.getClickCount() == 1 && getItems().isEmpty())     getPlaylist().addOrEnqueueFiles(true);
  }
);
  setOnMouseDragged(e -> {
    if (e.getButton() != MouseButton.PRIMARY || !e.isControlDown())     return;
    double h=getFixedCellSize();
    double dist=e.getScreenY() - last;
    int by=(int)(dist / h);
    if (by >= 1 || by <= -1) {
      last=e.getScreenY();
      moveSelectedItems(by);
    }
  }
);
  setOnKeyReleased(e -> {
    if (e.getCode() == KeyCode.ENTER) {
      if (!getSelectedItems().isEmpty())       getPlaylist().playItem(getSelectedItems().get(0));
    }
 else     if (e.getCode() == KeyCode.DELETE) {
      List<PlaylistItem> p=getSelectedItemsCopy();
      getSelectionModel().clearSelection();
      getPlaylist().removeAll(p);
    }
 else     if (e.getCode() == KeyCode.ESCAPE) {
      getSelectionModel().clearSelection();
    }
  }
);
  setOnKeyPressed(e -> {
    if (e.isControlDown()) {
      if (e.getCode() == KeyCode.UP) {
        moveSelectedItems(-1);
      }
 else       if (e.getCode() == KeyCode.DOWN) {
        moveSelectedItems(1);
      }
    }
  }
);
  setOnDragDetected(e -> {
    if (e.getButton() == PRIMARY && !e.isControlDown() && !getSelectedItems().isEmpty() && isRowFull(getRowS(e.getSceneX(),e.getSceneY()))) {
      Dragboard db=startDragAndDrop(TransferMode.COPY);
      DragUtil.setItemList(getSelectedItemsCopy(),db,true);
    }
    e.consume();
  }
);
  setOnDragOver_NoSelf(DragUtil.audioDragAccepthandler);
  setOnDragDropped(e -> dropDrag(e,0));
  getSelectionModel().selectedItemProperty().addListener(selItemListener);
  getSelectionModel().getSelectedItems().addListener(selItemsListener);
  setPlaceholder(new Label("String_Node_Str"));
}

Fixed version (ground truth):
public PlaylistTable(Playlist playlist){
  super(NAME,playlist);
  playlist.setTransformation(getItems());
  VBox.setVgrow(this,Priority.ALWAYS);
  setFixedCellSize(GUI.font.getValue().getSize() + 5);
  getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
  setColumnStateFacory(f -> {
    boolean visible=f == NAME || f == LENGTH;
    return new ColumnInfo(f.toString(),f.ordinal(),visible,60);
  }
);
  setColumnFactory(f -> {
    TableColumn<PlaylistItem,?> c=new TableColumn(f.toString());
    c.setCellValueFactory(f == NAME || f == LENGTH ? new PropertyValueFactory(f.name().toLowerCase()) : cf -> cf.getValue() == null ? null : new PojoV(cf.getValue().getField(f)));
    c.setCellFactory((Callback)col -> buildDefaultCell(f));
    c.setResizable(true);
    return c;
  }
);
  setColumnState(getDefaultColumnInfo());
  columnName=(TableColumn)getColumn(NAME).get();
  columnTime=(TableColumn)getColumn(LENGTH).get();
  setRowFactory(t -> new ImprovedTableRow<PlaylistItem>(){
{
      setOnMousePressed(e -> last=e.getScreenY());
      setOnMouseReleased(e -> {
        if (getItem() == null)         selectNone();
      }
);
      onLeftDoubleClick((r,e) -> getPlaylist().playItem(r.getItem()));
      onRightSingleClick((r,e) -> {
        if (!isSelected())         getSelectionModel().clearAndSelect(getIndex());
        contxt_menu.show(PlaylistTable.this,e);
      }
);
      setOnDragDropped(e -> dropDrag(e,isEmpty() ? getItems().size() : getIndex()));
      styleRuleAdd("String_Node_Str",p -> getPlaylist().isItemPlaying(p));
      styleRuleAdd("String_Node_Str",PlaylistItem::isCorruptCached);
    }
  }
);
  d1=Player.playingtem.onChange(o -> refreshColumn(columnIndex));
  setColumnResizePolicy(resize -> {
    if (resize != null && resize.getColumn() != null && resize.getColumn() != columnIndex) {
      if (getColumns().contains(columnName))       columnName.setPrefWidth(columnName.getWidth() - resize.getDelta());
      resize.getColumn().setPrefWidth(resize.getColumn().getWidth() + resize.getDelta());
    }
    double tw=resize.getTable().getWidth();
    double sw=getVScrollbarWidth();
    double g=3;
    double W1=calculateIndexColumnWidth();
    double mt=getItems().stream().mapToDouble(PlaylistItem::getTimeMs).max().orElse(6000);
    Text t2=new Text(new FormattedDuration(mt).toString());
    t2.setFont(GUI.font.getValue());
    double W3=t2.getLayoutBounds().getWidth() + 5;
    columnIndex.setPrefWidth(W1);
    columnTime.setPrefWidth(W3);
    List<TableColumn> cs=new ArrayList(resize.getTable().getColumns());
    TableColumn mc=isColumnVisible(NAME) ? columnName : getColumn(TITLE).orElse(null);
    if (mc != null) {
      cs.remove(mc);
      double Σcw=cs.stream().mapToDouble(c -> c.getWidth()).sum();
      mc.setPrefWidth(tw - Σcw - sw- g);
    }
    return true;
  }
);
  addEventFilter(MOUSE_PRESSED,consumeOnSecondaryButton);
  addEventHandler(MOUSE_CLICKED,e -> {
    if (headerVisible.get() && e.getY() < getTableHeaderHeight())     return;
    if (e.getButton() == PRIMARY && e.getClickCount() == 1 && getItems().isEmpty())     getPlaylist().addOrEnqueueFiles(true);
  }
);
  setOnMouseDragged(e -> {
    if (e.getButton() != MouseButton.PRIMARY || !e.isControlDown())     return;
    if (getItems().size() != getItemsRaw().size())     return;
    if (itemsComparator.get() != SAME || !getSortOrder().isEmpty()) {
      movingitems=true;
      List l=list(getItems());
      List sl=list(getSelectionModel().getSelectedIndices());
      setItemsRaw(EMPTY_LIST);
      getSortOrder().clear();
      setItemsRaw(l);
      selectRows(sl,getSelectionModel());
      movingitems=false;
    }
    double h=getFixedCellSize();
    double dist=e.getScreenY() - last;
    int by=(int)(dist / h);
    if (by >= 1 || by <= -1) {
      last=e.getScreenY();
      moveSelectedItems(by);
    }
  }
);
  setOnKeyReleased(e -> {
    if (e.getCode() == KeyCode.ENTER) {
      if (!getSelectedItems().isEmpty())       getPlaylist().playItem(getSelectedItems().get(0));
    }
 else     if (e.getCode() == KeyCode.DELETE) {
      List<PlaylistItem> p=getSelectedItemsCopy();
      getSelectionModel().clearSelection();
      getPlaylist().removeAll(p);
    }
 else     if (e.getCode() == KeyCode.ESCAPE) {
      getSelectionModel().clearSelection();
    }
  }
);
  setOnKeyPressed(e -> {
    if (e.isControlDown()) {
      if (e.getCode() == KeyCode.UP) {
        moveSelectedItems(-1);
      }
 else       if (e.getCode() == KeyCode.DOWN) {
        moveSelectedItems(1);
      }
    }
  }
);
  setOnDragDetected(e -> {
    if (e.getButton() == PRIMARY && !e.isControlDown() && !getSelectedItems().isEmpty() && isRowFull(getRowS(e.getSceneX(),e.getSceneY()))) {
      Dragboard db=startDragAndDrop(TransferMode.COPY);
      DragUtil.setItemList(getSelectedItemsCopy(),db,true);
    }
    e.consume();
  }
);
  setOnDragOver_NoSelf(DragUtil.audioDragAccepthandler);
  setOnDragDropped(e -> dropDrag(e,0));
  getSelectionModel().selectedItemProperty().addListener(selItemListener);
  getSelectionModel().getSelectedItems().addListener(selItemsListener);
  setPlaceholder(new Label("String_Node_Str"));
}