Ignore:
Timestamp:
2021-11-06T10:09:02+01:00 (3 years ago)
Author:
GerdP
Message:

see #21515: NoSuchMethodError: 'void org.openstreetmap.josm.gui.widgets.HistoryComboBox.setPossibleItems(java.util.Collection)'

  • update code to recent changes in core, bump version
  • also seems to fix #18897
File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java

    r35682 r35856  
    1919import java.util.Collection;
    2020import java.util.Collections;
    21 import java.util.LinkedList;
    2221import java.util.List;
    2322
     
    143142
    144143    private void loadHistory() {
    145         List<String> cmtHistory = new LinkedList<>(
    146                 Config.getPref().getList(HISTORY_KEY, Arrays.asList(defaultHistory)));
    147         Collections.reverse(cmtHistory);
    148         cbTagSet.setPossibleItems(cmtHistory);
    149         String s = cmtHistory.get(cmtHistory.size()-1);
     144        cbTagSet.getModel().prefs().load(HISTORY_KEY, Arrays.asList(defaultHistory));
     145        String s = cbTagSet.getModel().getElementAt(0);
    150146        cbTagSet.setText(s);
    151147        specifyTagSet(s);
     
    283279            String txt = cbTagSet.getText();
    284280            Logging.debug(txt);
    285             List<String> history = cbTagSet.getHistory();
     281            List<String> history = cbTagSet.getModel().asStringList();
    286282            history.remove(txt);
    287283            if (history.isEmpty()) {
     
    321317            oldTags = s;
    322318            cbTagSet.addCurrentItemToHistory();
    323             Config.getPref().putList(HISTORY_KEY, cbTagSet.getHistory());
     319            cbTagSet.getModel().prefs().save(HISTORY_KEY);
    324320            specifyTagSet(s);
    325321        }
Note: See TracChangeset for help on using the changeset viewer.