svn commit: r1863442 - in /ofbiz/ofbiz-framework/trunk: applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ applications/party/src/main/java/org/apache/ofbiz/party/communication/ framework/base/src/main/java/org/apache/ofbiz/b...

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

svn commit: r1863442 - in /ofbiz/ofbiz-framework/trunk: applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ applications/party/src/main/java/org/apache/ofbiz/party/communication/ framework/base/src/main/java/org/apache/ofbiz/b...

mthl
Author: mthl
Date: Fri Jul 19 22:09:52 2019
New Revision: 1863442

URL: http://svn.apache.org/viewvc?rev=1863442&view=rev
Log:
Improved: Remove ‘UtilMisc#toList’
(OFBIZ-11140)

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java
    ofbiz/ofbiz-framework/trunk/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java
    ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java

Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java?rev=1863442&r1=1863441&r2=1863442&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java Fri Jul 19 22:09:52 2019
@@ -303,12 +303,10 @@ public final class ProductDisplayWorker
             return null;
         }
         if (values.size() == 0) {
-            return UtilMisc.toList(values);
+            return values;
         }
 
-        List<GenericValue> result = new LinkedList<>();
-        result.addAll(values);
-
+        List<GenericValue> result = new LinkedList<>(values);
         Collections.sort(result, new ProductByMapComparator(orderByMap, descending));
         return result;
     }

Modified: ofbiz/ofbiz-framework/trunk/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java?rev=1863442&r1=1863441&r2=1863442&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java Fri Jul 19 22:09:52 2019
@@ -1169,10 +1169,10 @@ public class CommunicationEventServices
                 emailAddressesBCC.add(((InternetAddress) element).getAddress());
             }
         }
-        String fromString = StringUtil.join(UtilMisc.toList(emailAddressesFrom), ",");
-        String toString = StringUtil.join(UtilMisc.toList(emailAddressesTo), ",");
-        String ccString = StringUtil.join(UtilMisc.toList(emailAddressesCC), ",");
-        String bccString = StringUtil.join(UtilMisc.toList(emailAddressesBCC), ",");
+        String fromString = StringUtil.join(emailAddressesFrom, ",");
+        String toString = StringUtil.join(emailAddressesTo, ",");
+        String ccString = StringUtil.join(emailAddressesCC, ",");
+        String bccString = StringUtil.join(emailAddressesBCC, ",");
 
         if (UtilValidate.isNotEmpty(fromString)) {
             commEventMap.put("fromString", fromString);

Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java?rev=1863442&r1=1863441&r2=1863442&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java Fri Jul 19 22:09:52 2019
@@ -368,18 +368,6 @@ public final class UtilMisc {
         return list;
     }
 
-    public static <T> List<T> toList(Collection<T> collection) {
-        if (collection == null) {
-            return null;
-        }
-        if (collection instanceof List<?>) {
-            return (List<T>) collection;
-        }
-        List<T> list = new LinkedList<>();
-        list.addAll(collection);
-        return list;
-    }
-
     public static <T> List<T> toListArray(T[] data) {
         if (data == null) {
             return null;