Changeset 19135 in josm for trunk


Ignore:
Timestamp:
2024-07-10T09:28:34+02:00 (5 months ago)
Author:
GerdP
Message:

fix #23754: JOSM fails to upload exactly 30000 changes in chunks of 10000

  • don't compare collection sizes() because they are changed in different situations
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java

    r19126 r19135  
    5151    private boolean uploadCanceled;
    5252    private Exception lastException;
     53    /** The objects to upload. Successfully uploaded objects are removed. */
    5354    private final APIDataSet toUpload;
    5455    private OsmServerWriter writer;
     
    5758    private final Set<IPrimitive> processedPrimitives;
    5859    private final UploadStrategySpecification strategy;
     60    /** Initial number of objects to be uploaded */
     61    private final int numObjectsToUpload;
    5962
    6063    /**
     
    7780        ensureParameterNotNull(changeset, "changeset");
    7881        this.toUpload = toUpload;
     82        this.numObjectsToUpload = toUpload.getSize();
    7983        this.layer = layer;
    8084        this.changeset = changeset;
     
    109113                )
    110114        };
    111         int numObjectsToUploadLeft = toUpload.getSize() - processedPrimitives.size();
     115        int numObjectsToUploadLeft = numObjectsToUpload - processedPrimitives.size();
    112116        String msg1 = tr("The server reported that the current changeset was closed.<br>"
    113117                + "This is most likely because the changesets size exceeded the max. size<br>"
     
    161165     */
    162166    protected boolean handleChangesetFullResponse() throws OsmTransferException {
    163         if (processedPrimitives.size() == toUpload.getSize()) {
     167        if (processedPrimitives.size() >= numObjectsToUpload) {
    164168            strategy.setPolicy(MaxChangesetSizeExceededPolicy.ABORT);
    165169            return false;
Note: See TracChangeset for help on using the changeset viewer.