Changeset 7432 in josm for trunk/src


Ignore:
Timestamp:
2014-08-19T15:59:51+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #10388 - Incomplete download of relation members

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

Legend:

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

    r7091 r7432  
    1919
    2020/**
    21  * An relation, having a set of tags and any number (0...n) of members.
     21 * A relation, having a set of tags and any number (0...n) of members.
    2222 *
    2323 * @author Frederik Ramm
     
    502502
    503503    /**
    504      * Replies true if at least one child primitive is incomplete
     504     * Determines if at least one child primitive is incomplete.
    505505     *
    506506     * @return true if at least one child primitive is incomplete
     
    515515
    516516    /**
    517      * Replies a collection with the incomplete children this relation
    518      * refers to
     517     * Replies a collection with the incomplete children this relation refers to.
    519518     *
    520519     * @return the incomplete children. Empty collection if no children are incomplete.
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesTask.java

    r6973 r7432  
    2929import org.xml.sax.SAXException;
    3030
     31/**
     32 * Task downloading a set of OSM primitives.
     33 * @since 4081
     34 */
    3135public class DownloadPrimitivesTask extends PleaseWaitRunnable {
    3236    private DataSet ds;
     
    4347
    4448    /**
    45      * Creates the  task
     49     * Constructs a new {@code DownloadPrimitivesTask}.
    4650     *
    4751     * @param layer the layer in which primitives are updated. Must not be null.
     
    5761
    5862    /**
    59      * Creates the  task
     63     * Constructs a new {@code DownloadPrimitivesTask}.
    6064     *
    6165     * @param layer the layer in which primitives are updated. Must not be null.
     
    6872     */
    6973    public DownloadPrimitivesTask(OsmDataLayer layer, List<PrimitiveId> ids, boolean fullRelation,
    70             ProgressMonitor progessMonitor) throws IllegalArgumentException {
    71         super(tr("Download objects"), progessMonitor, false /* don't ignore exception */);
     74            ProgressMonitor progressMonitor) throws IllegalArgumentException {
     75        super(tr("Download objects"), progressMonitor, false /* don't ignore exception */);
    7276        ensureParameterNotNull(layer, "layer");
    7377        this.ids = ids;
     
    151155            for (Relation r : ds.getRelations()) {
    152156                if (canceled) return;
    153                 if (r.hasIncompleteMembers()) {
     157                // Relations may be incomplete in case of nested relations if child relations are accessed before their parent
     158                // (it may happen because "relations" has no deterministic sort order, see #10388)
     159                if (r.isIncomplete() || r.hasIncompleteMembers()) {
    154160                    synchronized(this) {
    155161                        if (canceled) return;
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r7033 r7432  
    387387    public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException {
    388388        int n = nodes.size() + ways.size() + relations.size();
    389         progressMonitor.beginTask(trn("Downloading {0} object from ''{1}''", "Downloading {0} objects from ''{1}''", n, n, OsmApi.getOsmApi().getBaseUrl()));
     389        progressMonitor.beginTask(trn("Downloading {0} object from ''{1}''",
     390                "Downloading {0} objects from ''{1}''", n, n, OsmApi.getOsmApi().getBaseUrl()));
    390391        try {
    391392            missingPrimitives = new HashSet<>();
  • trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java

    r7033 r7432  
    104104     * Downloads and parses the data.
    105105     *
    106      * @param progressMonitor the progress monitor. Set to {@link NullProgressMonitor#INSTANCE} if
    107      * null
     106     * @param progressMonitor the progress monitor. Set to {@link NullProgressMonitor#INSTANCE} if null
    108107     * @return the downloaded data
    109108     * @throws OsmTransferException
Note: See TracChangeset for help on using the changeset viewer.