svn commit: r1805143 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java

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

svn commit: r1805143 - /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java

jleroux@apache.org
Author: jleroux
Date: Wed Aug 16 07:41:31 2017
New Revision: 1805143

URL: http://svn.apache.org/viewvc?rev=1805143&view=rev
Log:
Fixed: Collection added to itself
(OFBIZ-9578)

In a recent github mirror, I've found suspicious code.
Branch: master
path: framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java

...
1588         protected final List<String> messages = new LinkedList<String>();
...
1596         protected int updateData(Collection<String> messages) {
1597             if (messages != null && UtilValidate.isNotEmpty(this.messages)) {
1598                 messages.addAll(messages);
1599             }
1600             return count;
1601         }
1602     }

In Line 1598, `messages.addAll' should be `this.messages.addAll'?
This might not be an issue but I wanted to report this just in case.

Thanks: JC ([hidden email])for report

Modified:
    ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java

Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java?rev=1805143&r1=1805142&r2=1805143&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java Wed Aug 16 07:41:31 2017
@@ -1597,7 +1597,7 @@ public class DatabaseUtil {
 
         protected int updateData(Collection<String> messages) {
             if (messages != null && UtilValidate.isNotEmpty(this.messages)) {
-                messages.addAll(messages);
+                this.messages.addAll(messages);
             }
             return count;
         }