Changeset 2188 in josm


Ignore:
Timestamp:
Sep 26, 2009 9:43:40 AM (4 years ago)
Author:
Gubaer
Message:

fixed #3570: uploated deletions create conflicts at next upload

Location:
trunk/src/org/openstreetmap/josm/data
Files:
2 edited

Legend:

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

    r2168 r2188  
    2828 * The collection is derived from the modified primitives of an {@see DataSet}. 
    2929 *  
    30  *  
    3130 */ 
    3231public class APIDataSet { 
     
    4544 
    4645    /** 
    47      * initializes the API data set with the modified primitives in <code>ds</ds> 
    48      *  
    49      * @param ds the data set. Ignore, if null. 
     46     * initializes the API data set with the modified primitives in <code>ds</code> 
     47     *  
     48     * @param ds the data set. Ignored, if null. 
    5049     */ 
    5150    public void init(DataSet ds) { 
     
    6362            } else if (osm.isModified() && !osm.isDeleted()) { 
    6463                toUpdate.addLast(osm); 
    65             } else if (osm.isDeleted() && osm.getId() != 0) { 
     64            } else if (osm.isDeleted() && osm.getId() != 0 && osm.isModified()) { 
    6665                toDelete.addFirst(osm); 
    6766            } 
     
    7069 
    7170    /** 
    72      * initializes the API data set with the modified primitives in <code>ds</ds> 
    73      *  
    74      * @param ds the data set. Ignore, if null. 
     71     * initializes the API data set with the modified primitives in <code>ds</code> 
     72     *  
     73     * @param ds the data set. Ignored, if null. 
    7574     */ 
    7675    public APIDataSet(DataSet ds) { 
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r2181 r2188  
    3535abstract public class OsmPrimitive implements Comparable<OsmPrimitive>, Tagged { 
    3636 
     37    /** 
     38     * Replies the sub-collection of {@see OsmPrimitive}s of type <code>type</code> present in 
     39     * another collection of {@see OsmPrimitive}s. The result collection is a list. 
     40     *  
     41     * If <code>list</code> is null, replies an empty list. 
     42     *  
     43     * @param <T> 
     44     * @param list  the original list 
     45     * @param type the type to filter for 
     46     * @return the sub-list of OSM primitives of type <code>type</code> 
     47     */ 
    3748    static public <T extends OsmPrimitive>  List<T> getFilteredList(Collection<OsmPrimitive> list, Class<T> type) { 
    38         if (list == null) return null; 
     49        if (list == null) return Collections.emptyList(); 
    3950        List<T> ret = new LinkedList<T>(); 
    4051        for(OsmPrimitive p: list) { 
     
    4657    } 
    4758 
     59    /** 
     60     * Replies the sub-collection of {@see OsmPrimitive}s of type <code>type</code> present in 
     61     * another collection of {@see OsmPrimitive}s. The result collection is a set. 
     62     *  
     63     * If <code>list</code> is null, replies an empty set. 
     64     *  
     65     * @param <T> 
     66     * @param list  the original collection 
     67     * @param type the type to filter for 
     68     * @return the sub-set of OSM primitives of type <code>type</code> 
     69     */ 
    4870    static public <T extends OsmPrimitive>  Set<T> getFilteredSet(Collection<OsmPrimitive> set, Class<T> type) { 
    49         if (set == null) return null; 
     71        if (set == null) return Collections.emptySet(); 
    5072        HashSet<T> ret = new HashSet<T>(); 
    5173        for(OsmPrimitive p: set) { 
     
    91113     * An id of 0 means an unknown id. The object has not been uploaded yet to 
    92114     * know what id it will get. 
    93      * 
    94      * Do not write to this attribute except you know exactly what you are doing. 
    95      * More specific, it is not good to set this to 0 and think the object is now 
    96      * new to the server! To create a new object, call the default constructor of 
    97      * the respective class. 
    98115     * 
    99116     */ 
     
    742759     */ 
    743760    public abstract String getDisplayName(NameFormatter formatter); 
    744  
    745761} 
    746  
    747  
Note: See TracChangeset for help on using the changeset viewer.