From 445b39af9e952966f5d2a004e5718f5c2ffdda58 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 10 Jul 2018 19:38:23 +0800 Subject: [PATCH 01/11] =?UTF-8?q?REPORT-9446=20=E3=80=9010.0=E4=B8=80?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91alphafine=E6=90=9C=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=E6=9C=AC=E5=9C=B0=E5=B8=B8=E7=94=A8=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/manager/impl/RecentSearchManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index 38df0fa0cd..ae937b53ea 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -14,6 +14,7 @@ import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; +import com.fr.stable.StableUtils; import com.fr.third.org.apache.lucene.analysis.Analyzer; import com.fr.third.org.apache.lucene.analysis.standard.StandardAnalyzer; import com.fr.third.org.apache.lucene.document.Document; @@ -115,7 +116,9 @@ public class RecentSearchManager implements AlphaFineSearchProvider { private void initReader() { if (indexReader == null) { try { - directory = FSDirectory.open(new File(path)); + File file = new File(path); + StableUtils.mkdirs(file); + directory = FSDirectory.open(file); indexReader = DirectoryReader.open(directory); } catch (IOException e) { FineLoggerFactory.getLogger().error("not privilege to read " + path); From 968865037144227b1615ca965e77640373514c1a Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 11 Jul 2018 16:33:25 +0800 Subject: [PATCH 02/11] =?UTF-8?q?CORE-91=20=E8=AE=BE=E8=AE=A1=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=8A=A8=E7=94=BB=E4=B8=8D=E9=87=8A=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/fx/FastGifImage.java | 10 +++++++++- .../src/main/java/com/fr/start/fx/SplashFxWindow.java | 7 +++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/fx/FastGifImage.java b/designer-realize/src/main/java/com/fr/start/fx/FastGifImage.java index 69d74c8a4b..9eb3ecef27 100644 --- a/designer-realize/src/main/java/com/fr/start/fx/FastGifImage.java +++ b/designer-realize/src/main/java/com/fr/start/fx/FastGifImage.java @@ -114,7 +114,7 @@ public class FastGifImage extends WritableImage { private static final class Animation { final WeakReference imageRef; final Timeline timeline; - final ImageLoader loader; + private ImageLoader loader; public Animation(final FastGifImage image, final ImageLoader loader) { this.loader = loader; @@ -141,6 +141,7 @@ public class FastGifImage extends WritableImage { public void stop() { timeline.stop(); + loader = null; } private void updateImage(final int frameIndex) { @@ -197,4 +198,11 @@ public class FastGifImage extends WritableImage { finishImage(new PrismImageLoader2(url, gifCount, (int) getRequestedWidth(), (int) getRequestedHeight(), isPreserveRatio(), isSmooth())); } + /** + * 销毁gif动画 + */ + public void destroy() { + animation.stop(); + } + } diff --git a/designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java b/designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java index 5b65ac882b..e863846695 100644 --- a/designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java +++ b/designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java @@ -9,7 +9,6 @@ import javafx.application.Application; import javafx.application.Platform; import javafx.geometry.Rectangle2D; import javafx.scene.Scene; -import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.AnchorPane; import javafx.scene.paint.Color; @@ -51,6 +50,7 @@ public class SplashFxWindow extends Application { private Text moduleInfo; private Text thanks; + private FastGifImage image; private List listeners = new ArrayList(); private static int uiScale(int i) { @@ -84,7 +84,7 @@ public class SplashFxWindow extends Application { public void start(Stage primaryStage) { AnchorPane root = new AnchorPane(); primaryStage.initStyle(StageStyle.TRANSPARENT); - Image image = new FastGifImage(SplashContext.SPLASH_PATH, FRAME_COUNT, WINDOW_WIDTH, WINDOW_HEIGHT); + image = new FastGifImage(SplashContext.SPLASH_PATH, FRAME_COUNT, WINDOW_WIDTH, WINDOW_HEIGHT); ImageView gif = new ImageView(image); @@ -129,6 +129,7 @@ public class SplashFxWindow extends Application { public void run() { try { ((Stage) moduleInfo.getScene().getWindow()).close(); + image.destroy(); fireSplashClose(); } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); @@ -181,8 +182,10 @@ public class SplashFxWindow extends Application { }); } + /** * 添加一个动画状态监听 + * * @param listener */ public void addSplashActionListener(SplashFxActionListener listener) { From 5430083bec2d25d1ef94441f6017b210a6e7abbf Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 11 Jul 2018 21:17:20 +0800 Subject: [PATCH 03/11] =?UTF-8?q?REPORT-9446=20=E3=80=9010.0=E4=B8=80?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91alphafine=E6=90=9C=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=E6=9C=AC=E5=9C=B0=E5=B8=B8=E7=94=A8=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/impl/RecentSearchManager.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index ae937b53ea..b67f4575f0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -63,6 +63,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { public synchronized static RecentSearchManager getInstance() { if (recentSearchManager == null) { recentSearchManager = new RecentSearchManager(); + recentSearchManager.initWriter(); } return recentSearchManager; } @@ -95,17 +96,13 @@ public class RecentSearchManager implements AlphaFineSearchProvider { * 初始化indexWriter */ private void initWriter() { - if (indexWriter == null) { - try { - directory = FSDirectory.open(new File(path)); - } catch (IOException e) { - FineLoggerFactory.getLogger().error("cannot open directory " + path); - } - try { - indexWriter = new IndexWriter(directory, config); - } catch (IOException e) { - FineLoggerFactory.getLogger().error("not privilege to write to" + path); - } + try { + File file = new File(path); + StableUtils.mkdirs(file); + directory = FSDirectory.open(file); + indexWriter = new IndexWriter(directory, config); + } catch (IOException e) { + FineLoggerFactory.getLogger().error("not privilege to write to" + path); } } @@ -116,9 +113,8 @@ public class RecentSearchManager implements AlphaFineSearchProvider { private void initReader() { if (indexReader == null) { try { - File file = new File(path); - StableUtils.mkdirs(file); - directory = FSDirectory.open(file); + indexWriter.close(); + directory = FSDirectory.open(new File(path)); indexReader = DirectoryReader.open(directory); } catch (IOException e) { FineLoggerFactory.getLogger().error("not privilege to read " + path); @@ -169,6 +165,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { private synchronized SearchResult searchBySort(String key) { recentModelList = new SearchResult(); try { + initReader(); IndexSearcher searcher = new IndexSearcher(indexReader); //构建排序字段 From 180c6a2b5975666c763c6698c3d4abc1681ed4c4 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 11 Jul 2018 21:54:59 +0800 Subject: [PATCH 04/11] rt --- .../alphafine/search/manager/impl/RecentSearchManager.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index b67f4575f0..1b47717992 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -97,9 +97,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { */ private void initWriter() { try { - File file = new File(path); - StableUtils.mkdirs(file); - directory = FSDirectory.open(file); + directory = FSDirectory.open(new File(path)); indexWriter = new IndexWriter(directory, config); } catch (IOException e) { FineLoggerFactory.getLogger().error("not privilege to write to" + path); From ad717854e62f173d9039d4e1d3a032f1532ed020 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 12 Jul 2018 08:20:29 +0800 Subject: [PATCH 05/11] bug fix --- .../manager/impl/RecentSearchManager.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index 1b47717992..299df64b00 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -100,7 +100,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { directory = FSDirectory.open(new File(path)); indexWriter = new IndexWriter(directory, config); } catch (IOException e) { - FineLoggerFactory.getLogger().error("not privilege to write to" + path); + FineLoggerFactory.getLogger().error(e.getMessage()); } } @@ -109,17 +109,14 @@ public class RecentSearchManager implements AlphaFineSearchProvider { * 初始化indexReader */ private void initReader() { - if (indexReader == null) { - try { - indexWriter.close(); - directory = FSDirectory.open(new File(path)); - indexReader = DirectoryReader.open(directory); - } catch (IOException e) { - FineLoggerFactory.getLogger().error("not privilege to read " + path); - } + try { + indexWriter.close(); + directory = FSDirectory.open(new File(path)); + indexReader = DirectoryReader.open(directory); indexSearcher = new IndexSearcher(indexReader); + } catch (IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage()); } - } /** From df96a59ba36b661cfff5a64bf2628bba616a89d9 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 12 Jul 2018 08:40:34 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E6=97=A0=E6=95=88import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/manager/impl/RecentSearchManager.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index 299df64b00..d9f131f768 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -14,7 +14,6 @@ import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; -import com.fr.stable.StableUtils; import com.fr.third.org.apache.lucene.analysis.Analyzer; import com.fr.third.org.apache.lucene.analysis.standard.StandardAnalyzer; import com.fr.third.org.apache.lucene.document.Document; @@ -111,7 +110,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { private void initReader() { try { indexWriter.close(); - directory = FSDirectory.open(new File(path)); indexReader = DirectoryReader.open(directory); indexSearcher = new IndexSearcher(indexReader); } catch (IOException e) { From 0d441cf8684e9c249f275848ea483d558cda5f90 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 12 Jul 2018 10:21:51 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/impl/ActionSearchManager.java | 12 +++++++----- .../search/manager/impl/DocumentSearchManager.java | 13 +++++++------ .../search/manager/impl/FileSearchManager.java | 14 ++++++++------ .../search/manager/impl/PluginSearchManager.java | 12 +++++++----- .../search/manager/impl/RecentSearchManager.java | 14 ++++++++------ .../manager/impl/RecommendSearchManager.java | 12 +++++++----- 6 files changed, 44 insertions(+), 33 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java index 0956fbc185..75c9c6dd05 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java @@ -22,16 +22,18 @@ import java.util.List; * Created by XiaXiang on 2017/3/27. */ public class ActionSearchManager implements AlphaFineSearchProvider { - private static ActionSearchManager actionSearchManager = null; + private static ActionSearchManager instance; private SearchResult filterModelList; private SearchResult lessModelList; private SearchResult moreModelList; - public synchronized static ActionSearchManager getInstance() { - if (actionSearchManager == null) { - actionSearchManager = new ActionSearchManager(); + public static ActionSearchManager getInstance() { + synchronized (ActionSearchManager.class) { + if (instance == null) { + instance = new ActionSearchManager(); + } } - return actionSearchManager; + return instance; } /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index 2fa777f038..790481866f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -20,16 +20,17 @@ import com.fr.stable.StringUtils; * Created by XiaXiang on 2017/3/27. */ public class DocumentSearchManager implements AlphaFineSearchProvider { - private static DocumentSearchManager documentSearchManager = null; + private static DocumentSearchManager instance; private SearchResult lessModelList; private SearchResult moreModelList; - public synchronized static DocumentSearchManager getInstance() { - if (documentSearchManager == null) { - documentSearchManager = new DocumentSearchManager(); - + public static DocumentSearchManager getInstance() { + synchronized (DocumentSearchManager.class) { + if (instance == null) { + instance = new DocumentSearchManager(); + } } - return documentSearchManager; + return instance; } /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index 82d98f9622..3cf991736c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -35,7 +35,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { private static final String DS_NAME = "dsname=\""; private static final String FRM_PREFIX = "k:frm "; private static final String CPT_PREFIX = "k:cpt "; - private static FileSearchManager fileSearchManager = null; + private static FileSearchManager fileSearchManager; private SearchResult filterModelList; private SearchResult lessModelList; private SearchResult moreModelList; @@ -47,15 +47,17 @@ public class FileSearchManager implements AlphaFineSearchProvider { private boolean isContainCpt = true; private boolean isContainFrm = true; - public synchronized static FileSearchManager getInstance() { - init(); + public static FileSearchManager getInstance() { + synchronized (FileSearchManager.class) { + if (fileSearchManager == null) { + fileSearchManager = new FileSearchManager(); + } + } return fileSearchManager; } public synchronized static void init() { - if (fileSearchManager == null) { - fileSearchManager = new FileSearchManager(); - } + } /** 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 ab3ce080df..7d57066d2e 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 @@ -26,16 +26,18 @@ import java.net.URLEncoder; * Created by XiaXiang on 2017/3/27. */ public class PluginSearchManager implements AlphaFineSearchProvider { - private static PluginSearchManager pluginSearchManager = null; + private static PluginSearchManager instance = null; private SearchResult lessModelList; private SearchResult moreModelList; - public synchronized static PluginSearchManager getInstance() { - if (pluginSearchManager == null) { - pluginSearchManager = new PluginSearchManager(); + public static PluginSearchManager getInstance() { + synchronized (PluginSearchManager.class) { + if (instance == null) { + instance = new PluginSearchManager(); + } } - return pluginSearchManager; + return instance; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index d9f131f768..c98e097540 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -45,7 +45,7 @@ import java.util.List; */ public class RecentSearchManager implements AlphaFineSearchProvider { private static final int MAX_SIZE = 3; - private static RecentSearchManager recentSearchManager = null; + private static RecentSearchManager instance; IndexReader indexReader = null; IndexSearcher indexSearcher = null; //索引存储路径 @@ -59,12 +59,14 @@ public class RecentSearchManager implements AlphaFineSearchProvider { private SearchResult recentModelList; private SearchResult modelList; - public synchronized static RecentSearchManager getInstance() { - if (recentSearchManager == null) { - recentSearchManager = new RecentSearchManager(); - recentSearchManager.initWriter(); + public static RecentSearchManager getInstance() { + synchronized (RecentSearchManager.class) { + if (instance == null) { + instance = new RecentSearchManager(); + instance.initWriter(); + } } - return recentSearchManager; + return instance; } @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 2dc1ee9c0f..8ec194f5b7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -26,15 +26,17 @@ import java.util.List; * Created by XiaXiang on 2017/3/31. */ public class RecommendSearchManager implements AlphaFineSearchProvider { - private static RecommendSearchManager recommendSearchManager = null; + private static RecommendSearchManager instance; private SearchResult modelList; private SearchResult recommendModelList; - public synchronized static RecommendSearchManager getInstance() { - if (recommendSearchManager == null) { - recommendSearchManager = new RecommendSearchManager(); + public static RecommendSearchManager getInstance() { + synchronized (RecentSearchManager.class) { + if (instance == null) { + instance = new RecommendSearchManager(); + } } - return recommendSearchManager; + return instance; } @Override From 3078c63358598382e9087851adae5df940455280 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 12 Jul 2018 10:34:37 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/manager/impl/DocumentSearchManager.java | 2 +- .../alphafine/search/manager/impl/FileSearchManager.java | 4 ++-- .../alphafine/search/manager/impl/PluginSearchManager.java | 4 ++-- .../alphafine/search/manager/impl/RecentSearchManager.java | 3 +++ .../alphafine/search/manager/impl/RecommendSearchManager.java | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index 790481866f..b565b4003c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -8,12 +8,12 @@ import com.fr.design.mainframe.alphafine.cell.model.DocumentModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; -import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index 3cf991736c..f1a9097501 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -116,7 +116,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { moreModelList.addAll(filterModelList.subList(AlphaFineConstants.SHOW_SIZE, filterModelList.size())); return moreModelList; } - + private void doSearch(String searchText, boolean needMore) { for (FileNode node : fileNodes) { boolean isAlreadyContain = false; @@ -232,7 +232,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { * @throws Exception */ private void listAll(String rootFilePath, List nodeList, boolean recurse) throws Exception { - + FileNode[] fns = FRContext.getFileNodes().list(rootFilePath); for (int i = 0; i < fns.length; i++) { FileNode fileNode = fns[i]; 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 7d57066d2e..3b9ce2951e 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 @@ -9,12 +9,12 @@ import com.fr.design.mainframe.alphafine.cell.model.PluginModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.general.ComparatorUtils; -import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.basic.version.Version; import com.fr.plugin.basic.version.VersionIntervalFactory; import com.fr.stable.StringUtils; @@ -41,7 +41,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { } - private static boolean isCompatibleCurrentEnv(String envVersion){ + private static boolean isCompatibleCurrentEnv(String envVersion) { return VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion()); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index c98e097540..bec85098db 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -121,6 +121,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { /** * 添加模型 + * * @param searchKey * @param cellModel * @param searchCount @@ -140,6 +141,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { /** * 写文档,建立索引 + * * @param doc */ private void writeDoc(Document doc) { @@ -154,6 +156,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { /** * 按序搜索 + * * @param key * @return */ diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 8ec194f5b7..2ecfb09035 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -10,12 +10,12 @@ import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; -import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; import com.fr.stable.CodeUtils; import com.fr.stable.StringUtils; From bd7d624f8e55a865d25cf9dfaf6676c0eb2d0c4c Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 12 Jul 2018 10:35:22 +0800 Subject: [PATCH 09/11] rt --- .../alphafine/search/manager/impl/PluginSearchManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3b9ce2951e..c8f5795077 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 @@ -26,7 +26,7 @@ import java.net.URLEncoder; * Created by XiaXiang on 2017/3/27. */ public class PluginSearchManager implements AlphaFineSearchProvider { - private static PluginSearchManager instance = null; + private static PluginSearchManager instance; private SearchResult lessModelList; private SearchResult moreModelList; From 72f61f756f89a24472ae01ffa288b2b89e6f6848 Mon Sep 17 00:00:00 2001 From: ju Date: Thu, 12 Jul 2018 13:05:46 +0800 Subject: [PATCH 10/11] =?UTF-8?q?REPORT-9632=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E9=80=89=E6=8B=A9webroot=E4=B8=8B=E7=9A=84=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98=20ResourceIOutils=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/file/FileNodeFILE.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index c77ce334ff..66a3c03bd0 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -198,7 +198,6 @@ public class FileNodeFILE implements FILE { return FRContext.getFileNodes().listWebRootFile(rootFilePath); } else { return FRContext.getFileNodes().list(rootFilePath); - } } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); From 8ec0890b788d756b751d1a9cce850d49b7d6ed70 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 12 Jul 2018 13:39:17 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=8F=8C=E6=A3=80=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/impl/ActionSearchManager.java | 8 +++++--- .../search/manager/impl/DocumentSearchManager.java | 8 +++++--- .../search/manager/impl/FileSearchManager.java | 12 +++++++----- .../search/manager/impl/PluginSearchManager.java | 8 +++++--- .../search/manager/impl/RecentSearchManager.java | 10 ++++++---- .../search/manager/impl/RecommendSearchManager.java | 8 +++++--- 6 files changed, 33 insertions(+), 21 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java index 75c9c6dd05..6bf8a9185a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java @@ -28,9 +28,11 @@ public class ActionSearchManager implements AlphaFineSearchProvider { private SearchResult moreModelList; public static ActionSearchManager getInstance() { - synchronized (ActionSearchManager.class) { - if (instance == null) { - instance = new ActionSearchManager(); + if (instance == null) { + synchronized (ActionSearchManager.class) { + if (instance == null) { + instance = new ActionSearchManager(); + } } } return instance; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index b565b4003c..a305d13416 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -25,9 +25,11 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { private SearchResult moreModelList; public static DocumentSearchManager getInstance() { - synchronized (DocumentSearchManager.class) { - if (instance == null) { - instance = new DocumentSearchManager(); + if (instance == null) { + synchronized (DocumentSearchManager.class) { + if (instance == null) { + instance = new DocumentSearchManager(); + } } } return instance; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index f1a9097501..0427a1393f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -35,7 +35,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { private static final String DS_NAME = "dsname=\""; private static final String FRM_PREFIX = "k:frm "; private static final String CPT_PREFIX = "k:cpt "; - private static FileSearchManager fileSearchManager; + private static FileSearchManager instance; private SearchResult filterModelList; private SearchResult lessModelList; private SearchResult moreModelList; @@ -48,12 +48,14 @@ public class FileSearchManager implements AlphaFineSearchProvider { private boolean isContainFrm = true; public static FileSearchManager getInstance() { - synchronized (FileSearchManager.class) { - if (fileSearchManager == null) { - fileSearchManager = new FileSearchManager(); + if (instance == null) { + synchronized (FileSearchManager.class) { + if (instance == null) { + instance = new FileSearchManager(); + } } } - return fileSearchManager; + return instance; } public synchronized static void init() { 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 c8f5795077..c0d6f796a6 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 @@ -32,9 +32,11 @@ public class PluginSearchManager implements AlphaFineSearchProvider { public static PluginSearchManager getInstance() { - synchronized (PluginSearchManager.class) { - if (instance == null) { - instance = new PluginSearchManager(); + if (instance == null) { + synchronized (PluginSearchManager.class) { + if (instance == null) { + instance = new PluginSearchManager(); + } } } return instance; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index bec85098db..64d22b99d5 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -60,10 +60,12 @@ public class RecentSearchManager implements AlphaFineSearchProvider { private SearchResult modelList; public static RecentSearchManager getInstance() { - synchronized (RecentSearchManager.class) { - if (instance == null) { - instance = new RecentSearchManager(); - instance.initWriter(); + if (instance == null) { + synchronized (RecentSearchManager.class) { + if (instance == null) { + instance = new RecentSearchManager(); + instance.initWriter(); + } } } return instance; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 2ecfb09035..4099cadbff 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -31,9 +31,11 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { private SearchResult recommendModelList; public static RecommendSearchManager getInstance() { - synchronized (RecentSearchManager.class) { - if (instance == null) { - instance = new RecommendSearchManager(); + if (instance == null) { + synchronized (RecentSearchManager.class) { + if (instance == null) { + instance = new RecommendSearchManager(); + } } } return instance;