[ofbiz-plugins] branch trunk updated: Improved: Replace anonymous types with lambda expressions(OFBIZ-11833)

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

[ofbiz-plugins] branch trunk updated: Improved: Replace anonymous types with lambda expressions(OFBIZ-11833)

Pawan Verma-2
This is an automated email from the ASF dual-hosted git repository.

pawan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 57fd870  Improved: Replace anonymous types with lambda expressions(OFBIZ-11833)
57fd870 is described below

commit 57fd870878f36311740e65f1a43f0de99d9919bd
Author: Pawan Verma <[hidden email]>
AuthorDate: Wed Jun 24 14:11:38 2020 +0530

    Improved: Replace anonymous types with lambda expressions(OFBIZ-11833)
---
 .../org/apache/ofbiz/ebaystore/EbayEvents.java     | 28 ++++++++++------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java
index 463326c..5081cf6 100644
--- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java
+++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java
@@ -415,14 +415,12 @@ public class EbayEvents {
                     }
                 }
                 //sort the cats list
-                Collections.sort(categories, new Comparator<Object>() {
-                    public int compare(Object a, Object b) {
-                        CategoryType cat1 = (CategoryType)a;
-                        CategoryType cat2 = (CategoryType)b;
-                        int catId1 = Integer.parseInt(cat1.getCategoryID());
-                        int catId2 = Integer.parseInt(cat2.getCategoryID());
-                        return catId1 - catId2;
-                    }
+                Collections.sort(categories, (Comparator<Object>) (a, b) -> {
+                    CategoryType cat1 = (CategoryType)a;
+                    CategoryType cat2 = (CategoryType)b;
+                    int catId1 = Integer.parseInt(cat1.getCategoryID());
+                    int catId2 = Integer.parseInt(cat2.getCategoryID());
+                    return catId1 - catId2;
                 });
             }
         }
@@ -469,14 +467,12 @@ public class EbayEvents {
                     }
                 }
                 //sort the cats list
-                Collections.sort(categories, new Comparator<Object>() {
-                    public int compare(Object a, Object b) {
-                        StoreCustomCategoryType cat1 = (StoreCustomCategoryType) a;
-                        StoreCustomCategoryType cat2 = (StoreCustomCategoryType) b;
-                        int catId1 = Integer.parseInt(Long.toString(cat1.getCategoryID()));
-                        int catId2 = Integer.parseInt(Long.toString(cat2.getCategoryID()));
-                        return catId1 - catId2;
-                    }
+                Collections.sort(categories, (Comparator<Object>) (a, b) -> {
+                    StoreCustomCategoryType cat1 = (StoreCustomCategoryType) a;
+                    StoreCustomCategoryType cat2 = (StoreCustomCategoryType) b;
+                    int catId1 = Integer.parseInt(Long.toString(cat1.getCategoryID()));
+                    int catId2 = Integer.parseInt(Long.toString(cat2.getCategoryID()));
+                    return catId1 - catId2;
                 });
             }
         }