From 9b2ec269544278e16ed40a4a8bfb2e25d36925f2 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 13 Jun 2017 14:33:05 +0800 Subject: [PATCH 1/3] alphafine bug fix --- .../alphafine/component/AlphaFineDialog.java | 16 +++++++--------- .../search/manager/FileSearchManager.java | 3 ++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 42336a9c88..97ac47fdfe 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -71,6 +71,8 @@ public class AlphaFineDialog extends UIDialog { private static final String DS_NAME = "dsname=\""; private static final String PLUGIN_MARK_SHORT = "k:4 "; private static final String PLUGIN_MARK = "k:shop "; + private static final String BLANK = " "; + private AlphaFineTextField searchTextField; private UIButton closeButton; private JPanel searchResultPane; @@ -311,27 +313,23 @@ public class AlphaFineDialog extends UIDialog { private void rebuildList(String searchText) { searchListModel.removeAllElements(); if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) { - getActionList(searchText.substring(searchText.indexOf(" ") + 1, searchText.length())); + getActionList(searchText.substring(searchText.indexOf(BLANK) + 1, searchText.length())); return; } else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) { - getDocumentList(searchText.substring(searchText.indexOf(" ") + 1, searchText.length())); + getDocumentList(searchText.substring(searchText.indexOf(BLANK) + 1, searchText.length())); return; - } else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) { - getFileList(searchText.substring(searchText.indexOf(" ") + 1, searchText.length())); + getFileList(searchText.substring(searchText.indexOf(BLANK) + 1, searchText.length())); return; - } else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) { getFileList(searchText); return; } else if (searchText.startsWith(DS_MARK)) { - getFileList(DS_NAME + searchText.substring(searchText.indexOf(" ") + 1, searchText.length())); + getFileList(DS_NAME + searchText.substring(searchText.indexOf(BLANK) + 1, searchText.length())); return; - } else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) { - getPluginList(searchText.substring(searchText.indexOf(" ") + 1, searchText.length())); + getPluginList(searchText.substring(searchText.indexOf(BLANK) + 1, searchText.length())); return; - } doNormalSearch(searchText.trim()); } diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java index a7d9fbe659..00779c69f0 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java @@ -123,7 +123,8 @@ public class FileSearchManager implements AlphaFineSearchProcessor { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) { try { - BufferedReader reader = new BufferedReader(new FileReader(filePath)); + InputStreamReader isr = new InputStreamReader(new FileInputStream(new File(filePath)), "UTF-8"); + BufferedReader reader = new BufferedReader(isr); String line; int columnNumber; boolean isFoundInContent = false; From 24f7fb70d16a5e654332dd2bc03086ffa31ddd1a Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 13 Jun 2017 14:49:14 +0800 Subject: [PATCH 2/3] bug fix --- .../mainframe/alphafine/search/manager/FileSearchManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java index 00779c69f0..19cc5d526a 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java @@ -132,6 +132,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { columnNumber = line.toLowerCase().indexOf(searchText); if (columnNumber != -1) { isFoundInContent = true; + break; } } if (isFoundInContent && !isAlreadyContain) { From 9f1a6d2f8467b5d2ce22f735cc1a72a816d80c0d Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 13 Jun 2017 15:10:01 +0800 Subject: [PATCH 3/3] bug fix --- .../alphafine/component/AlphaFineDialog.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 97ac47fdfe..aebcf227b7 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -71,7 +71,6 @@ public class AlphaFineDialog extends UIDialog { private static final String DS_NAME = "dsname=\""; private static final String PLUGIN_MARK_SHORT = "k:4 "; private static final String PLUGIN_MARK = "k:shop "; - private static final String BLANK = " "; private AlphaFineTextField searchTextField; private UIButton closeButton; @@ -313,22 +312,22 @@ public class AlphaFineDialog extends UIDialog { private void rebuildList(String searchText) { searchListModel.removeAllElements(); if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) { - getActionList(searchText.substring(searchText.indexOf(BLANK) + 1, searchText.length())); + getActionList(searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length())); return; } else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) { - getDocumentList(searchText.substring(searchText.indexOf(BLANK) + 1, searchText.length())); + getDocumentList(searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length())); return; } else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) { - getFileList(searchText.substring(searchText.indexOf(BLANK) + 1, searchText.length())); + getFileList(searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length())); return; } else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) { getFileList(searchText); return; } else if (searchText.startsWith(DS_MARK)) { - getFileList(DS_NAME + searchText.substring(searchText.indexOf(BLANK) + 1, searchText.length())); + getFileList(DS_NAME + searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length())); return; } else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) { - getPluginList(searchText.substring(searchText.indexOf(BLANK) + 1, searchText.length())); + getPluginList(searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length())); return; } doNormalSearch(searchText.trim());