Browse Source

提升alphafine代码质量

research/10.0
alex.sung 6 years ago
parent
commit
334a62c065
  1. 92
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  2. 92
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java
  3. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java
  4. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
  5. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
  6. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java
  7. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java
  8. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java
  9. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java
  10. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java
  11. 9
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java
  12. 12
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java

92
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -18,11 +18,11 @@ public class AlphaFineConfigManager implements XMLable {
/**
* 是否开启alphafine
*/
private boolean isEnabled = true;
private boolean enabled = true;
/**
* 是否联网搜索
*/
private boolean isSearchOnLine = true;
private boolean searchOnLine = true;
/**
* 搜索范围
@ -34,27 +34,27 @@ public class AlphaFineConfigManager implements XMLable {
/**
* 猜您需要
*/
private boolean isContainRecommend = true;
private boolean containRecommend = true;
/**
* 设置
*/
private boolean isContainAction = true;
private boolean containAction = true;
/**
* 帮助文档
*/
private boolean isContainDocument = true;
private boolean containDocument = true;
/**
* 模板
*/
private boolean isContainTemplate = true;
private boolean containTemplate = true;
/**
* 模板内容
*/
private boolean isContainFileContent;
private boolean containFileContent;
/**
* 应用中心
*/
private boolean isContainPlugin = true;
private boolean containPlugin = true;
/**
* 分词搜索
*/
@ -70,7 +70,7 @@ public class AlphaFineConfigManager implements XMLable {
/**
* 是否提醒
*/
private boolean isNeedRemind = true;
private boolean needRemind = true;
/**
* 直接操作菜单次数
*/
@ -94,18 +94,18 @@ public class AlphaFineConfigManager implements XMLable {
@Override
public void readXML(XMLableReader reader) {
if (reader.isAttr()) {
this.setEnabled(reader.getAttrAsBoolean("isEnabled", true));
this.setSearchOnLine(reader.getAttrAsBoolean("isSearchOnline", true));
this.setContainPlugin(reader.getAttrAsBoolean("isContainDocument", true));
this.setContainDocument(reader.getAttrAsBoolean("isContainDocument", true));
this.setContainRecommend(reader.getAttrAsBoolean("isContainRecommend", true));
this.setContainAction(reader.getAttrAsBoolean("isContainAction", true));
this.setContainTemplate(reader.getAttrAsBoolean("isContainTemplate", true));
this.setContainFileContent(reader.getAttrAsBoolean("isContainFileContent", false));
this.setEnabled(reader.getAttrAsBoolean("enabled", true));
this.setSearchOnLine(reader.getAttrAsBoolean("searchOnline", true));
this.setContainPlugin(reader.getAttrAsBoolean("containDocument", true));
this.setContainDocument(reader.getAttrAsBoolean("containDocument", true));
this.setContainRecommend(reader.getAttrAsBoolean("containRecommend", true));
this.setContainAction(reader.getAttrAsBoolean("containAction", true));
this.setContainTemplate(reader.getAttrAsBoolean("containTemplate", true));
this.setContainFileContent(reader.getAttrAsBoolean("containFileContent", false));
this.setNeedSegmentationCheckbox(reader.getAttrAsBoolean("needSegmentationCheckbox", true));
this.setNeedIntelligentCustomerService(reader.getAttrAsBoolean("needIntelligentCustomerService", true));
this.setShortcuts(reader.getAttrAsString("shortcuts", getDefaultShortCuts()));
this.setNeedRemind(reader.getAttrAsBoolean("isNeedRemind", true));
this.setNeedRemind(reader.getAttrAsBoolean("needRemind", true));
this.setOperateCount(reader.getAttrAsInt("operateCount", 0));
}
@ -115,16 +115,16 @@ public class AlphaFineConfigManager implements XMLable {
@Override
public void writeXML(XMLPrintWriter writer) {
writer.startTAG("AlphaFineConfigManager");
writer.attr("isEnabled", this.isEnabled())
.attr("isSearchOnline", this.isSearchOnLine())
writer.attr("enabled", this.isEnabled())
.attr("searchOnline", this.isSearchOnLine())
.attr("shortcuts", this.getShortcuts())
.attr("isContainRecommend", this.isContainRecommend())
.attr("isContainAction", this.isContainAction())
.attr("isContainDocument", this.isContainDocument())
.attr("isContainTemplate", this.isContainTemplate())
.attr("isContainPlugin", this.isContainPlugin())
.attr("isContainFileContent", this.isContainFileContent())
.attr("isNeedRemind", this.isNeedRemind())
.attr("containRecommend", this.isContainRecommend())
.attr("containAction", this.isContainAction())
.attr("containDocument", this.isContainDocument())
.attr("containTemplate", this.isContainTemplate())
.attr("containPlugin", this.isContainPlugin())
.attr("containFileContent", this.isContainFileContent())
.attr("needRemind", this.isNeedRemind())
.attr("operateCount", this.getOperateCount())
.attr("needSegmentationCheckbox", this.isNeedSegmentationCheckbox())
.attr("needIntelligentCustomerService", this.isNeedIntelligentCustomerService());
@ -132,11 +132,11 @@ public class AlphaFineConfigManager implements XMLable {
}
public boolean isSearchOnLine() {
return isSearchOnLine;
return searchOnLine;
}
public void setSearchOnLine(boolean searchOnLine) {
isSearchOnLine = searchOnLine;
this.searchOnLine = searchOnLine;
}
public String getShortcuts() {
@ -161,51 +161,51 @@ public class AlphaFineConfigManager implements XMLable {
}
public boolean isContainAction() {
return isContainAction;
return containAction;
}
public void setContainAction(boolean containAction) {
this.isContainAction = containAction;
this.containAction = containAction;
}
public boolean isContainDocument() {
return isContainDocument;
return containDocument;
}
public void setContainDocument(boolean containDocument) {
this.isContainDocument = containDocument;
this.containDocument = containDocument;
}
public boolean isContainTemplate() {
return isContainTemplate;
return containTemplate;
}
public void setContainTemplate(boolean containTemplate) {
this.isContainTemplate = containTemplate;
this.containTemplate = containTemplate;
}
public boolean isContainPlugin() {
return isContainPlugin;
return containPlugin;
}
public void setContainPlugin(boolean containPlugin) {
this.isContainPlugin = containPlugin;
this.containPlugin = containPlugin;
}
public boolean isContainRecommend() {
return isContainRecommend;
return containRecommend;
}
public void setContainRecommend(boolean containConclude) {
isContainRecommend = containConclude;
this.containRecommend = containConclude;
}
public boolean isEnabled() {
return isEnabled;
return enabled;
}
public void setEnabled(boolean isEnabled) {
this.isEnabled = isEnabled;
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public KeyStroke getShortCutKeyStore() {
@ -224,19 +224,19 @@ public class AlphaFineConfigManager implements XMLable {
}
public boolean isContainFileContent() {
return isContainFileContent;
return containFileContent;
}
public void setContainFileContent(boolean containFileContent) {
isContainFileContent = containFileContent;
this.containFileContent = containFileContent;
}
public boolean isNeedRemind() {
return isNeedRemind;
return needRemind;
}
public void setNeedRemind(boolean needRemind) {
isNeedRemind = needRemind;
this.needRemind = needRemind;
}
public boolean isNeedSegmentationCheckbox() {

92
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java

@ -55,7 +55,7 @@ public class AlphaFineConfigPane extends BasicPane {
private static final double COLUMN_GAP = 180;
private static final double ROW_GAP = 25;
private KeyStroke shortCutKeyStore = null;
private UICheckBox isEnabledCheckbox, isSearchOnlineCheckbox, needSegmentationCheckbox, needIntelligentCustomerService, isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox, isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox;
private UICheckBox enabledCheckbox, searchOnlineCheckbox, needSegmentationCheckbox, needIntelligentCustomerService, containRecommendCheckbox, containActionCheckbox, containDocumentCheckbox, containTemplateCheckbox, containPluginCheckbox, containFileContentCheckbox;
private UITextField shortcutsField;
public AlphaFineConfigPane() {
@ -75,8 +75,8 @@ public class AlphaFineConfigPane extends BasicPane {
private Component[][] initSearchRangeComponents() {
Component[][] components = new Component[][]{
new Component[]{isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox},
new Component[]{isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox},
new Component[]{containRecommendCheckbox, containActionCheckbox, containDocumentCheckbox},
new Component[]{containTemplateCheckbox, containPluginCheckbox, containFileContentCheckbox},
new Component[]{needIntelligentCustomerService, null, null}
};
return components;
@ -84,7 +84,7 @@ public class AlphaFineConfigPane extends BasicPane {
private Component[][] initOnlineComponents() {
Component[][] components = new Component[][]{
new Component[]{isSearchOnlineCheckbox, needSegmentationCheckbox, null}
new Component[]{searchOnlineCheckbox, needSegmentationCheckbox, null}
};
return components;
}
@ -95,12 +95,12 @@ public class AlphaFineConfigPane extends BasicPane {
double[] columnSize = {COLUMN_GAP, COLUMN_GAP, COLUMN_GAP};
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Range"));
isContainRecommendCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Recommend"));
isContainActionCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set"));
isContainPluginCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon"));
isContainDocumentCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"));
isContainTemplateCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Templates"));
isContainFileContentCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Templates_Content"));
containRecommendCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Recommend"));
containActionCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set"));
containPluginCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon"));
containDocumentCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"));
containTemplateCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Templates"));
containFileContentCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Templates_Content"));
needIntelligentCustomerService = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Intelligent_Customer_Service"));
JPanel searchConfigPane = TableLayoutHelper.createTableLayoutPane(initSearchRangeComponents(), rowSize, columnSize);
northPane.add(searchConfigPane);
@ -147,24 +147,24 @@ public class AlphaFineConfigPane extends BasicPane {
private void createOnlinePane(JPanel contentPane) {
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Type"));
isSearchOnlineCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Internet_Search"));
searchOnlineCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Internet_Search"));
needSegmentationCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Segmentation"));
isSearchOnlineCheckbox.addActionListener(new ActionListener() {
searchOnlineCheckbox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (!isSearchOnlineCheckbox.isSelected()) {
isContainRecommendCheckbox.setEnabled(false);
isContainPluginCheckbox.setEnabled(false);
isContainDocumentCheckbox.setEnabled(false);
if (!searchOnlineCheckbox.isSelected()) {
containRecommendCheckbox.setEnabled(false);
containPluginCheckbox.setEnabled(false);
containDocumentCheckbox.setEnabled(false);
needIntelligentCustomerService.setEnabled(false);
isContainRecommendCheckbox.setSelected(false);
isContainPluginCheckbox.setSelected(false);
isContainDocumentCheckbox.setSelected(false);
containRecommendCheckbox.setSelected(false);
containPluginCheckbox.setSelected(false);
containDocumentCheckbox.setSelected(false);
needIntelligentCustomerService.setSelected(false);
} else {
isContainRecommendCheckbox.setEnabled(true);
isContainPluginCheckbox.setEnabled(true);
isContainDocumentCheckbox.setEnabled(true);
containRecommendCheckbox.setEnabled(true);
containPluginCheckbox.setEnabled(true);
containDocumentCheckbox.setEnabled(true);
needIntelligentCustomerService.setEnabled(true);
}
}
@ -178,8 +178,8 @@ public class AlphaFineConfigPane extends BasicPane {
private void createOpenPane(JPanel contentPane) {
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable"));
isEnabledCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_AlphaFine"));
northPane.add(isEnabledCheckbox);
enabledCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_AlphaFine"));
northPane.add(enabledCheckbox);
contentPane.add(northPane);
}
@ -189,18 +189,18 @@ public class AlphaFineConfigPane extends BasicPane {
}
public void populate(AlphaFineConfigManager alphaFineConfigManager) {
this.isEnabledCheckbox.setSelected(alphaFineConfigManager.isEnabled());
this.isSearchOnlineCheckbox.setEnabled(FRContext.isChineseEnv());
this.isSearchOnlineCheckbox.setSelected(alphaFineConfigManager.isSearchOnLine());
this.isContainActionCheckbox.setSelected(alphaFineConfigManager.isContainAction());
this.isContainTemplateCheckbox.setSelected(alphaFineConfigManager.isContainTemplate());
this.isContainFileContentCheckbox.setSelected(alphaFineConfigManager.isContainFileContent());
this.isContainDocumentCheckbox.setSelected(alphaFineConfigManager.isContainDocument() && alphaFineConfigManager.isSearchOnLine());
this.isContainDocumentCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.isContainPluginCheckbox.setSelected(alphaFineConfigManager.isContainPlugin() && alphaFineConfigManager.isSearchOnLine());
this.isContainPluginCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.isContainRecommendCheckbox.setSelected(alphaFineConfigManager.isContainRecommend() && alphaFineConfigManager.isSearchOnLine());
this.isContainRecommendCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.enabledCheckbox.setSelected(alphaFineConfigManager.isEnabled());
this.searchOnlineCheckbox.setEnabled(FRContext.isChineseEnv());
this.searchOnlineCheckbox.setSelected(alphaFineConfigManager.isSearchOnLine());
this.containActionCheckbox.setSelected(alphaFineConfigManager.isContainAction());
this.containTemplateCheckbox.setSelected(alphaFineConfigManager.isContainTemplate());
this.containFileContentCheckbox.setSelected(alphaFineConfigManager.isContainFileContent());
this.containDocumentCheckbox.setSelected(alphaFineConfigManager.isContainDocument() && alphaFineConfigManager.isSearchOnLine());
this.containDocumentCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.containPluginCheckbox.setSelected(alphaFineConfigManager.isContainPlugin() && alphaFineConfigManager.isSearchOnLine());
this.containPluginCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.containRecommendCheckbox.setSelected(alphaFineConfigManager.isContainRecommend() && alphaFineConfigManager.isSearchOnLine());
this.containRecommendCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.shortcutsField.setText(getDisplayShortCut(alphaFineConfigManager.getShortcuts()));
this.needSegmentationCheckbox.setSelected(alphaFineConfigManager.isNeedSegmentationCheckbox());
@ -212,14 +212,14 @@ public class AlphaFineConfigPane extends BasicPane {
public void update() {
DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager();
AlphaFineConfigManager alphaFineConfigManager = designerEnvManager.getAlphaFineConfigManager();
alphaFineConfigManager.setContainPlugin(this.isContainPluginCheckbox.isSelected());
alphaFineConfigManager.setContainAction(this.isContainActionCheckbox.isSelected());
alphaFineConfigManager.setContainDocument(this.isContainDocumentCheckbox.isSelected());
alphaFineConfigManager.setContainRecommend(this.isContainRecommendCheckbox.isSelected());
alphaFineConfigManager.setEnabled(this.isEnabledCheckbox.isSelected());
alphaFineConfigManager.setSearchOnLine(this.isSearchOnlineCheckbox.isSelected());
alphaFineConfigManager.setContainTemplate(this.isContainTemplateCheckbox.isSelected());
alphaFineConfigManager.setContainFileContent(this.isContainFileContentCheckbox.isSelected());
alphaFineConfigManager.setContainPlugin(this.containPluginCheckbox.isSelected());
alphaFineConfigManager.setContainAction(this.containActionCheckbox.isSelected());
alphaFineConfigManager.setContainDocument(this.containDocumentCheckbox.isSelected());
alphaFineConfigManager.setContainRecommend(this.containRecommendCheckbox.isSelected());
alphaFineConfigManager.setEnabled(this.enabledCheckbox.isSelected());
alphaFineConfigManager.setSearchOnLine(this.searchOnlineCheckbox.isSelected());
alphaFineConfigManager.setContainTemplate(this.containTemplateCheckbox.isSelected());
alphaFineConfigManager.setContainFileContent(this.containFileContentCheckbox.isSelected());
alphaFineConfigManager.setNeedSegmentationCheckbox(this.needSegmentationCheckbox.isSelected());
alphaFineConfigManager.setNeedIntelligentCustomerService(this.needIntelligentCustomerService.isSelected());
alphaFineConfigManager.setShortcuts(shortCutKeyStore != null ? shortCutKeyStore.toString().replace(TYPE, DISPLAY_TYPE) : this.shortcutsField.getText());
@ -255,10 +255,10 @@ public class AlphaFineConfigPane extends BasicPane {
}
public UICheckBox getIsContainFileContentCheckbox() {
return isContainFileContentCheckbox;
return containFileContentCheckbox;
}
public void setIsContainFileContentCheckbox(UICheckBox isContainFileContentCheckbox) {
this.isContainFileContentCheckbox = isContainFileContentCheckbox;
this.containFileContentCheckbox = isContainFileContentCheckbox;
}
}

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java

@ -23,7 +23,7 @@ import java.util.List;
* Created by XiaXiang on 2017/3/27.
*/
public class ActionSearchManager implements AlphaFineSearchProvider {
private static ActionSearchManager instance;
private static volatile ActionSearchManager instance;
private SearchResult filterModelList;
private SearchResult lessModelList;
private SearchResult moreModelList;

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java

@ -12,10 +12,8 @@ import com.fr.json.JSONObject;
import com.fr.json.JSONTokener;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import org.apache.commons.codec.digest.DigestUtils;
import java.io.IOException;
//import com.fr.third.org.apache.commons.codec.digest.DigestUtils;
import com.fr.third.org.apache.commons.codec.digest.DigestUtils;
/**
@ -23,7 +21,7 @@ import java.io.IOException;
*/
public class ComplementAdviceManager {
private static ComplementAdviceManager instance;
private static volatile ComplementAdviceManager instance;
private volatile SearchResult allModelList;
public static ComplementAdviceManager getInstance() {

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java

@ -21,7 +21,7 @@ import java.io.IOException;
* Created by XiaXiang on 2017/3/27.
*/
public class DocumentSearchManager implements AlphaFineSearchProvider {
private static DocumentSearchManager instance;
private static volatile DocumentSearchManager instance;
private SearchResult lessModelList;
private SearchResult moreModelList;

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

@ -25,7 +25,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 instance;
private static volatile FileSearchManager instance;
private SearchResult filterModelList;
private SearchResult lessModelList;
private SearchResult moreModelList;

8
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java

@ -24,7 +24,7 @@ import java.util.Map;
* Created by alex.sung on 2018/8/3.
*/
public class HotIssuesManager {
private static HotIssuesManager instance;
private static volatile HotIssuesManager instance;
private static final int HOT_ITEM_NUM = 6;
private static final int HOT_SUB_ITEM_NUM = 4;
private static final String HOT_ITEM = "item";
@ -33,10 +33,14 @@ public class HotIssuesManager {
private static final String HOT_TYPE = "type";
private static final String HOT_DATA = "data";
public static synchronized HotIssuesManager getInstance() {
public static HotIssuesManager getInstance() {
if (instance == null) {
synchronized (HotIssuesManager.class) {
if (instance == null) {
instance = new HotIssuesManager();
}
}
}
return instance;
}

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

@ -27,7 +27,7 @@ import java.net.URLEncoder;
* Created by XiaXiang on 2017/3/27.
*/
public class PluginSearchManager implements AlphaFineSearchProvider {
private static PluginSearchManager instance;
private static volatile PluginSearchManager instance;
private SearchResult lessModelList;
private SearchResult moreModelList;

2
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 = 100;
private static RecentSearchManager instance;
private static volatile RecentSearchManager instance;
IndexReader indexReader = null;
IndexSearcher indexSearcher = null;
//索引存储路径

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java

@ -28,7 +28,7 @@ import java.util.List;
* Created by XiaXiang on 2017/3/31.
*/
public class RecommendSearchManager implements AlphaFineSearchProvider {
private static RecommendSearchManager instance;
private static volatile RecommendSearchManager instance;
private SearchResult modelList;
private SearchResult recommendModelList;

9
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java

@ -13,13 +13,16 @@ import java.util.regex.Pattern;
* Created by alex.sung on 2018/8/3.
*/
public class SegmentationManager {
private static SegmentationManager segmentationManager = null;
private static volatile SegmentationManager segmentationManager = null;
private static final int MAX_CHINESE_CHARACTERS_NUM = 4;
public static synchronized SegmentationManager getInstance() {
public static SegmentationManager getInstance() {
if (segmentationManager == null) {
synchronized (SegmentationManager.class){
if (segmentationManager == null) {
segmentationManager = new SegmentationManager();
return segmentationManager;
}
}
}
return segmentationManager;
}

12
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java

@ -14,23 +14,25 @@ import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.json.JSONTokener;
import com.fr.log.FineLoggerFactory;
import org.apache.commons.codec.digest.DigestUtils;
import java.io.IOException;
//import com.fr.third.org.apache.commons.codec.digest.DigestUtils;
import com.fr.third.org.apache.commons.codec.digest.DigestUtils;
/**
* Created by alex.sung on 2018/8/3.
*/
public class SimilarSearchManeger implements AlphaFineSearchProvider {
private static SimilarSearchManeger instance;
private static volatile SimilarSearchManeger instance;
private volatile SearchResult lessModelList;
private volatile SearchResult moreModelList = new SearchResult();
public static synchronized SimilarSearchManeger getInstance() {
public static SimilarSearchManeger getInstance() {
if (instance == null) {
synchronized (SimilarSearchManeger.class){
if (instance == null) {
instance = new SimilarSearchManeger();
}
}
}
return instance;
}

Loading…
Cancel
Save