Ignore:
Timestamp:
2016-05-15T12:43:59+02:00 (8 years ago)
Author:
Don-vip
Message:

findbugs - SE_BAD_FIELD_STORE + LI_LAZY_INIT_UPDATE_STATIC

Location:
trunk/src/org/openstreetmap/josm/data/validation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r10212 r10214  
    206206    }
    207207
    208     public static void initializeErrorLayer() {
     208    public static synchronized void initializeErrorLayer() {
    209209        if (!Main.pref.getBoolean(ValidatorPreference.PREF_LAYER, true))
    210210            return;
  • trunk/src/org/openstreetmap/josm/data/validation/util/Entities.java

    r10137 r10214  
    391391                        }
    392392                    } else { // escaped value content is an entity name
    393                         if (mapNameToValue == null) {
    394                             mapNameToValue = new HashMap<>();
    395                             for (String[] pair : ARRAY) {
    396                                 mapNameToValue.put(pair[0], pair[1]);
    397                             }
    398                         }
    399                         String value = mapNameToValue.get(entityContent);
     393                        String value = getMapNameToValue().get(entityContent);
    400394                        entityValue = value == null ? -1 : Integer.parseInt(value);
    401395                    }
     
    414408        return res.toString();
    415409    }
     410
     411    private static synchronized Map<String, String> getMapNameToValue() {
     412        if (mapNameToValue == null) {
     413            mapNameToValue = new HashMap<>();
     414            for (String[] pair : ARRAY) {
     415                mapNameToValue.put(pair[0], pair[1]);
     416            }
     417        }
     418        return mapNameToValue;
     419    }
    416420}
Note: See TracChangeset for help on using the changeset viewer.