Changeset 18305 in josm for trunk


Ignore:
Timestamp:
2021-11-03T01:01:03+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #21505 - fix most of javadoc warnings, remove deprecated code

Location:
trunk/src/org/openstreetmap/josm
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/vector/DataStore.java

    r18193 r18305  
    6767    /**
    6868     * Get the primitives map.
    69      * @implNote The returned map is a {@link Collections#synchronizedMap}. Please synchronize on it.
     69     * The returned map is a {@link Collections#synchronizedMap}. Please synchronize on it.
    7070     * @return The Primitives map.
    7171     */
     
    9090     * @param primitive The primitive to remove
    9191     */
    92     @SuppressWarnings("squid:S2445")
    9392    protected void removePrimitive(O primitive) {
    9493        if (primitive == null) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompComboBox.java

    r18221 r18305  
    33
    44import java.awt.im.InputContext;
    5 import java.util.Collection;
    6 import java.util.Collections;
    7 import java.util.LinkedList;
    85import java.util.Locale;
    96
     
    9996
    10097    /**
    101      * Sets the items of the combobox to the given {@code String}s in reversed order (last element
    102      * first).
    103      *
    104      * @param elems The string items to set
    105      * @deprecated Has been moved to the model, where it belongs. Use
    106      *     {@link org.openstreetmap.josm.gui.widgets.HistoryComboBoxModel#addAllStrings} instead. Probably you want to use
    107      *     {@link org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel.Preferences#load} and
    108      *     {@link org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel.Preferences#save}.
    109      */
    110     @Deprecated
    111     public void setPossibleItems(Collection<E> elems) {
    112         // We have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    113         LinkedList<E> reversed = new LinkedList<>(elems);
    114         Collections.reverse(reversed);
    115         setPossibleAcItems(reversed);
    116     }
    117 
    118     /**
    119      * Sets the items of the combobox to the given {@code String}s in top down order.
    120      *
    121      * @param elems The strings to set.
    122      * @since 15011
    123      * @deprecated Has been moved to the model, where it belongs. Use
    124      *     {@link org.openstreetmap.josm.gui.widgets.HistoryComboBoxModel#addAllStrings} instead. Probably you want to use
    125      *     {@link org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel.Preferences#load} and
    126      *     {@link org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel.Preferences#save}.
    127      */
    128     @Deprecated
    129     public void setPossibleItemsTopDown(Collection<E> elems) {
    130         setPossibleAcItems(elems);
    131     }
    132 
    133     /**
    134      * Sets the items of the combobox to the given {@code AutoCompletionItem}s.
    135      *
    136      * @param elems AutoCompletionItem items
    137      * @since 12859
    138      * @deprecated Use {@link AutoCompComboBoxModel#addAllElements} instead.
    139      */
    140     @Deprecated
    141     public void setPossibleAcItems(Collection<E> elems) {
    142         Object oldValue = getEditor().getItem();
    143         getModel().removeAllElements();
    144         getModel().addAllElements(elems);
    145         getEditor().setItem(oldValue);
    146     }
    147 
    148     /**
    14998     * Enables or disables the autocompletion.
    15099     *
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java

    r18221 r18305  
    290290    public void populateWithMemberRoles(AutoCompletionList list, Relation r) {
    291291        CheckParameterUtil.ensureParameterNotNull(list, "list");
    292         Collection<TaggingPreset> presets = r != null ? TaggingPresets.getMatchingPresets(null, r.getKeys(), false) : null;
     292        Collection<TaggingPreset> presets = r != null ? TaggingPresets.getMatchingPresets(null, r.getKeys(), false) : Collections.emptyList();
    293293        if (r != null && !Utils.isEmpty(presets)) {
    294294            for (TaggingPreset tp : presets) {
  • trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java

    r18193 r18305  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.widgets;
    3 
    4 import java.util.List;
    53
    64import org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBox;
     
    3432        getModel().setSelectedItem(newItem);
    3533    }
    36 
    37     /**
    38      * Returns the items as strings
    39      * @return the items as strings
    40      * @deprecated Has been moved to the model, where it belongs. Use
    41      *     {@link HistoryComboBoxModel#asStringList} instead. Probably you want to use
    42      *     {@link org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel.Preferences#load} and
    43      *     {@link org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel.Preferences#save}.
    44      */
    45     @Deprecated
    46     public List<String> getHistory() {
    47         return getModel().asStringList();
    48     }
    4934}
Note: See TracChangeset for help on using the changeset viewer.