Changeset 14344 in josm for trunk


Ignore:
Timestamp:
2018-10-17T17:25:28+02:00 (8 months ago)
Author:
Don-vip
Message:

fix #6524, fix #11240 - add synchronization in ChangesetListModel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListModel.java

    r12767 r14344  
    4141     * @return The selected changesets
    4242     */
    43     public Set<Changeset> getSelectedChangesets() {
     43    public synchronized Set<Changeset> getSelectedChangesets() {
    4444        Set<Changeset> ret = new HashSet<>();
    4545        for (int i = 0; i < getSize(); i++) {
     
    5555     * @return The selected ids
    5656     */
    57     public Set<Integer> getSelectedChangesetIds() {
     57    public synchronized Set<Integer> getSelectedChangesetIds() {
    5858        Set<Integer> ret = new HashSet<>();
    5959        for (int i = 0; i < getSize(); i++) {
     
    6969     * @param changesets The changesets
    7070     */
    71     public void setSelectedChangesets(Collection<Changeset> changesets) {
     71    public synchronized void setSelectedChangesets(Collection<Changeset> changesets) {
    7272        selectionModel.setValueIsAdjusting(true);
    7373        selectionModel.clearSelection();
     
    9191    }
    9292
    93     private void updateModel() {
     93    private synchronized void updateModel() {
    9494        Set<Changeset> sel = getSelectedChangesets();
    9595        data.clear();
     
    164164
    165165    @Override
    166     public Changeset getElementAt(int idx) {
     166    public synchronized Changeset getElementAt(int idx) {
    167167        return data.get(idx);
    168168    }
    169169
    170170    @Override
    171     public int getSize() {
     171    public synchronized int getSize() {
    172172        return data.size();
    173173    }
    174174
    175     protected void sort() {
     175    protected synchronized void sort() {
    176176        data.sort(Comparator.comparingInt(Changeset::getId).reversed());
    177177    }
     
    191191     * @return the selected open changesets
    192192     */
    193     public List<Changeset> getSelectedOpenChangesets() {
     193    public synchronized List<Changeset> getSelectedOpenChangesets() {
    194194        List<Changeset> ret = new ArrayList<>();
    195195        for (int i = 0; i < getSize(); i++) {
     
    208208    /* ---------------------------------------------------------------------------- */
    209209    @Override
    210     public void changesetCacheUpdated(ChangesetCacheEvent event) {
     210    public synchronized void changesetCacheUpdated(ChangesetCacheEvent event) {
    211211        Set<Changeset> sel = getSelectedChangesets();
    212212        for (Changeset cs: event.getAddedChangesets()) {
Note: See TracChangeset for help on using the changeset viewer.