Changeset 2471 in josm for trunk/src


Ignore:
Timestamp:
2009-11-18T18:50:38+01:00 (12 years ago)
Author:
Gubaer
Message:

fixed #3963: Synchronize does not work

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

Legend:

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

    r2444 r2471  
    1010import java.util.Collection;
    1111import java.util.Collections;
     12import java.util.logging.Logger;
    1213
    1314import javax.swing.JOptionPane;
     
    138139     */
    139140    static class UpdatePrimitivesTask extends PleaseWaitRunnable {
     141        static private final Logger logger = Logger.getLogger(UpdatePrimitivesTask.class.getName());
     142
    140143        private DataSet ds;
    141144        private boolean canceled;
     
    144147        private MultiFetchServerObjectReader reader;
    145148
     149        /**
     150         *
     151         * @param toUpdate a collection of primitives to update from the server
     152         */
    146153        public UpdatePrimitivesTask(Collection<? extends OsmPrimitive> toUpdate) {
    147154            super(tr("Update objects"), false /* don't ignore exception*/);
     
    166173                return;
    167174            }
    168             if (ds != null) {
    169                 Main.map.mapView.getEditLayer().mergeFrom(ds);
    170                 Main.map.mapView.getEditLayer().onPostDownloadFromServer();
     175            if (ds != null && Main.main.getEditLayer() != null) {
     176                Main.main.getEditLayer().mergeFrom(ds);
     177                Main.main.getEditLayer().onPostDownloadFromServer();
    171178            }
    172179        }
     
    202209            }
    203210        }
     211
    204212
    205213        @Override
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r2444 r2471  
    8383            if (mergeById(source))
    8484                return;
    85             if (!source.isVisible())
    86                 // ignore it
    87                 return;
     85            //if (!source.isVisible())
     86            // ignore it
     87            //    return;
    8888        } else {
    8989            // try to merge onto a primitive  which has no id assigned
     
    236236     * Tries to merge a primitive <code>source</code> into an existing primitive with the same id.
    237237     *
    238      * @param source  the other primitive which is to be merged onto a primitive in my primitives
     238     * @param source  the source primitive which is to be merged into a target primitive
    239239     * @return true, if this method was able to merge <code>source</code> into a target object; false, otherwise
    240240     */
  • trunk/src/org/openstreetmap/josm/data/osm/User.java

    r2455 r2471  
    77import java.util.HashMap;
    88import java.util.List;
     9import java.util.concurrent.atomic.AtomicLong;
    910
    1011/**
     
    1819 */
    1920public class User {
    20     static private long uidCounter = 0;
     21
     22    static private AtomicLong uidCounter = new AtomicLong();
     23
    2124    /**
    2225     * the map of known users
     
    2730    private static long getNextLocalUid() {
    2831        synchronized(User.class) {
    29             uidCounter--;
    30             return uidCounter;
     32            return uidCounter.decrementAndGet();
    3133        }
    3234    }
     
    6062    }
    6163
     64    /**
     65     * clears the static map of user ids to user objects
     66     *
     67     */
     68    public static void clearUserMap() {
     69        userMap.clear();
     70    }
    6271
    6372    /**
Note: See TracChangeset for help on using the changeset viewer.