From c0c4f78e9fff0ad12f3c994c6fab19bcdeed1d0d Mon Sep 17 00:00:00 2001 From: Yann Date: Tue, 28 Feb 2023 16:52:47 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-86430=20AlphaFine=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E5=BF=83tab=E9=A1=B5=E6=98=BE=E7=A4=BA=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/impl/PluginSearchManager.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 08eecdde2b..fc39254cc8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -29,7 +29,7 @@ import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Map; -import java.util.function.ToLongFunction; +import java.util.function.Function; /** * Created by XiaXiang on 2017/3/27. @@ -204,18 +204,16 @@ public class PluginSearchManager implements AlphaFineSearchProvider { if (!Collections.isEmpty(jsonObjects)) { SimpleDateFormat format = new SimpleDateFormat(TIME_FORMAT); try { - jsonObjects.sort(Comparator.comparingLong(new ToLongFunction() { - @Override - public long applyAsLong(Map value) { - long time = 0L; - try { - time = format.parse((String) value.get(UPLOAD_TIME)).getTime(); - } catch (ParseException e) { - FineLoggerFactory.getLogger().error(e, e.getMessage()); - } - return time; + jsonObjects.sort((v1, v2) -> { + try { + long t1 = format.parse((String) v1.get(UPLOAD_TIME)).getTime(); + long t2 = format.parse((String) v2.get(UPLOAD_TIME)).getTime(); + return Long.compare(t2, t1); + } catch (ParseException e) { + FineLoggerFactory.getLogger().error(e, e.getMessage()); } - }).reversed()); + return 0; + }); } catch (Exception e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); }