Program: 170773
Project: 170773
Buggy source:
@Override public void tableStructureChanged(boolean columnAddedOrRemoved,Class forPluginDataSourceType){
  if (forPluginDataSourceType != null && !forPluginDataSourceType.equals(getDataSourceType())) {
    return;
  }
  triggerLifeCycleListener(TableLifeCycleListener.EVENT_TABLELIFECYCLE_DESTROYED);
  DATASOURCETYPE[] unfilteredDS;
synchronized (rows_sync) {
    unfilteredDS=(DATASOURCETYPE[])listUnfilteredDataSources.keySet().toArray();
  }
  if (DEBUGADDREMOVE) {
    debug("String_Node_Str" + unfilteredDS.length);
  }
  removeAllTableRows();
  processDataSourceQueueSync();
  if (columnAddedOrRemoved) {
    tableColumns=TableColumnManager.getInstance().getAllTableColumnCoreAsArray(getDataSourceType(),tableID);
    ArrayList<TableColumnCore> listVisibleColumns=new ArrayList<>();
    for (    TableColumnCore column : tableColumns) {
      if (column.isVisible()) {
        listVisibleColumns.add(column);
      }
    }
    Collections.sort(listVisibleColumns,new Comparator<TableColumnCore>(){
      @Override public int compare(      TableColumnCore o1,      TableColumnCore o2){
        if (o1 == o2) {
          return 0;
        }
        int diff=o1.getPosition() - o2.getPosition();
        return diff;
      }
    }
);
    columnsOrdered=listVisibleColumns.toArray(new TableColumnCore[0]);
  }
  refreshTable(false);
  triggerLifeCycleListener(TableLifeCycleListener.EVENT_TABLELIFECYCLE_INITIALIZED);
  if (listUnfilteredDataSources.size() == 0) {
    addDataSources(unfilteredDS);
  }
}

Fixed version (ground truth):
@Override public void tableStructureChanged(boolean columnAddedOrRemoved,Class forPluginDataSourceType){
  if (forPluginDataSourceType != null && !forPluginDataSourceType.equals(getDataSourceType())) {
    return;
  }
  triggerLifeCycleListener(TableLifeCycleListener.EVENT_TABLELIFECYCLE_DESTROYED);
  DATASOURCETYPE[] unfilteredDS;
synchronized (rows_sync) {
    unfilteredDS=(DATASOURCETYPE[])listUnfilteredDataSources.keySet().toArray();
  }
  if (DEBUGADDREMOVE) {
    debug("String_Node_Str" + unfilteredDS.length);
  }
  removeAllTableRows();
  processDataSourceQueueSync();
  boolean orderChanged=false;
  if (columnsOrdered.length > 1 && !columnAddedOrRemoved) {
    for (int i=0; i < columnsOrdered.length - 2; i++) {
      if (columnsOrdered[i].getPosition() > columnsOrdered[i + 1].getPosition()) {
        orderChanged=true;
        break;
      }
    }
  }
  if (columnAddedOrRemoved || orderChanged) {
    tableColumns=TableColumnManager.getInstance().getAllTableColumnCoreAsArray(getDataSourceType(),tableID);
    ArrayList<TableColumnCore> listVisibleColumns=new ArrayList<>();
    for (    TableColumnCore column : tableColumns) {
      if (column.isVisible()) {
        listVisibleColumns.add(column);
      }
    }
    Collections.sort(listVisibleColumns,new Comparator<TableColumnCore>(){
      @Override public int compare(      TableColumnCore o1,      TableColumnCore o2){
        if (o1 == o2) {
          return 0;
        }
        int diff=o1.getPosition() - o2.getPosition();
        return diff;
      }
    }
);
    columnsOrdered=listVisibleColumns.toArray(new TableColumnCore[0]);
  }
  refreshTable(false);
  triggerLifeCycleListener(TableLifeCycleListener.EVENT_TABLELIFECYCLE_INITIALIZED);
  if (listUnfilteredDataSources.size() == 0) {
    addDataSources(unfilteredDS);
  }
}