From c2a1303274317e6147d70fbc022668864c3c0076 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Fri, 23 Jun 2017 09:57:07 +0800 Subject: [PATCH] =?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/RecentSearchManager.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java index 6dcebbf631..e27a01038b 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java @@ -34,7 +34,7 @@ import java.util.*; */ public class RecentSearchManager extends XMLFileManager implements AlphaFineSearchProcessor { - private static final String XML_TAG = "AlphafineRecent"; + private static final String XML_TAG = "AlphaFineRecent"; private static final int MAX_SIZE = 3; private static RecentSearchManager recentSearchManager = null; private static File recentFile = null; @@ -64,7 +64,7 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear String nodeName = reader.getTagName(); if (nodeName.equals("RecentModelList")) { String key = reader.getAttrAsString("searchKey", StringUtils.EMPTY); - final ArrayList list = new ArrayList(); + final ArrayList list = new ArrayList<>(); reader.readXMLObject(new XMLReadable() { @Override public void readXML(XMLableReader reader) { @@ -85,16 +85,16 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear if (reader.isChildNode()) { String nodeName = reader.getTagName(); if (nodeName.equals("model")) { - String name = reader.getAttrAsString("cellModel", StringUtils.EMPTY); - addModelToList(list, name); + String modelValue = reader.getAttrAsString("cellModel", StringUtils.EMPTY); + addModelToList(list, modelValue); } } } - private void addModelToList(List list, String name) { + private void addModelToList(List list, String modelValue) { try { - AlphaCellModel model = CellModelHelper.getModelFromJson(new JSONObject(name)); + AlphaCellModel model = CellModelHelper.getModelFromJson(new JSONObject(modelValue)); if (model != null) { list.add(model); } @@ -113,9 +113,9 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear writer.attr("searchKey", key); for (AlphaCellModel model : recentKVModelMap.get(key)) { try { - String name = model.ModelToJson().toString(); + String modelValue = model.ModelToJson().toString(); writer.startTAG("model"); - writer.attr("cellModel", name); + writer.attr("cellModel", modelValue); writer.end(); } catch (JSONException e) { FRLogger.getLogger().error(e.getMessage()); @@ -130,7 +130,7 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear @Override public String fileName() { - return "alphafine_recent.xml"; + return "AlphaFine_Recent.xml"; } @@ -162,7 +162,7 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear private void createRecentFile(File envFile) { try { FileWriter fileWriter = new FileWriter(envFile); - StringReader stringReader = new StringReader(""); + StringReader stringReader = new StringReader(""); Utils.copyCharTo(stringReader, fileWriter); stringReader.close(); fileWriter.close();