Changeset 10997 in josm for trunk/src/org


Ignore:
Timestamp:
2016-09-13T14:47:35+02:00 (8 years ago)
Author:
michael2402
Message:

Make layer read access synchronized.

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
2 edited

Legend:

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

    r10985 r10997  
    280280     * @return The list of layers.
    281281     */
    282     public List<Layer> getLayers() {
     282    public synchronized List<Layer> getLayers() {
    283283        return Collections.unmodifiableList(new ArrayList<>(layers));
    284284    }
     
    295295     * @return an unmodifiable list of layers of a certain type.
    296296     */
    297     public <T extends Layer> List<T> getLayersOfType(Class<T> ofType) {
     297    public synchronized <T extends Layer> List<T> getLayersOfType(Class<T> ofType) {
    298298        return new ArrayList<>(Utils.filteredCollection(getLayers(), ofType));
    299299    }
     
    418418     * @since 10432
    419419     */
    420     public void resetState() {
     420    public synchronized void resetState() {
    421421        // some layer remove listeners remove other layers.
    422422        while (!getLayers().isEmpty()) {
  • trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java

    r10972 r10997  
    372372
    373373    @Override
    374     public void resetState() {
     374    public synchronized void resetState() {
    375375        // active and edit layer are unset automatically
    376376        super.resetState();
Note: See TracChangeset for help on using the changeset viewer.