Changeset 10214 in josm for trunk/src/org/openstreetmap


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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java

    r10047 r10214  
    9191    protected String oldModeHelpText;
    9292
    93     private final AbstractMapViewPaintable temporaryLayer = new AbstractMapViewPaintable() {
     93    private final transient AbstractMapViewPaintable temporaryLayer = new AbstractMapViewPaintable() {
    9494        @Override
    9595        public void paint(Graphics2D g, MapView mv, Bounds bbox) {
  • 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}
  • trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandler.java

    r10212 r10214  
    166166     * @param e the exception
    167167     */
    168     public static void handleException(final Throwable e) {
     168    public static synchronized void handleException(final Throwable e) {
    169169        if (handlingInProgress || suppressExceptionDialogs)
    170170            return;                  // we do not handle secondary exceptions, this gets too messy
Note: See TracChangeset for help on using the changeset viewer.