svn commit: r1858930 - /ofbiz/branches/release16.11/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1858930 - /ofbiz/branches/release16.11/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java

mthl
Author: mthl
Date: Wed May  8 15:22:19 2019
New Revision: 1858930

URL: http://svn.apache.org/viewvc?rev=1858930&view=rev
Log:
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.

Modified:
    ofbiz/branches/release16.11/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java

Modified: ofbiz/branches/release16.11/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java?rev=1858930&r1=1858929&r2=1858930&view=diff
==============================================================================
--- ofbiz/branches/release16.11/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java (original)
+++ ofbiz/branches/release16.11/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java Wed May  8 15:22:19 2019
@@ -1162,7 +1162,7 @@ public final class UtilProperties implem
             }
         }
         @Override
-        public void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException {
+        public synchronized void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException {
             try {
                 xmlToProperties(in, null, this);
             } finally {