Changeset 3503 in josm


Ignore:
Timestamp:
2010-08-31T12:39:49+02:00 (14 years ago)
Author:
bastiK
Message:

fixed #5067 - crash while uploading

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

Legend:

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

    r3479 r3503  
    6969    }
    7070
    71     private Storage<OsmPrimitive> allPrimitives = new Storage<OsmPrimitive>(new IdHash(), 16, true);
     71    private Storage<OsmPrimitive> allPrimitives = new Storage<OsmPrimitive>(new IdHash(), true);
    7272    private Map<PrimitiveId, OsmPrimitive> primitivesMap = allPrimitives.foreignKey(new IdHash());
    7373    private CopyOnWriteArrayList<DataSetListener> listeners = new CopyOnWriteArrayList<DataSetListener>();
  • trunk/src/org/openstreetmap/josm/data/osm/Storage.java

    r3453 r3503  
    9393    private transient volatile int modCount = 0;
    9494    private float loadFactor = 0.6f;
     95    private static final int DEFAULT_CAPACITY = 16;
    9596    private final boolean safeIterator;
    9697    private boolean arrayCopyNecessary;
    9798
    9899    public Storage() {
    99         this(Storage.<T>defaultHash());
     100        this(Storage.<T>defaultHash(), DEFAULT_CAPACITY, false);
    100101    }
    101102
     
    105106
    106107    public Storage(Hash<? super T,? super T> ha) {
    107         this(ha, 16, false);
    108     }
    109 
     108        this(ha, DEFAULT_CAPACITY, false);
     109    }
     110
     111    public Storage(boolean safeIterator) {
     112        this(Storage.<T>defaultHash(), DEFAULT_CAPACITY, safeIterator);
     113    }
     114
     115    public Storage(int capacity, boolean safeIterator) {
     116        this(Storage.<T>defaultHash(), capacity, safeIterator);
     117    }
     118
     119    public Storage(Hash<? super T,? super T> ha, boolean safeIterator) {
     120        this(ha, DEFAULT_CAPACITY, safeIterator);
     121    }
     122
     123    public Storage(Hash<? super T, ? super T> ha, int capacity) {
     124        this(ha, capacity, false);
     125    }
     126    /**
     127     * constructor
     128     * @param ha
     129     * @param capacity
     130     * @param safeIterator If set to false, you must not modify the Storage
     131     *          while iterating over it. If set to true, you can savely
     132     *          modify, but the read-only iteration will happen on a copy
     133     *          of the unmodified Storage.
     134     */
    110135    public Storage(Hash<? super T, ? super T> ha, int capacity, boolean safeIterator) {
    111136        this.hash = ha;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListModel.java

    r3206 r3503  
    2525
    2626    private final List<Changeset> data = new ArrayList<Changeset>();
    27     private final Storage<Changeset> shownChangesets = new Storage<Changeset>();
     27    private final Storage<Changeset> shownChangesets = new Storage<Changeset>(true);
    2828    private DefaultListSelectionModel selectionModel;
    2929
Note: See TracChangeset for help on using the changeset viewer.