Issue #2861 added synchronized blocks where necessary

Change-Id: I86a483612f618b04c1ef938ebc8f95decb496811

Former-commit-id: 10bfa59aef [formerly 1c019671d35dc4d544fa9ceaeabe0a075e3e5ede]
Former-commit-id: b5ed7ac361
This commit is contained in:
Max Schenkelberg 2014-03-05 13:51:06 -06:00
parent a2b3bc717e
commit 0fbc2df17d

View file

@ -100,7 +100,7 @@ public class HierarchicalPreferenceStore implements IPersistentPreferenceStore {
this.config = new XMLConfiguration(); this.config = new XMLConfiguration();
} }
public XMLConfiguration accessConfiguration() { public synchronized XMLConfiguration accessConfiguration() {
if (loaded == false) { if (loaded == false) {
// Loaded flag is used for first access // Loaded flag is used for first access
loaded = true; loaded = true;
@ -122,10 +122,6 @@ public class HierarchicalPreferenceStore implements IPersistentPreferenceStore {
return dirty; return dirty;
} }
public LocalizationFile getFile() {
return file;
}
public void save() throws LocalizationException { public void save() throws LocalizationException {
if (isDirty()) { if (isDirty()) {
LocalizationFileOutputStream out = file.openOutputStream(); LocalizationFileOutputStream out = file.openOutputStream();
@ -220,7 +216,7 @@ public class HierarchicalPreferenceStore implements IPersistentPreferenceStore {
this.defaultPersistLevel = defaultLevel; this.defaultPersistLevel = defaultLevel;
} }
private MapConfiguration getDefaultConfig() { private synchronized MapConfiguration getDefaultConfig() {
if (defaults == null) { if (defaults == null) {
defaults = new MapConfiguration(new HashMap<String, Object>()); defaults = new MapConfiguration(new HashMap<String, Object>());
// Populate defaults with base first, setDefault* method will // Populate defaults with base first, setDefault* method will