You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by pa...@apache.org on 2020/06/27 19:52:35 UTC
[ofbiz-plugins] branch trunk updated: Improved: Replace
Collection.sort() with List.sort().(OFBIZ-11830)
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 8f14af2 Improved: Replace Collection.sort() with List.sort().(OFBIZ-11830)
8f14af2 is described below
commit 8f14af21c56c58e1b1754bb8eaa28fe5cc5979d9
Author: Pawan Verma <pa...@hotwaxsystems.com>
AuthorDate: Sun Jun 28 01:22:17 2020 +0530
Improved: Replace Collection.sort() with List.sort().(OFBIZ-11830)
---
.../src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java | 8 ++++----
.../java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java | 2 +-
pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java | 2 +-
3 files changed, 6 insertions(+), 6 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 3634e1a..b348f64 100644
--- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java
+++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java
@@ -415,9 +415,9 @@ public class EbayEvents {
}
}
//sort the cats list
- Collections.sort(categories, (Comparator<Object>) (a, b) -> {
- CategoryType cat1 = (CategoryType)a;
- CategoryType cat2 = (CategoryType)b;
+ categories.sort((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;
@@ -467,7 +467,7 @@ public class EbayEvents {
}
}
//sort the cats list
- Collections.sort(categories, (Comparator<Object>) (a, b) -> {
+ categories.sort((Comparator<Object>) (a, b) -> {
StoreCustomCategoryType cat1 = (StoreCustomCategoryType) a;
StoreCustomCategoryType cat2 = (StoreCustomCategoryType) b;
int catId1 = Integer.parseInt(Long.toString(cat1.getCategoryID()));
diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java
index 21069b3..d710592 100644
--- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java
+++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java
@@ -1358,7 +1358,7 @@ public class EbayStoreAutoPreferences {
if (acceptBestOfferIndexId.size() > 0) {
int quantityAvailable = inventoryQuantityItem;
- Collections.sort(acceptBestOfferIndexId);
+ acceptBestOfferIndexId.sort(null);
RespondToBestOfferCall respondAcceptBestOfferCall = new RespondToBestOfferCall(apiContext);
respondAcceptBestOfferCall.setItemID(itemID);
for (String bestOfferIdIndex : acceptBestOfferIndexId) {
diff --git a/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java b/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java
index bb9d98a..58656f9 100644
--- a/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java
+++ b/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java
@@ -1178,7 +1178,7 @@ public class HtmlReport extends AbstractReport {
if (getParamResourcelist(request) != null) {
// found the resourcelist parameter
resourceList = StringUtil.split(getParamResourcelist(request), DELIMITER_RESOURCES);
- Collections.sort(resourceList);
+ resourceList.sort(null);
} else {
// this is a single RESOURCE operation, create list containing the RESOURCE name
resourceList = new ArrayList<>(1);