Skip to content
Permalink
Browse files

Improved: Add missing ‘synchronized’ modifier

(OFBIZ-11004)

Overriding a synchronized method with a non-synchronized one can
introduce potential runtime concurrency bugs. Since
‘ExtendedProperties#loadFromXML’ is overridding
‘Properties#loadFromXML’ which is synchronized, it is safer to mark it
as synchonized.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858490 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed May 1, 2019
1 parent fedd720 commit 9a8b403bb33a380f04b4e696967d25ccf23faa35
Showing with 1 addition and 1 deletion.
  1. +1 −1 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java
@@ -1188,7 +1188,7 @@ public ExtendedProperties(URL url, Locale locale) throws IOException, InvalidPro
}
}
@Override
public void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException {
public synchronized void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException {
try {
xmlToProperties(in, null, this);
} finally {

0 comments on commit 9a8b403

Please sign in to comment.
You can’t perform that action at this time.