Ignore:
Timestamp:
2014-08-27T17:40:39+02:00 (10 years ago)
Author:
bastiK
Message:

fixed #10425 - ConcurrentModificationException when auto update mappaint file

File:
1 edited

Legend:

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

    r7402 r7447  
    1818import org.openstreetmap.josm.gui.NavigatableComponent;
    1919import org.openstreetmap.josm.gui.mappaint.StyleCache.StyleList;
     20import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
    2021import org.openstreetmap.josm.gui.util.GuiHelper;
    2122import org.openstreetmap.josm.tools.Pair;
     
    446447     */
    447448    public static AreaElemStyle getAreaElemStyle(OsmPrimitive p, boolean pretendWayIsClosed) {
    448         if (MapPaintStyles.getStyles() == null)
     449        synchronized (MapCSSStyleSource.STYLE_SOURCE_LOCK) {
     450            if (MapPaintStyles.getStyles() == null)
     451                return null;
     452            for (ElemStyle s : MapPaintStyles.getStyles().generateStyles(p, 1.0, null, pretendWayIsClosed).a) {
     453                if (s instanceof AreaElemStyle)
     454                    return (AreaElemStyle) s;
     455            }
    449456            return null;
    450         for (ElemStyle s : MapPaintStyles.getStyles().generateStyles(p, 1.0, null, pretendWayIsClosed).a) {
    451             if (s instanceof AreaElemStyle)
    452                 return (AreaElemStyle) s;
    453         }
    454         return null;
     457        }
    455458    }
    456459
Note: See TracChangeset for help on using the changeset viewer.