Skip to content

Commit b5c4860

Browse files
author
taylor.smock
committed
fix #21797: IOOBE in ImageryProvidersPanel$ImageryDefaultLayerTableModel.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
1 parent 81788c9 commit b5c4860

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/org/openstreetmap/josm/gui/preferences/imagery/ImageryProvidersPanel.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,12 @@ private class ReloadAction extends AbstractAction {
601601
@Override
602602
public void actionPerformed(ActionEvent evt) {
603603
layerInfo.loadDefaults(true, MainApplication.worker, false);
604+
this.updateTableArea();
605+
// Ensure that the table is updated properly if someone cancels the download. See JOSM #21797.
606+
MainApplication.worker.execute(() -> GuiHelper.runInEDTAndWait(this::updateTableArea));
607+
}
608+
609+
private void updateTableArea() {
604610
defaultModel.fireTableDataChanged();
605611
defaultTable.getSelectionModel().clearSelection();
606612
defaultTableListener.clearMap();

0 commit comments

Comments
 (0)