Ignore:
Timestamp:
2014-04-26T17:39:23+02:00 (10 years ago)
Author:
Don-vip
Message:

see #8465 - use diamond operator where applicable

Location:
trunk/src/org/openstreetmap/josm/gui/preferences/plugin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java

    r6931 r7005  
    151151            // If the plugin has been unselected, was it required by other plugins still selected ?
    152152            else if (!cb.isSelected()) {
    153                 Set<String> otherPlugins = new HashSet<String>();
     153                Set<String> otherPlugins = new HashSet<>();
    154154                for (PluginInformation pi : model.getAvailablePlugins()) {
    155155                    if (!pi.equals(cb.pi) && pi.requires != null && model.isSelectedPlugin(pi.getName())) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java

    r7004 r7005  
    280280        pnlPluginUpdatePolicy.rememberInPreferences();
    281281        if (model.isActivePluginsChanged()) {
    282             LinkedList<String> l = new LinkedList<String>(model.getSelectedPluginNames());
     282            LinkedList<String> l = new LinkedList<>(model.getSelectedPluginNames());
    283283            Collections.sort(l);
    284284            Main.pref.putCollection("plugins", l);
     
    494494            setLayout(new GridBagLayout());
    495495            add(new JLabel(tr("Add JOSM Plugin description URL.")), GBC.eol());
    496             model = new DefaultListModel<String>();
     496            model = new DefaultListModel<>();
    497497            for (String s : Main.pref.getPluginSites()) {
    498498                model.addElement(s);
    499499            }
    500             final JList<String> list = new JList<String>(model);
     500            final JList<String> list = new JList<>(model);
    501501            add(new JScrollPane(list), GBC.std().fill());
    502502            JPanel buttons = new JPanel(new GridBagLayout());
     
    565565        public List<String> getUpdateSites() {
    566566            if (model.getSize() == 0) return Collections.emptyList();
    567             List<String> ret = new ArrayList<String>(model.getSize());
     567            List<String> ret = new ArrayList<>(model.getSize());
    568568            for (int i=0; i< model.getSize();i++){
    569569                ret.add((String)model.get(i));
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java

    r6906 r7005  
    2525 */
    2626public class PluginPreferencesModel extends Observable {
    27     private final List<PluginInformation> availablePlugins = new ArrayList<PluginInformation>();
    28     private final List<PluginInformation> displayedPlugins = new ArrayList<PluginInformation>();
    29     private final Map<PluginInformation, Boolean> selectedPluginsMap = new HashMap<PluginInformation, Boolean>();
    30     private Set<String> pendingDownloads = new HashSet<String>();
     27    private final List<PluginInformation> availablePlugins = new ArrayList<>();
     28    private final List<PluginInformation> displayedPlugins = new ArrayList<>();
     29    private final Map<PluginInformation, Boolean> selectedPluginsMap = new HashMap<>();
     30    private Set<String> pendingDownloads = new HashSet<>();
    3131    private String filterExpression;
    3232    private Set<String> currentActivePlugins;
     
    3636     */
    3737    public PluginPreferencesModel() {
    38         currentActivePlugins = new HashSet<String>();
     38        currentActivePlugins = new HashSet<>();
    3939        currentActivePlugins.addAll(Main.pref.getCollection("plugins", currentActivePlugins));
    4040    }
     
    7777        sort();
    7878        filterDisplayedPlugins(filterExpression);
    79         Set<String> activePlugins = new HashSet<String>();
     79        Set<String> activePlugins = new HashSet<>();
    8080        activePlugins.addAll(Main.pref.getCollection("plugins", activePlugins));
    8181        for (PluginInformation pi: availablePlugins) {
     
    119119     */
    120120    public List<PluginInformation> getSelectedPlugins() {
    121         List<PluginInformation> ret = new LinkedList<PluginInformation>();
     121        List<PluginInformation> ret = new LinkedList<>();
    122122        for (PluginInformation pi: availablePlugins) {
    123123            if (selectedPluginsMap.get(pi) == null) {
     
    137137     */
    138138    public Set<String> getSelectedPluginNames() {
    139         Set<String> ret = new HashSet<String>();
     139        Set<String> ret = new HashSet<>();
    140140        for (PluginInformation pi: getSelectedPlugins()) {
    141141            ret.add(pi.name);
     
    177177     */
    178178    public List<PluginInformation> getPluginsScheduledForUpdateOrDownload() {
    179         List<PluginInformation> ret = new ArrayList<PluginInformation>();
     179        List<PluginInformation> ret = new ArrayList<>();
    180180        for (String plugin: pendingDownloads) {
    181181            PluginInformation pi = getPluginInformation(plugin);
     
    274274     */
    275275    public List<PluginInformation> getNewlyActivatedPlugins() {
    276         List<PluginInformation> ret = new LinkedList<PluginInformation>();
     276        List<PluginInformation> ret = new LinkedList<>();
    277277        for (Entry<PluginInformation, Boolean> entry: selectedPluginsMap.entrySet()) {
    278278            PluginInformation pi = entry.getKey();
     
    292292     */
    293293    public List<PluginInformation> getNewlyDeactivatedPlugins() {
    294         List<PluginInformation> ret = new LinkedList<PluginInformation>();
     294        List<PluginInformation> ret = new LinkedList<>();
    295295        for (PluginInformation pi: availablePlugins) {
    296296            if (!currentActivePlugins.contains(pi.name)) {
     
    310310     */
    311311    public List<PluginInformation> getAvailablePlugins() {
    312         return new LinkedList<PluginInformation>(availablePlugins);
     312        return new LinkedList<>(availablePlugins);
    313313    }
    314314
     
    320320     */
    321321    public Set<String> getNewlyActivatedPluginNames() {
    322         Set<String> ret = new HashSet<String>();
     322        Set<String> ret = new HashSet<>();
    323323        List<PluginInformation> plugins = getNewlyActivatedPlugins();
    324324        for (PluginInformation pi: plugins) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java

    r6890 r7005  
    6868
    6969        ButtonGroup bgVersionBasedUpdatePolicy = new ButtonGroup();
    70         rbVersionBasedUpatePolicy = new HashMap<Policy, JRadioButton>();
     70        rbVersionBasedUpatePolicy = new HashMap<>();
    7171        JRadioButton btn = new JRadioButton(tr("Ask before updating"));
    7272        rbVersionBasedUpatePolicy.put(Policy.ASK, btn);
     
    109109
    110110        ButtonGroup bgTimeBasedUpdatePolicy = new ButtonGroup();
    111         rbTimeBasedUpatePolicy = new HashMap<Policy, JRadioButton>();
     111        rbTimeBasedUpatePolicy = new HashMap<>();
    112112        JRadioButton btn = new JRadioButton(tr("Ask before updating"));
    113113        btn.addChangeListener(changeListener);
Note: See TracChangeset for help on using the changeset viewer.