Changeset 8126 in josm for trunk/src


Ignore:
Timestamp:
2015-03-08T23:39:57+01:00 (5 years ago)
Author:
Don-vip
Message:

fix Sonar issue squid:S2444 - Lazy initialization of "static" fields should be "synchronized"

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r8072 r8126  
    154154     * Global application.
    155155     */
    156     public static Main main;
     156    public static volatile Main main;
    157157
    158158    /**
     
    191191     * The toolbar preference control to register new actions.
    192192     */
    193     public static ToolbarPreferences toolbar;
     193    public static volatile ToolbarPreferences toolbar;
    194194
    195195    /**
     
    468468     * to the JOSM team for inclusion.
    469469     */
    470     public static PlatformHook platform;
     470    public static volatile PlatformHook platform;
    471471
    472472    /**
     
    525525    }
    526526
    527     private static InitStatusListener initListener = null;
     527    private static volatile InitStatusListener initListener = null;
    528528
    529529    public static interface InitStatusListener {
     
    892892    public static final JPanel panel = new JPanel(new BorderLayout());
    893893
    894     protected static WindowGeometry geometry;
     894    protected static volatile WindowGeometry geometry;
    895895    protected static int windowState = JFrame.NORMAL;
    896896
     
    13051305     * Use {@link #setProjection(Projection)} in order to trigger a projection change event.
    13061306     */
    1307     private static Projection proj;
     1307    private static volatile Projection proj;
    13081308
    13091309    /**
     
    14811481        private static MasterWindowListener INSTANCE;
    14821482
    1483         public static MasterWindowListener getInstance() {
     1483        public static synchronized MasterWindowListener getInstance() {
    14841484            if (INSTANCE == null) {
    14851485                INSTANCE = new MasterWindowListener();
  • trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java

    r7859 r8126  
    3939 */
    4040public class ImageryAdjustAction extends MapMode implements MouseListener, MouseMotionListener, AWTEventListener{
    41     private static ImageryOffsetDialog offsetDialog;
     41    private static volatile ImageryOffsetDialog offsetDialog;
    4242    private static Cursor cursor = ImageProvider.getCursor("normal", "move");
    4343
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r8061 r8126  
    125125    }
    126126
    127     private static SearchSetting lastSearch = null;
     127    private static volatile SearchSetting lastSearch = null;
    128128
    129129    /**
  • trunk/src/org/openstreetmap/josm/corrector/CorrectionTable.java

    r6223 r8126  
    3232    }
    3333
    34     private static BoldRenderer boldRenderer = null;
     34    private static volatile BoldRenderer boldRenderer = null;
    3535
    3636    protected CorrectionTable(T correctionTableModel) {
  • trunk/src/org/openstreetmap/josm/data/Version.java

    r7033 r8126  
    5757     * @return the unique instance of the version information
    5858     */
    59     public static Version getInstance() {
     59    public static synchronized Version getInstance() {
    6060        if (instance == null) {
    6161            instance = new Version();
  • trunk/src/org/openstreetmap/josm/data/coor/CoordinateFormat.java

    r6883 r8126  
    4949    }
    5050
    51     private static CoordinateFormat defaultCoordinateFormat = DECIMAL_DEGREES;
     51    private static volatile CoordinateFormat defaultCoordinateFormat = DECIMAL_DEGREES;
    5252
    5353    /**
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java

    r7005 r8126  
    3535     * @return the unique instance of the history data set
    3636     */
    37     public static HistoryDataSet getInstance() {
     37    public static synchronized HistoryDataSet getInstance() {
    3838        if (historyDataSet == null) {
    3939            historyDataSet = new HistoryDataSet();
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java

    r7294 r8126  
    9191     * @return instance of map rending class
    9292     */
    93     public static MapRendererFactory getInstance() {
     93    public static synchronized MapRendererFactory getInstance() {
    9494        if (instance == null) {
    9595            instance = new MapRendererFactory();
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/PaintColors.java

    r6084 r8126  
    1010import org.openstreetmap.josm.data.Preferences.ColorKey;
    1111import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
     12import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintSylesUpdateListener;
    1213import org.openstreetmap.josm.gui.mappaint.StyleSource;
    13 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintSylesUpdateListener;
    1414
    1515public enum PaintColors implements ColorKey {
     
    3535    private final Color defaultColor;
    3636
    37     private static Color backgroundColorCache = null;
     37    private static volatile Color backgroundColorCache = null;
    3838
    3939    private static final MapPaintSylesUpdateListener styleOverrideListener = new MapPaintSylesUpdateListener() {
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java

    r7395 r8126  
    149149     */
    150150    private static MultipolygonRoleMatcher roleMatcher;
    151     private static MultipolygonRoleMatcher getMultipolygonRoleMatcher() {
     151    private static synchronized MultipolygonRoleMatcher getMultipolygonRoleMatcher() {
    152152        if (roleMatcher == null) {
    153153            roleMatcher = new MultipolygonRoleMatcher();
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r7834 r8126  
    7272public class OsmValidator implements LayerChangeListener {
    7373
    74     public static ValidatorLayer errorLayer = null;
     74    public static volatile ValidatorLayer errorLayer = null;
    7575
    7676    /** The validate action */
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java

    r8106 r8126  
    5757    protected static final int OUTER_STYLE = 1613;
    5858
    59     private static ElemStyles styles;
     59    private static volatile ElemStyles styles;
    6060
    6161    private final List<List<Node>> nonClosedWays = new ArrayList<>();
     
    222222                    } else {
    223223                        /* old style multipolygon - solve: copy tags from outer way to multipolygon */
    224                         addError(r, new TestError(this, Severity.WARNING, 
     224                        addError(r, new TestError(this, Severity.WARNING,
    225225                                trn("Multipolygon relation should be tagged with area tags and not the outer way",
    226226                                        "Multipolygon relation should be tagged with area tags and not the outer ways", polygon.getOuterWays().size()),
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r7268 r8126  
    7171
    7272    /** The spell check key substitutions: the key should be substituted by the value */
    73     private static Map<String, String> spellCheckKeyData;
     73    private static volatile Map<String, String> spellCheckKeyData;
    7474    /** The spell check preset values */
    75     private static MultiMap<String, String> presetsValueData;
     75    private static volatile MultiMap<String, String> presetsValueData;
    7676    /** The TagChecker data */
    7777    private static final List<CheckerData> checkerData = new ArrayList<>();
     
    364364                withErrors.put(p, "IPK");
    365365            }
    366             if (checkKeys && key.indexOf(' ') >= 0 && !withErrors.contains(p, "IPK")) {
     366            if (checkKeys && key != null && key.indexOf(' ') >= 0 && !withErrors.contains(p, "IPK")) {
    367367                errors.add( new TestError(this, Severity.WARNING, tr("Invalid white space in property key"),
    368368                        tr(s, key), MessageFormat.format(s, key), INVALID_KEY_SPACE, p) );
     
    379379                withErrors.put(p, "HTML");
    380380            }
    381             if (checkValues && value != null && value.length() > 0 && presetsValueData != null) {
     381            if (checkValues && key != null && value != null && value.length() > 0 && presetsValueData != null) {
    382382                final Set<String> values = presetsValueData.get(key);
    383383                final boolean keyInPresets = values != null;
     
    423423                }
    424424            }
    425             if (checkFixmes && value != null && value.length() > 0) {
     425            if (checkFixmes && key != null && value != null && value.length() > 0) {
    426426                if ((value.toLowerCase().contains("fixme")
    427427                        || value.contains("check and delete")
  • trunk/src/org/openstreetmap/josm/data/validation/util/Entities.java

    r7025 r8126  
    334334    };
    335335
    336     private static Map<String, String> mapNameToValue = null;
     336    private static volatile Map<String, String> mapNameToValue = null;
    337337
    338338    public String unescape(String str) {
  • trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java

    r7305 r8126  
    5959     * @return the unique instance of this formatter
    6060     */
    61     public static DefaultNameFormatter getInstance() {
     61    public static synchronized DefaultNameFormatter getInstance() {
    6262        if (instance == null) {
    6363            instance = new DefaultNameFormatter();
     
    109109     * @return the list of naming tags used in relations
    110110     */
    111     public static List<String> getNamingtagsForRelations() {
     111    public static synchronized List<String> getNamingtagsForRelations() {
    112112        if (namingTagsForRelations == null) {
    113113            namingTagsForRelations = new ArrayList<>(
  • trunk/src/org/openstreetmap/josm/gui/FileDrop.java

    r7005 r8126  
    280280    }   // end constructor
    281281
    282     private static boolean supportsDnD()
     282    private static synchronized boolean supportsDnD()
    283283    {   // Static Boolean
    284284        if( supportsDnD == null )
  • trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java

    r7434 r8126  
    5959     * @return the unique instance of the JOSM user identity manager
    6060     */
    61     public static JosmUserIdentityManager getInstance() {
     61    public static synchronized JosmUserIdentityManager getInstance() {
    6262        if (instance == null) {
    6363            instance = new JosmUserIdentityManager();
     
    283283            if (OsmApi.isUsingOAuth()) {
    284284                try {
    285                     instance.initFromOAuth(Main.parent);
     285                    getInstance().initFromOAuth(Main.parent);
    286286                } catch (Exception e) {
    287287                    Main.error(e);
  • trunk/src/org/openstreetmap/josm/gui/NotificationManager.java

    r8116 r8126  
    7676    private final Color PANEL_OPAQUE = new Color(224, 236, 249);
    7777
    78     public static NotificationManager getInstance() {
     78    public static synchronized NotificationManager getInstance() {
    7979        if (INSTANCE == null) {
    8080            INSTANCE = new NotificationManager();
  • trunk/src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java

    r7005 r8126  
    5959     * @return The unique instance of this dialog
    6060     */
    61     public static DeleteFromRelationConfirmationDialog getInstance() {
     61    public static synchronized DeleteFromRelationConfirmationDialog getInstance() {
    6262        if (instance == null) {
    6363            instance = new DeleteFromRelationConfirmationDialog();
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r7674 r8126  
    100100     */
    101101    @Deprecated
    102     public static CombinePrimitiveResolverDialog getInstance() {
     102    public static synchronized CombinePrimitiveResolverDialog getInstance() {
    103103        if (instance == null) {
    104104            GuiHelper.runInEDTAndWait(new Runnable() {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r7617 r8126  
    8080public class LayerListDialog extends ToggleDialog {
    8181    /** the unique instance of the dialog */
    82     private static LayerListDialog instance;
     82    private static volatile LayerListDialog instance;
    8383
    8484    /**
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java

    r7982 r8126  
    6969
    7070    /** the unique instance of the cache manager  */
    71     private static ChangesetCacheManager instance;
     71    private static volatile ChangesetCacheManager instance;
    7272
    7373    /**
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java

    r8071 r8126  
    6060     * @return the unique instance of the download dialog
    6161     */
    62     public static DownloadDialog getInstance() {
     62    public static synchronized DownloadDialog getInstance() {
    6363        if (instance == null) {
    6464            instance = new DownloadDialog(Main.parent);
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r7082 r8126  
    7272     * @return the unique instance of the help browser
    7373     */
    74     public static HelpBrowser getInstance() {
     74    public static synchronized HelpBrowser getInstance() {
    7575        if (instance == null) {
    7676            instance = new HelpBrowser();
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java

    r7528 r8126  
    3838     * @return the unique instance
    3939     */
    40     public static HistoryBrowserDialogManager getInstance() {
     40    public static synchronized HistoryBrowserDialogManager getInstance() {
    4141        if (instance == null) {
    4242            instance = new HistoryBrowserDialogManager();
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetCommentModel.java

    r6070 r8126  
    22package org.openstreetmap.josm.gui.io;
    33
     4import java.util.Objects;
    45import java.util.Observable;
    56
     
    78 * ChangesetCommentModel is an observable model for the changeset comment edited
    89 * in the {@link UploadDialog}.
    9  *
     10 * @since 3133
    1011 */
    1112public class ChangesetCommentModel extends Observable {
     
    1314
    1415    /**
    15      * Sets the current changeset comment and notifies observers if the comment
    16      * has changed.
     16     * Sets the current changeset comment and notifies observers if the comment has changed.
    1717     *
    1818     * @param comment the new upload comment. Empty string assumed if null.
     
    2121        String oldValue = this.comment;
    2222        this.comment = comment == null ? "" : comment;
    23         if (!oldValue.equals(this.comment)) {
     23        if (!Objects.equals(oldValue, this.comment)) {
    2424            setChanged();
    2525            notifyObservers(this.comment);
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r7375 r8126  
    7474     * @return the unique instance of the upload dialog
    7575     */
    76     public static UploadDialog getUploadDialog() {
     76    public static synchronized UploadDialog getUploadDialog() {
    7777        if (uploadDialog == null) {
    7878            uploadDialog = new UploadDialog();
  • trunk/src/org/openstreetmap/josm/gui/layer/JumpToMarkerActions.java

    r7937 r8126  
    2727    }
    2828
    29     private static JumpToNextMarker jumpToNextMarkerAction;
    30     private static JumpToPreviousMarker jumpToPreviousMarkerAction;
     29    private static volatile JumpToNextMarker jumpToNextMarkerAction;
     30    private static volatile JumpToPreviousMarker jumpToPreviousMarkerAction;
    3131
    3232    public static void initialize() {
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r8061 r8126  
    232232     * a paint texture for non-downloaded area
    233233     */
    234     private static TexturePaint hatched;
     234    private static volatile TexturePaint hatched;
    235235
    236236    static {
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r8061 r8126  
    902902    }
    903903
    904     private static List<MapMode> supportedMapModes = null;
     904    private static volatile List<MapMode> supportedMapModes = null;
    905905
    906906    /**
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    r8069 r8126  
    4949
    5050    // Only one instance of that class is present at one time
    51     private static ImageViewerDialog dialog;
     51    private static volatile ImageViewerDialog dialog;
    5252
    5353    private boolean collapseButtonClicked = false;
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/AudioMarker.java

    r8056 r8126  
    2323
    2424    private URL audioUrl;
    25     private static AudioMarker recentlyPlayedMarker = null;
     25    private static volatile AudioMarker recentlyPlayedMarker = null;
    2626    public double syncOffset;
    2727    public boolean timeFromAudio = false; // as opposed to from the GPX track
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java

    r7310 r8126  
    3838    private Timer timer = null;
    3939    private double animationInterval = 0.0; // seconds
    40     private static PlayHeadMarker playHead = null;
     40    private static volatile PlayHeadMarker playHead = null;
    4141    private MapMode oldMode = null;
    4242    private LatLon oldCoor;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/BoxTextElemStyle.java

    r8087 r8126  
    172172     * session. There should be preference listener updating this cache.
    173173     */
    174     private static Color DEFAULT_TEXT_COLOR = null;
     174    private static volatile Color DEFAULT_TEXT_COLOR = null;
    175175    private static void initDefaultParameters() {
    176176        if (DEFAULT_TEXT_COLOR != null) return;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java

    r8097 r8126  
    135135     * @see #getIconProvider()
    136136     */
    137     private static ImageProvider getDefaultIconProvider() {
     137    private static synchronized ImageProvider getDefaultIconProvider() {
    138138        if (defaultIconProvider == null) {
    139139            defaultIconProvider = new ImageProvider("dialogs/mappaint", "pencil");
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java

    r6643 r8126  
    2121     * @return The unique instance of {@code OAuthAccessTokenHolder}
    2222     */
    23     public static OAuthAccessTokenHolder getInstance() {
     23    public static synchronized OAuthAccessTokenHolder getInstance() {
    2424        if (instance == null) {
    2525            instance = new OAuthAccessTokenHolder();
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetNameTemplateList.java

    r7937 r8126  
    2121     * @return the unique instance
    2222     */
    23     public static TaggingPresetNameTemplateList getInstance() {
     23    public static synchronized TaggingPresetNameTemplateList getInstance() {
    2424        if (instance == null) {
    2525            instance = new TaggingPresetNameTemplateList();
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java

    r7937 r8126  
    4646    }
    4747
    48     private static File zipIcons = null;
     48    private static volatile File zipIcons = null;
    4949
    5050    /**
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java

    r7509 r8126  
    2525     * @return the unique instance of {@code TaggingPresetSearchDialog}.
    2626     */
    27     public static TaggingPresetSearchDialog getInstance() {
     27    public static synchronized TaggingPresetSearchDialog getInstance() {
    2828        if (instance == null) {
    2929            instance = new TaggingPresetSearchDialog();
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchPrimitiveDialog.java

    r7937 r8126  
    11package org.openstreetmap.josm.gui.tagging;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4
     5import java.awt.event.ActionEvent;
     6import java.awt.event.ActionListener;
     7import java.awt.event.KeyEvent;
     8import java.util.HashSet;
    29
    310import org.openstreetmap.josm.Main;
     
    714import org.openstreetmap.josm.tools.Shortcut;
    815import org.openstreetmap.josm.tools.Utils;
    9 
    10 import java.awt.event.ActionEvent;
    11 import java.awt.event.ActionListener;
    12 import java.awt.event.KeyEvent;
    13 import java.util.HashSet;
    14 
    15 import static org.openstreetmap.josm.tools.I18n.tr;
    1616
    1717/**
     
    2929     * @return the unique instance of {@code TaggingPresetSearchPrimitiveDialog}.
    3030     */
    31     public static TaggingPresetSearchPrimitiveDialog getInstance() {
     31    public static synchronized TaggingPresetSearchPrimitiveDialog getInstance() {
    3232        if (instance == null) {
    3333            instance = new TaggingPresetSearchPrimitiveDialog();
  • trunk/src/org/openstreetmap/josm/gui/util/FileFilterAllFiles.java

    r7937 r8126  
    1010/**
    1111 * A FileFilter that accepts all files.
     12 * @since 5572
    1213 */
    1314public class FileFilterAllFiles extends FileFilter {
     
    1516    private static FileFilterAllFiles INSTANCE;
    1617
    17     public static FileFilterAllFiles getInstance() {
     18    /**
     19     * Replies the unique instance.
     20     * @return the unique instance
     21     */
     22    public static synchronized FileFilterAllFiles getInstance() {
    1823        if (INSTANCE == null) {
    1924            INSTANCE = new FileFilterAllFiles();
  • trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItem.java

    r7937 r8126  
    1818public class StayOpenCheckBoxMenuItem extends JCheckBoxMenuItem {
    1919
    20   private static MenuElement[] path;
     20  private static volatile MenuElement[] path;
    2121
    2222  {
  • trunk/src/org/openstreetmap/josm/gui/util/StayOpenMenuItem.java

    r7937 r8126  
    1717public class StayOpenMenuItem extends JMenuItem {
    1818
    19   private static MenuElement[] path;
     19  private static volatile MenuElement[] path;
    2020
    2121  {
  • trunk/src/org/openstreetmap/josm/gui/util/StayOpenRadioButtonMenuItem.java

    r7937 r8126  
    1717public class StayOpenRadioButtonMenuItem extends JRadioButtonMenuItem {
    1818
    19   private static MenuElement[] path;
     19  private static volatile MenuElement[] path;
    2020
    2121  {
  • trunk/src/org/openstreetmap/josm/gui/widgets/AbstractFileChooser.java

    r7937 r8126  
    1616
    1717    /** The locale for both implementations */
    18     protected static Locale locale;
     18    protected static volatile Locale locale;
    1919
    2020    /**
  • trunk/src/org/openstreetmap/josm/io/MessageNotifier.java

    r7937 r8126  
    5050    private static final Runnable WORKER = new Worker();
    5151
    52     private static ScheduledFuture<?> task = null;
     52    private static volatile ScheduledFuture<?> task = null;
    5353
    5454    private static class Worker implements Runnable {
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r7869 r8126  
    5555
    5656    /** Used by plugins to register themselves as data postprocessors. */
    57     private static List<OsmServerReadPostprocessor> postprocessors;
     57    private static volatile List<OsmServerReadPostprocessor> postprocessors;
    5858
    5959    /** register a new postprocessor */
  • trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java

    r7656 r8126  
    3737    private Collection<OsmPrimitive> processed;
    3838
    39     private static List<OsmServerWritePostprocessor> postprocessors;
     39    private static volatile List<OsmServerWritePostprocessor> postprocessors;
    4040    public static void registerPostprocessor(OsmServerWritePostprocessor pp) {
    4141        if (postprocessors == null) {
  • trunk/src/org/openstreetmap/josm/io/OsmWriterFactory.java

    r7937 r8126  
    1717public class OsmWriterFactory {
    1818
    19     public static OsmWriterFactory theFactory;
     19    public static volatile OsmWriterFactory theFactory;
    2020    public static OsmWriter createOsmWriter(PrintWriter out, boolean osmConform, String version) {
    2121        // pre-set factory with this default implementation; can still be overwritten
  • trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java

    r7083 r8126  
    2020public class CredentialsManager implements CredentialsAgent {
    2121
    22     private static CredentialsManager instance;
     22    private static volatile CredentialsManager instance;
    2323
    2424    /**
  • trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java

    r7005 r8126  
    1616 */
    1717public final class DefaultAuthenticator extends Authenticator {
    18     private static DefaultAuthenticator instance;
     18    private static volatile DefaultAuthenticator instance;
    1919
    2020    /**
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java

    r7800 r8126  
    2323    private ServerSocket server;
    2424
    25     private static RemoteControlHttpServer instance;
     25    private static volatile RemoteControlHttpServer instance;
    2626
    2727    /**
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java

    r7937 r8126  
    7575    private ServerSocket server;
    7676
    77     private static RemoteControlHttpsServer instance;
     77    private static volatile RemoteControlHttpsServer instance;
    7878    private boolean initOK = false;
    7979    private SSLContext sslContext;
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r8074 r8126  
    566566     * @return the class loader
    567567     */
    568     public static DynamicURLClassLoader getPluginClassLoader() {
     568    public static synchronized DynamicURLClassLoader getPluginClassLoader() {
    569569        if (pluginClassLoader == null) {
    570570            pluginClassLoader = AccessController.doPrivileged(new PrivilegedAction<DynamicURLClassLoader>() {
  • trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java

    r7025 r8126  
    2626public final class AudioPlayer extends Thread {
    2727
    28     private static AudioPlayer audioPlayer = null;
     28    private static volatile AudioPlayer audioPlayer = null;
    2929
    3030    private enum State { INITIALIZING, NOTPLAYING, PLAYING, PAUSED, INTERRUPTED }
  • trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java

    r8018 r8126  
    4242
    4343    private static boolean handlingInProgress = false;
    44     private static BugReporterThread bugReporterThread = null;
     44    private static volatile BugReporterThread bugReporterThread = null;
    4545    private static int exceptionCounter = 0;
    4646    private static boolean suppressExceptionDialogs = false;
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r7901 r8126  
    7676    }
    7777
    78     private static PluralMode pluralMode = PluralMode.MODE_NOTONE; /* english default */
    79     private static String loadedCode = "en";
     78    private static volatile PluralMode pluralMode = PluralMode.MODE_NOTONE; /* english default */
     79    private static volatile String loadedCode = "en";
    8080
    8181    /* Localization keys for file chooser (and color chooser). */
     
    164164        "OptionPane.cancelButtonText"
    165165    };
    166     private static Map<String, String> strings = null;
    167     private static Map<String, String[]> pstrings = null;
     166    private static volatile Map<String, String> strings = null;
     167    private static volatile Map<String, String[]> pstrings = null;
    168168    private static Map<String, PluralMode> languages = new HashMap<>();
    169169
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r8102 r8126  
    13561356    }
    13571357
    1358     private static SVGUniverse getSvgUniverse() {
     1358    private static synchronized SVGUniverse getSvgUniverse() {
    13591359        if (svgUniverse == null) {
    13601360            svgUniverse = new SVGUniverse();
  • trunk/src/org/openstreetmap/josm/tools/MultikeyActionsHandler.java

    r7937 r8126  
    124124     * @return The unique instance of this class
    125125     */
    126     public static MultikeyActionsHandler getInstance() {
     126    public static synchronized MultikeyActionsHandler getInstance() {
    127127        if (instance == null) {
    128128            instance = new MultikeyActionsHandler();
  • trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java

    r7509 r8126  
    77import java.util.ArrayList;
    88import java.util.Collection;
     9
    910import org.openstreetmap.josm.data.coor.LatLon;
    1011import org.openstreetmap.josm.data.osm.BBox;
     
    4748    }
    4849
    49     private static Collection<Area> leftHandTrafficPolygons;
    50     private static GeoPropertyIndex<Boolean> rlCache;
     50    private static volatile Collection<Area> leftHandTrafficPolygons;
     51    private static volatile GeoPropertyIndex<Boolean> rlCache;
    5152
    5253    /**
Note: See TracChangeset for help on using the changeset viewer.