From c0d1a39991a9924f5e34a08fe849ef0584d4b025 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Tue, 20 Nov 2018 16:48:17 +0000 Subject: [PATCH] Migrate CustomizableTabularExporterUtilities to Jackson --- .../CustomizableTabularExporterUtilities.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java b/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java index e395f8d86..f32058cb8 100644 --- a/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java +++ b/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java @@ -47,13 +47,13 @@ import java.util.TimeZone; import org.apache.commons.lang3.StringUtils; import org.apache.commons.validator.routines.UrlValidator; -import org.json.JSONArray; -import org.json.JSONObject; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.refine.ProjectManager; import com.google.refine.browsing.Engine; import com.google.refine.browsing.FilteredRows; @@ -402,13 +402,13 @@ abstract public class CustomizableTabularExporterUtilities { identifierSpaceToUrl = new HashMap(); PreferenceStore ps = ProjectManager.singleton.getPreferenceStore(); - JSONArray services = (JSONArray) ps.get("reconciliation.standardServices"); + ArrayNode services = (ArrayNode) ps.get("reconciliation.standardServices"); if (services != null) { - int count = services.length(); + int count = services.size(); for (int i = 0; i < count; i++) { - JSONObject service = JSONUtilities.getObjectElement(services, i); - JSONObject view = JSONUtilities.getObject(service, "view"); + ObjectNode service = (ObjectNode) services.get(i); + ObjectNode view = JSONUtilities.getObject(service, "view"); if (view != null) { String url = JSONUtilities.getString(service, "url", null); String viewUrl = JSONUtilities.getString(view, "url", null);