extract method

This commit is contained in:
Jacky 2017-11-17 16:52:26 -05:00
parent 8187799f85
commit c32f6329d2

View File

@ -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.