Ignore:
Timestamp:
2022-01-27T23:43:27+01:00 (2 years ago)
Author:
taylor.smock
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryProvidersPanel.java

    r18211 r18367  
    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();
Note: See TracChangeset for help on using the changeset viewer.