Merge "Issue #2861 added synchronized blocks where necessary" into development

Former-commit-id: e108aa41bb586593f50970da53109a82d2bb8452
This commit is contained in:
Nate Jensen 2014-03-05 14:14:25 -06:00 committed by Gerrit Code Review
commit 59dcb3a97d

View file

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