Ignore:
Timestamp:
2015-05-06T00:23:51+02:00 (9 years ago)
Author:
Don-vip
Message:

fix various issues:

  • performance - inefficient use of keySet iterator instead of entrySet iterator
  • squid:S2674: The value returned from a stream read should be checked
  • remove unused imports
  • improve javadoc
Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java

    r8240 r8332  
    99import java.util.List;
    1010import java.util.Map;
     11import java.util.Map.Entry;
    1112import java.util.concurrent.Future;
    1213import java.util.regex.Matcher;
     
    128129        private final Map<OsmPrimitive, Date> toLoad;
    129130
    130         public HistoryLoaderAndListener(Map<OsmPrimitive, Date> toLoad) {
     131        private HistoryLoaderAndListener(Map<OsmPrimitive, Date> toLoad) {
    131132            this.toLoad = toLoad;
    132133            add(toLoad.keySet());
     
    138139        public void historyUpdated(HistoryDataSet source, PrimitiveId id) {
    139140            Map<OsmPrimitive, Date> toLoadNext = new HashMap<>();
    140             for (Iterator<OsmPrimitive> it = toLoad.keySet().iterator(); it.hasNext();) {
    141                 OsmPrimitive p = it.next();
     141            for (Iterator<Entry<OsmPrimitive, Date>> it = toLoad.entrySet().iterator(); it.hasNext();) {
     142                Entry<OsmPrimitive, Date> entry = it.next();
     143                OsmPrimitive p = entry.getKey();
    142144                History history = source.getHistory(p.getPrimitiveId());
    143                 Date date = toLoad.get(p);
     145                Date date = entry.getValue();
    144146                // If the history has been loaded and a timestamp is known
    145147                if (history != null && date != null) {
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r8285 r8332  
    573573        public boolean allElements;
    574574
     575        /**
     576         * Constructs a new {@code SearchSetting}.
     577         */
    575578        public SearchSetting() {
    576579            this("", SearchMode.replace, false /* case insensitive */,
Note: See TracChangeset for help on using the changeset viewer.