From c32f6329d2a1215d58b687747fb5a7b87a7c0938 Mon Sep 17 00:00:00 2001 From: Jacky Date: Fri, 17 Nov 2017 16:52:26 -0500 Subject: [PATCH] extract method --- .../src/com/google/refine/ProjectManager.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/main/src/com/google/refine/ProjectManager.java b/main/src/com/google/refine/ProjectManager.java index b69b0945b..89b86c956 100644 --- a/main/src/com/google/refine/ProjectManager.java +++ b/main/src/com/google/refine/ProjectManager.java @@ -395,15 +395,7 @@ public abstract class ProjectManager { // actual metadata for project JSONArray jsonObjArray = metadata.getUserMetadata(); - // honor the meta data preference - for (int index = 0; index < jsonObjArray.length(); index++) { - try { - JSONObject projectMetaJsonObj = jsonObjArray.getJSONObject(index); - projectMetaJsonObj.put("display", false); - } catch (JSONException e) { - logger.error(ExceptionUtils.getFullStackTrace(e)); - } - } + initDispaly(jsonObjArray); try { String userMeta = (String)_preferenceStore.get(PreferenceStore.USER_METADATA_KEY); @@ -450,6 +442,21 @@ public abstract class ProjectManager { } } } + + /** + * honor the meta data preference + * @param jsonObjArray + */ + private void initDispaly(JSONArray jsonObjArray) { + for (int index = 0; index < jsonObjArray.length(); index++) { + try { + JSONObject projectMetaJsonObj = jsonObjArray.getJSONObject(index); + projectMetaJsonObj.put("display", false); + } catch (JSONException e) { + logger.error(ExceptionUtils.getFullStackTrace(e)); + } + } + } /** * Gets all the project Metadata currently held in memory.