Skip to content

Commit

Permalink
fix #21797: IOOBE in ImageryProvidersPanel$ImageryDefaultLayerTableMo…
Browse files Browse the repository at this point in the history
…del.getValueAt

This was caused by a race condition in newer JVM's when the cancel button is
pressed. This splits out the code forcing a refresh of the tables into its own
method, and calls that method in the worker thread after we finish
redownloading the imagery list.


git-svn-id: https://josm.openstreetmap.de/svn/trunk@18367 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
taylor.smock committed Jan 27, 2022
1 parent 81788c9 commit b5c4860
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,12 @@ private class ReloadAction extends AbstractAction {
@Override
public void actionPerformed(ActionEvent evt) {
layerInfo.loadDefaults(true, MainApplication.worker, false);
this.updateTableArea();
// Ensure that the table is updated properly if someone cancels the download. See JOSM #21797.
MainApplication.worker.execute(() -> GuiHelper.runInEDTAndWait(this::updateTableArea));
}

private void updateTableArea() {
defaultModel.fireTableDataChanged();
defaultTable.getSelectionModel().clearSelection();
defaultTableListener.clearMap();
Expand Down

0 comments on commit b5c4860

Please sign in to comment.