Changeset 2135 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2009-09-14T21:24:54+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3488: "No open changeset" appears in changeset list every second time the list is refreshed
fixed NPE

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

Legend:

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

    r2083 r2135  
    44
    55import java.awt.Component;
    6 import java.awt.Container;
    76import java.awt.Dimension;
    8 import java.awt.Frame;
    97import java.awt.GridBagLayout;
    108import java.awt.Toolkit;
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java

    r2115 r2135  
    2424 * This is a task for downloading the open changesets of the current user
    2525 * from the OSM server.
    26 
    2726 *
    2827 */
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r2115 r2135  
    864864        }
    865865
     866        /**
     867         * Refreshes the list of open changesets
     868         *
     869         */
    866870        class RefreshAction extends AbstractAction {
    867871            public RefreshAction() {
     
    941945        }
    942946
     947        /**
     948         * Updates the current list of open changesets with the changesets
     949         * in <code>changesets</code>
     950         *
     951         * @param changesets the collection of changesets. If null, removes
     952         * all changesets from the current list of changesets
     953         */
    943954        public void addOrUpdate(Collection<Changeset> changesets) {
     955            if (changesets == null){
     956                this.changesets.clear();
     957                setSelectedItem(null);
     958            }
    944959            for (Changeset cs: changesets) {
    945960                internalAddOrUpdate(cs);
     
    948963            if (getSelectedItem() == null && !this.changesets.isEmpty()) {
    949964                setSelectedItem(this.changesets.get(0));
     965            } else if (getSelectedItem() != null) {
     966                if (changesets.contains(getSelectedItem())) {
     967                    setSelectedItem(getSelectedItem());
     968                } else {
     969                    setSelectedItem(this.changesets.get(0));
     970                }
    950971            } else {
    951972                setSelectedItem(null);
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r2115 r2135  
    355355            sendRequest(
    356356                    "PUT",
    357                     "changeset/" + this.changeset.getId(),
    358                     toXml(this.changeset),
     357                    "changeset/" + changeset.getId(),
     358                    toXml(changeset),
    359359                    monitor
    360360            );
Note: See TracChangeset for help on using the changeset viewer.