Ignore:
Timestamp:
2017-08-22T19:41:55+02:00 (7 years ago)
Author:
Don-vip
Message:

initialize unit tests for TagEditHelper

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r12549 r12619  
    108108    private String objKey;
    109109
    110     private final Comparator<AutoCompletionListItem> defaultACItemComparator =
     110    static final Comparator<AutoCompletionListItem> DEFAULT_AC_ITEM_COMPARATOR =
    111111            (o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getValue(), o2.getValue());
    112112
     
    204204     */
    205205    @SuppressWarnings("unchecked")
    206     private boolean containsDataKey(String key) {
     206    boolean containsDataKey(String key) {
    207207        return IntStream.range(0, tagData.getRowCount())
    208208                .anyMatch(i -> key.equals(tagData.getValueAt(i, 0)) /* sic! do not use getDataKey*/
     
    444444            AutoCompletionManager autocomplete = Main.getLayerManager().getEditLayer().data.getAutoCompletionManager();
    445445            List<AutoCompletionListItem> keyList = autocomplete.getKeys();
    446             keyList.sort(defaultACItemComparator);
     446            keyList.sort(DEFAULT_AC_ITEM_COMPARATOR);
    447447
    448448            keys = new AutoCompletingComboBox(key);
     
    696696            keyList.removeIf(item -> containsDataKey(item.getValue()));
    697697
    698             keyList.sort(defaultACItemComparator);
     698            keyList.sort(DEFAULT_AC_ITEM_COMPARATOR);
    699699            keys.setPossibleACItems(keyList);
    700700            keys.setEditable(true);
     
    715715                    });
    716716
    717             focus = addFocusAdapter(autocomplete, defaultACItemComparator);
     717            focus = addFocusAdapter(autocomplete, DEFAULT_AC_ITEM_COMPARATOR);
    718718            // fire focus event in advance or otherwise the popup list will be too small at first
    719719            focus.focusGained(null);
Note: See TracChangeset for help on using the changeset viewer.