Ignore:
Timestamp:
2009-09-02T21:17:52+02:00 (15 years ago)
Author:
Gubaer
Message:

new: improved dialog for uploading/saving modified layers on exit
new: improved dialog for uploading/saving modified layers if layers are deleted
new: new progress monitor which can delegate rendering to any Swing component
more setters/getters for properties in OSM data classes (fields are @deprecated); started to update references in the code base

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
17 edited

Legend:

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

    r2017 r2025  
    5252        Iterator<OsmPrimitive> it = primitivesToShow.iterator();
    5353        while(it.hasNext()) {
    54             if (it.next().id == 0) {
     54            if (it.next().getId() == 0) {
    5555                it.remove();
    5656            }
  • trunk/src/org/openstreetmap/josm/actions/ApiPreconditionChecker.java

    r2017 r2025  
    1 // License: GPL. For details, see LICENSE file.
    21package org.openstreetmap.josm.actions;
    32
     
    7170            for (Entry<String,String> e : osmPrimitive.entrySet()) {
    7271                if(e.getValue().length() > 255) {
    73                     if (osmPrimitive.deleted) {
     72                    if (osmPrimitive.isDeleted()) {
    7473                        // if OsmPrimitive is going to be deleted we automatically shorten the
    7574                        // value
     
    7776                                tr("Warning: automatically truncating value of tag ''{0}'' on deleted primitive {1}",
    7877                                        e.getKey(),
    79                                         Long.toString(osmPrimitive.id)
     78                                        Long.toString(osmPrimitive.getId())
    8079                                )
    8180                        );
     
    8584                    JOptionPane.showMessageDialog(Main.parent,
    8685                            tr("Length of value for tag ''{0}'' on primitive {1} exceeds the max. allowed length {2}. Values length is {3}.",
    87                                     e.getKey(), Long.toString(osmPrimitive.id), 255, e.getValue().length()
     86                                    e.getKey(), Long.toString(osmPrimitive.getId()), 255, e.getValue().length()
    8887                            ),
    8988                            tr("Precondition Violation"),
     
    103102                        tr("{0} nodes in way {1} exceed the max. allowed number of nodes {2}",
    104103                                ((Way)osmPrimitive).getNodesCount(),
    105                                 Long.toString(osmPrimitive.id),
     104                                Long.toString(osmPrimitive.getId()),
    106105                                maxNodes
    107106                        ),
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r2017 r2025  
    9090        HashSet<Relation> relationsUsingWays = new HashSet<Relation>();
    9191        for (Relation r : getCurrentDataSet().relations) {
    92             if (r.deleted || r.incomplete) {
     92            if (r.isDeleted() || r.incomplete) {
    9393                continue;
    9494            }
     
    177177        for (Way w : selectedWays) {
    178178            modifyWay = w;
    179             if (w.id != 0) {
     179            if (w.getId() != 0) {
    180180                break;
    181181            }
  • trunk/src/org/openstreetmap/josm/actions/ExitAction.java

    r1677 r2025  
    2121    public ExitAction() {
    2222        super(tr("Exit"), "exit", tr("Exit the application."),
    23         Shortcut.registerShortcut("system:menuexit", tr("Exit"), KeyEvent.VK_Q, Shortcut.GROUP_MENU), true);
     23                Shortcut.registerShortcut("system:menuexit", tr("Exit"), KeyEvent.VK_Q, Shortcut.GROUP_MENU), true);
    2424    }
    2525
    2626    public void actionPerformed(ActionEvent e) {
    27         if (!Main.breakBecauseUnsavedChanges()) {
     27        if (Main.saveUnsavedModifications()) {
    2828            Main.saveGuiGeometry();
    2929            System.exit(0);
  • trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java

    r1697 r2025  
    2121    @Override
    2222    protected  String createInfoUrl(OsmPrimitive primitive) {
    23         return getBaseURL() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.id + "/history";
     23        return getBaseURL() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.getId() + "/history";
    2424    }
    2525}
  • trunk/src/org/openstreetmap/josm/actions/InfoAction.java

    r1697 r2025  
    2121    @Override
    2222    protected  String createInfoUrl(OsmPrimitive primitive) {
    23         return getBaseURL() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.id;
     23        return getBaseURL() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.getId();
    2424    }
    2525}
  • trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java

    r2017 r2025  
    9595        Node useNode = null;
    9696        for (Node n: selectedNodes) {
    97             if (n.id > 0) {
     97            if (n.getId() > 0) {
    9898                useNode = n;
    9999                break;
     
    127127        HashSet<Relation> relationsUsingNodes = new HashSet<Relation>();
    128128        for (Relation r : getCurrentDataSet().relations) {
    129             if (r.deleted || r.incomplete) {
     129            if (r.isDeleted() || r.incomplete) {
    130130                continue;
    131131            }
     
    217217
    218218        for (Way w : getCurrentDataSet().ways) {
    219             if (w.deleted || w.incomplete || w.getNodesCount() < 1) {
     219            if (w.isDeleted() || w.incomplete || w.getNodesCount() < 1) {
    220220                continue;
    221221            }
  • trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java

    r2008 r2025  
    126126    protected Map<OsmPrimitiveType, Integer> getSourceStatistics() {
    127127        HashMap<OsmPrimitiveType, Integer> ret = new HashMap<OsmPrimitiveType, Integer>();
    128         for (Class type: new Class[] {Node.class, Way.class, Relation.class}) {
     128        for (Class<? extends OsmPrimitive> type: new Class[] {Node.class, Way.class, Relation.class}) {
    129129            if (!getSourceTagsByType(type).isEmpty()) {
    130130                ret.put(OsmPrimitiveType.from(type), getSourcePrimitivesByType(type).size());
     
    136136    protected Map<OsmPrimitiveType, Integer> getTargetStatistics() {
    137137        HashMap<OsmPrimitiveType, Integer> ret = new HashMap<OsmPrimitiveType, Integer>();
    138         for (Class type: new Class[] {Node.class, Way.class, Relation.class}) {
     138        for (Class<? extends OsmPrimitive> type: new Class[] {Node.class, Way.class, Relation.class}) {
    139139            int count = getSubcollectionByType(getEditLayer().data.getSelected(), type).size();
    140140            if (count > 0) {
     
    156156    protected void pasteFromHomogeneousSource(Collection<? extends OsmPrimitive> targets) {
    157157        TagCollection tc = null;
    158         Class sourceType = null;
    159         for (Class type : new Class[] {Node.class, Way.class, Relation.class}) {
     158        for (Class<? extends OsmPrimitive> type : new Class[] {Node.class, Way.class, Relation.class}) {
    160159            TagCollection tc1 = getSourceTagsByType(type);
    161160            if (!tc1.isEmpty()) {
    162161                tc = tc1;
    163                 sourceType = type;
    164162            }
    165163        }
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r2017 r2025  
    7272            layer.setName(file.getName());
    7373            layer.setAssociatedFile(file);
     74            if (layer instanceof OsmDataLayer) {
     75                ((OsmDataLayer) layer).onPostSaveToFile();
     76            }
    7477            Main.parent.repaint();
    7578        } catch (IOException e) {
     
    8891     */
    8992    public boolean checkSaveConditions(Layer layer) {
    90         if (layer == null) {
    91             JOptionPane.showMessageDialog(
    92                     Main.parent,
    93                     tr("Internal Error: cannot check conditions for no layer. Please report this as a bug."),
    94                     tr("Error"),
    95                     JOptionPane.ERROR_MESSAGE
    96             );
    97             return false;
    98         }
    99         if (Main.map == null) {
    100             JOptionPane.showMessageDialog(
    101                     Main.parent,
    102                     tr("No document open so nothing to save."),
    103                     tr("Warning"),
    104                     JOptionPane.WARNING_MESSAGE
    105             );
    106             return false;
    107         }
    108 
    10993        if (layer instanceof OsmDataLayer && isDataSetEmpty((OsmDataLayer)layer) && 1 != new ExtendedDialog(Main.parent, tr("Empty document"), tr("The document contains no data."), new String[] {tr("Save anyway"), tr("Cancel")}, new String[] {"save.png", "cancel.png"}).getValue())
    11094            return false;
     
    144128    private boolean isDataSetEmpty(OsmDataLayer layer) {
    145129        for (OsmPrimitive osm : layer.data.allNonDeletedPrimitives())
    146             if (!osm.deleted || osm.id > 0)
     130            if (!osm.isDeleted() || osm.getId() > 0)
    147131                return false;
    148132        return true;
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r2017 r2025  
    102102            for (Node n : selectedNodes) {
    103103                for (Way w : getCurrentDataSet().ways) {
    104                     if (w.deleted || w.incomplete) {
     104                    if (w.isDeleted() || w.incomplete) {
    105105                        continue;
    106106                    }
     
    293293
    294294        for (Relation r : getCurrentDataSet().relations) {
    295             if (r.deleted || r.incomplete) {
     295            if (r.isDeleted() || r.incomplete) {
    296296                continue;
    297297            }
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r2017 r2025  
    6666            int count = 0;
    6767            for (Way w : getCurrentDataSet().ways) {
    68                 if (w.deleted || w.incomplete || w.getNodesCount() < 1) {
     68                if (w.isDeleted() || w.incomplete || w.getNodesCount() < 1) {
    6969                    continue;
    7070                }
     
    9191                int count = 0;
    9292                for (Way w : getCurrentDataSet().ways) {
    93                     if (w.deleted || w.incomplete || w.getNodesCount() < 1) {
     93                    if (w.isDeleted() || w.incomplete || w.getNodesCount() < 1) {
    9494                        continue;
    9595                    }
     
    321321        HashSet<String> rolesToReAdd = null;
    322322        for (Relation r : getCurrentDataSet().relations) {
    323             if (r.deleted || r.incomplete) {
     323            if (r.isDeleted() || r.incomplete) {
    324324                continue;
    325325            }
     
    368368            // modify all ways containing the nodes
    369369            for (Way w : getCurrentDataSet().ways) {
    370                 if (w.deleted || w.incomplete || w.getNodesCount() < 1) {
     370                if (w.isDeleted() || w.incomplete || w.getNodesCount() < 1) {
    371371                    continue;
    372372                }
  • trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java

    r1881 r2025  
    7979            // bounds defined? => use the bbox downloader
    8080            //
    81             new DownloadOsmTaskList().download(false, areas, new PleaseWaitProgressMonitor());
     81            new DownloadOsmTaskList().download(false, areas, new PleaseWaitProgressMonitor(tr("Updating data")));
    8282        }
    8383    }
  • trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java

    r2017 r2025  
    166166        protected void initMultiFetchReaderWithNodes(MultiFetchServerObjectReader reader) {
    167167            for (OsmPrimitive primitive : toUpdate) {
    168                 if (primitive instanceof Node && primitive.id > 0) {
     168                if (primitive instanceof Node && primitive.getId() > 0) {
    169169                    reader.append((Node)primitive);
    170170                } else if (primitive instanceof Way) {
    171171                    Way way = (Way)primitive;
    172172                    for (Node node: way.getNodes()) {
    173                         if (node.id > 0) {
     173                        if (node.getId() > 0) {
    174174                            reader.append(node);
    175175                        }
     
    181181        protected void initMultiFetchReaderWithWays(MultiFetchServerObjectReader reader) {
    182182            for (OsmPrimitive primitive : toUpdate) {
    183                 if (primitive instanceof Way && primitive.id > 0) {
     183                if (primitive instanceof Way && primitive.getId() > 0) {
    184184                    reader.append((Way)primitive);
    185185                }
     
    189189        protected void initMultiFetchReaderWithRelations(MultiFetchServerObjectReader reader) {
    190190            for (OsmPrimitive primitive : toUpdate) {
    191                 if (primitive instanceof Relation && primitive.id > 0) {
     191                if (primitive instanceof Relation && primitive.getId() > 0) {
    192192                    reader.append((Relation)primitive);
    193193                }
  • trunk/src/org/openstreetmap/josm/actions/UploadAction.java

    r2005 r2025  
    2626
    2727import org.openstreetmap.josm.Main;
     28import org.openstreetmap.josm.data.APIDataSet;
    2829import org.openstreetmap.josm.data.conflict.ConflictCollection;
    2930import org.openstreetmap.josm.data.osm.DataSet;
     
    3435import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    3536import org.openstreetmap.josm.gui.historycombobox.SuggestingJHistoryComboBox;
     37import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3638import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    3739import org.openstreetmap.josm.io.OsmApi;
     
    108110    }
    109111
     112    public boolean checkPreUploadConditions(OsmDataLayer layer) {
     113        return checkPreUploadConditions(layer, new APIDataSet(layer.data));
     114    }
     115
     116    public boolean checkPreUploadConditions(OsmDataLayer layer, APIDataSet apiData) {
     117        ConflictCollection conflicts = layer.getConflicts();
     118        if (conflicts !=null && !conflicts.isEmpty()) {
     119            JOptionPane.showMessageDialog(
     120                    Main.parent,
     121                    tr("<html>There are unresolved conflicts in layer ''{0}''.<br>"
     122                            + "You have to resolve them first.<html>", layer.getName()),
     123                            tr("Warning"),
     124                            JOptionPane.WARNING_MESSAGE
     125            );
     126            return false;
     127        }
     128        // Call all upload hooks in sequence. The upload confirmation dialog
     129        // is one of these.
     130        for(UploadHook hook : uploadHooks)
     131            if(!hook.checkUpload(apiData.getPrimitivesToAdd(), apiData.getPrimitivesToUpdate(), apiData.getPrimitivesToDelete()))
     132                return false;
     133
     134        return true;
     135    }
     136
    110137    public void actionPerformed(ActionEvent e) {
    111138        if (!isEnabled())
     
    121148        }
    122149
    123         ConflictCollection conflicts = Main.map.mapView.getEditLayer().getConflicts();
    124         if (conflicts !=null && !conflicts.isEmpty()) {
    125             JOptionPane.showMessageDialog(
    126                     Main.parent,
    127                     tr("There are unresolved conflicts. You have to resolve these first."),
    128                     tr("Warning"),
    129                     JOptionPane.WARNING_MESSAGE
    130             );
    131             Main.map.conflictDialog.showDialog();
    132             return;
    133         }
    134 
    135         final LinkedList<OsmPrimitive> add = new LinkedList<OsmPrimitive>();
    136         final LinkedList<OsmPrimitive> update = new LinkedList<OsmPrimitive>();
    137         final LinkedList<OsmPrimitive> delete = new LinkedList<OsmPrimitive>();
    138         for (OsmPrimitive osm : getCurrentDataSet().allPrimitives()) {
    139             if (osm.get("josm/ignore") != null) {
    140                 continue;
    141             }
    142             if (osm.id == 0 && !osm.deleted) {
    143                 add.addLast(osm);
    144             } else if (osm.modified && !osm.deleted) {
    145                 update.addLast(osm);
    146             } else if (osm.deleted && osm.id != 0) {
    147                 delete.addFirst(osm);
    148             }
    149         }
    150 
    151         if (add.isEmpty() && update.isEmpty() && delete.isEmpty()) {
     150        APIDataSet apiData = new APIDataSet(Main.main.getCurrentDataSet());
     151        if (apiData.isEmpty()) {
    152152            JOptionPane.showMessageDialog(
    153153                    Main.parent,
    154154                    tr("No changes to upload."),
    155155                    tr("Warning"),
    156                     JOptionPane.WARNING_MESSAGE
     156                    JOptionPane.INFORMATION_MESSAGE
    157157            );
    158158            return;
    159159        }
    160 
    161         // Call all upload hooks in sequence. The upload confirmation dialog
    162         // is one of these.
    163         for(UploadHook hook : uploadHooks)
    164             if(!hook.checkUpload(add, update, delete))
    165                 return;
    166 
    167         final Collection<OsmPrimitive> all = new LinkedList<OsmPrimitive>();
    168         all.addAll(add);
    169         all.addAll(update);
    170         all.addAll(delete);
    171 
    172         Main.worker.execute(new UploadDiffTask(all));
     160        if (!checkPreUploadConditions(Main.map.mapView.getEditLayer(), apiData))
     161            return;
     162        Main.worker.execute(createUploadTask(Main.map.mapView.getEditLayer(), apiData.getPrimitives()));
    173163    }
    174164
     
    235225        );
    236226        switch(ret) {
    237         case JOptionPane.CLOSED_OPTION: return;
    238         case JOptionPane.CANCEL_OPTION: return;
    239         case 0: synchronizePrimitive(id); break;
    240         case 1: synchronizeDataSet(); break;
    241         default:
    242             // should not happen
    243             throw new IllegalStateException(tr("unexpected return value. Got {0}", ret));
     227            case JOptionPane.CLOSED_OPTION: return;
     228            case JOptionPane.CANCEL_OPTION: return;
     229            case 0: synchronizePrimitive(id); break;
     230            case 1: synchronizeDataSet(); break;
     231            default:
     232                // should not happen
     233                throw new IllegalStateException(tr("unexpected return value. Got {0}", ret));
    244234        }
    245235    }
     
    275265        );
    276266        switch(ret) {
    277         case JOptionPane.CLOSED_OPTION: return;
    278         case 1: return;
    279         case 0: synchronizeDataSet(); break;
    280         default:
    281             // should not happen
    282             throw new IllegalStateException(tr("unexpected return value. Got {0}", ret));
     267            case JOptionPane.CLOSED_OPTION: return;
     268            case 1: return;
     269            case 0: synchronizeDataSet(); break;
     270            default:
     271                // should not happen
     272                throw new IllegalStateException(tr("unexpected return value. Got {0}", ret));
    283273        }
    284274    }
     
    522512    }
    523513
    524 
    525     class UploadDiffTask extends  PleaseWaitRunnable {
     514    public UploadDiffTask createUploadTask(OsmDataLayer layer, Collection<OsmPrimitive> toUpload) {
     515        return new UploadDiffTask(layer, toUpload);
     516    }
     517
     518    public class UploadDiffTask extends  PleaseWaitRunnable {
    526519        private boolean uploadCancelled = false;
    527520        private Exception lastException = null;
    528521        private Collection <OsmPrimitive> toUpload;
    529522        private OsmServerWriter writer;
    530 
    531         public UploadDiffTask(Collection <OsmPrimitive> toUpload) {
    532             super(tr("Uploading"),false /* don't ignore exceptions */);
     523        private OsmDataLayer layer;
     524
     525        private UploadDiffTask(OsmDataLayer layer, Collection <OsmPrimitive> toUpload) {
     526            super(tr("Uploading data for layer ''{0}''", layer.getName()),false /* don't ignore exceptions */);
    533527            this.toUpload = toUpload;
     528            this.layer = layer;
    534529        }
    535530
     
    537532            writer = new OsmServerWriter();
    538533            try {
    539                 writer.uploadOsm(getCurrentDataSet().version, toUpload, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
     534                ProgressMonitor monitor = progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false);
     535                writer.uploadOsm(layer.data.version, toUpload, monitor);
    540536            } catch (Exception sxe) {
    541537                if (uploadCancelled) {
     
    554550            // partially uploaded
    555551            //
    556             getEditLayer().cleanupAfterUpload(writer.getProcessedPrimitives());
    557             DataSet.fireSelectionChanged(getEditLayer().data.getSelected());
    558             getEditLayer().fireDataChange();
     552            layer.cleanupAfterUpload(writer.getProcessedPrimitives());
     553            DataSet.fireSelectionChanged(layer.data.getSelected());
     554            layer.fireDataChange();
    559555            if (lastException != null) {
    560556                handleFailedUpload(lastException);
     557            } else {
     558                layer.onPostUploadToServer();
    561559            }
    562560        }
     
    568566            }
    569567        }
     568
     569        public boolean isSuccessful() {
     570            return !isCancelled() && !isFailed();
     571        }
     572
     573        public boolean isCancelled() {
     574            return uploadCancelled;
     575        }
     576
     577        public boolean isFailed() {
     578            return lastException != null;
     579        }
    570580    }
    571581}
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r2009 r2025  
    765765        Way way = null;
    766766        for (Way w : getCurrentDataSet().ways) {
    767             if (w.deleted || w.incomplete || w.getNodesCount() < 1) {
     767            if (w.isDeleted() || w.incomplete || w.getNodesCount() < 1) {
    768768                continue;
    769769            }
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r1938 r2025  
    227227
    228228            switch (mode) {
    229             case NONE:
    230                 return false;
    231             case MISSING_KEY:
    232                 return osm.get(key) == null;
    233             case ANY:
    234                 return true;
    235             case ANY_VALUE:
    236                 return osm.get(key) != null;
    237             case ANY_KEY:
    238                 for (String v:osm.getKeys().values()) {
    239                     if (v.equals(value))
    240                         return true;
    241                 }
    242                 return false;
    243             case EXACT:
    244                 return value.equals(osm.get(key));
    245             case ANY_KEY_REGEXP:
    246                 for (String v:osm.getKeys().values()) {
    247                     if (valuePattern.matcher(v).matches())
    248                         return true;
    249                 }
    250                 return false;
    251             case ANY_VALUE_REGEXP:
    252             case EXACT_REGEXP:
    253                 for (Entry<String, String> entry:osm.entrySet()) {
    254                     if (keyPattern.matcher(entry.getKey()).matches()) {
    255                         if (mode == Mode.ANY_VALUE_REGEXP
    256                                 || valuePattern.matcher(entry.getValue()).matches())
     229                case NONE:
     230                    return false;
     231                case MISSING_KEY:
     232                    return osm.get(key) == null;
     233                case ANY:
     234                    return true;
     235                case ANY_VALUE:
     236                    return osm.get(key) != null;
     237                case ANY_KEY:
     238                    for (String v:osm.getKeys().values()) {
     239                        if (v.equals(value))
    257240                            return true;
    258241                    }
    259                 }
    260                 return false;
    261             case MISSING_KEY_REGEXP:
    262                 for (String k:osm.keySet()) {
    263                     if (keyPattern.matcher(k).matches())
    264                         return false;
    265                 }
    266                 return true;
     242                    return false;
     243                case EXACT:
     244                    return value.equals(osm.get(key));
     245                case ANY_KEY_REGEXP:
     246                    for (String v:osm.getKeys().values()) {
     247                        if (valuePattern.matcher(v).matches())
     248                            return true;
     249                    }
     250                    return false;
     251                case ANY_VALUE_REGEXP:
     252                case EXACT_REGEXP:
     253                    for (Entry<String, String> entry:osm.entrySet()) {
     254                        if (keyPattern.matcher(entry.getKey()).matches()) {
     255                            if (mode == Mode.ANY_VALUE_REGEXP
     256                                    || valuePattern.matcher(entry.getValue()).matches())
     257                                return true;
     258                        }
     259                    }
     260                    return false;
     261                case MISSING_KEY_REGEXP:
     262                    for (String k:osm.keySet()) {
     263                        if (keyPattern.matcher(k).matches())
     264                            return false;
     265                    }
     266                    return true;
    267267            }
    268268            throw new AssertionError("Missed state");
     
    402402    private static class Modified extends Match {
    403403        @Override public boolean match(OsmPrimitive osm) {
    404             return osm.modified || osm.id == 0;
     404            return osm.isModified() || osm.getId() == 0;
    405405        }
    406406        @Override public String toString() {return "modified";}
  • trunk/src/org/openstreetmap/josm/actions/search/SelectionWebsiteLoader.java

    r2017 r2025  
    4848            Map<Long, String> ids = idReader.parseIds(in);
    4949            for (OsmPrimitive osm : Main.main.getCurrentDataSet().allNonDeletedPrimitives()) {
    50                 if (ids.containsKey(osm.id) && osm.getClass().getName().toLowerCase().endsWith(ids.get(osm.id))) {
     50                if (ids.containsKey(osm.getId()) && osm.getClass().getName().toLowerCase().endsWith(ids.get(osm.getId()))) {
    5151                    if (mode == SearchAction.SearchMode.remove) {
    5252                        sel.remove(osm);
Note: See TracChangeset for help on using the changeset viewer.