svn commit: r586835 - in /ofbiz/trunk/framework/service/src/org/ofbiz/service: ModelService.java eca/ServiceEcaSetField.java

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

svn commit: r586835 - in /ofbiz/trunk/framework/service/src/org/ofbiz/service: ModelService.java eca/ServiceEcaSetField.java

doogie-3
Author: doogie
Date: Sat Oct 20 20:08:06 2007
New Revision: 586835

URL: http://svn.apache.org/viewvc?rev=586835&view=rev
Log:
Don't use string addition.

Modified:
    ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
    ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=586835&r1=586834&r2=586835&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java Sat Oct 20 20:08:06 2007
@@ -461,13 +461,13 @@
         }
 
         if (verboseOn) {
-            String requiredNames = "";
+            StringBuilder requiredNames = new StringBuilder();
             Iterator requiredIter = requiredInfo.keySet().iterator();
             while (requiredIter.hasNext()) {
-                requiredNames = requiredNames + requiredIter.next();
-                if (requiredIter.hasNext()) {
-                    requiredNames = requiredNames + ", ";
+                if (requiredNames.length() > 0) {
+                    requiredNames.append(", ");
                 }
+                requiredNames.append(requiredIter.next());
             }
             Debug.logVerbose("[ModelService.validate] : required fields - " + requiredNames, module);
 

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java?rev=586835&r1=586834&r2=586835&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java Sat Oct 20 20:08:06 2007
@@ -76,12 +76,12 @@
 
         // string formats
         if ("append".equalsIgnoreCase(format) && envName != null) {
-            String newStr = "";
+            StringBuilder newStr = new StringBuilder();
             if (c.get(envName) != null) {
-                newStr = newStr + c.get(envName);
+                newStr.append(c.get(envName));
             }
-            newStr = newStr + s;
-            return newStr;
+            newStr.append(s);
+            return newStr.toString();
         }
         if ("to-upper".equalsIgnoreCase(format)) {
             return s.toUpperCase();