From cb3b393999cdcfa5f0882b861112b3700d862b41 Mon Sep 17 00:00:00 2001 From: SanoferSameera Date: Wed, 5 Jun 2024 13:28:03 +0530 Subject: [PATCH 1/2] BAH-3883 | Removed jackson-mapper-asl dependency --- pom.xml | 9 ++------- .../org/bahmni/reports/template/DrugOrderTemplate.java | 2 +- .../java/org/bahmni/reports/template/ObsTemplate.java | 4 ++-- .../reports/template/ProgramDrugOrderTemplate.java | 2 +- .../org/bahmni/reports/template/ProgramObsTemplate.java | 4 ++-- src/main/java/org/bahmni/reports/util/ConceptUtil.java | 6 +++--- .../util/GenericLabOrderReportTemplateHelper.java | 4 ++-- .../util/GenericObservationFormReportTemplateHelper.java | 4 ++-- .../util/GenericObservationReportTemplateHelper.java | 4 ++-- .../reports/report/GenericObservationFormReportTest.java | 2 +- .../reports/report/GenericObservationReportTest.java | 2 +- .../bahmni/reports/report/ObservationFormReportTest.java | 2 +- 12 files changed, 20 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index 96428f34..7346d45b 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ 5.3.27 4.0.0 - 2.13.0 + 2.14.0 true true 2.5.7 @@ -177,7 +177,7 @@ com.fasterxml.jackson.core jackson-databind - 2.13.4.1 + 2.14.0 com.fasterxml.jackson.core @@ -214,11 +214,6 @@ commons-fileupload 1.5 - - org.codehaus.jackson - jackson-mapper-asl - 1.9.8 - org.openmrs.api openmrs-api diff --git a/src/main/java/org/bahmni/reports/template/DrugOrderTemplate.java b/src/main/java/org/bahmni/reports/template/DrugOrderTemplate.java index 78fa23d5..0e74a2f0 100644 --- a/src/main/java/org/bahmni/reports/template/DrugOrderTemplate.java +++ b/src/main/java/org/bahmni/reports/template/DrugOrderTemplate.java @@ -11,7 +11,7 @@ import org.bahmni.reports.model.UsingDatasource; import org.bahmni.reports.report.BahmniReportBuilder; import org.bahmni.reports.util.CommonComponents; -import org.codehaus.jackson.map.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectMapper; import org.stringtemplate.v4.ST; import java.io.IOException; diff --git a/src/main/java/org/bahmni/reports/template/ObsTemplate.java b/src/main/java/org/bahmni/reports/template/ObsTemplate.java index 27a67548..db5cf524 100644 --- a/src/main/java/org/bahmni/reports/template/ObsTemplate.java +++ b/src/main/java/org/bahmni/reports/template/ObsTemplate.java @@ -14,8 +14,8 @@ import org.bahmni.reports.util.CommonComponents; import org.bahmni.reports.util.SqlUtil; import org.bahmni.webclients.HttpClient; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.type.TypeReference; import org.stringtemplate.v4.ST; import java.net.URI; diff --git a/src/main/java/org/bahmni/reports/template/ProgramDrugOrderTemplate.java b/src/main/java/org/bahmni/reports/template/ProgramDrugOrderTemplate.java index 880b2089..81604b2f 100644 --- a/src/main/java/org/bahmni/reports/template/ProgramDrugOrderTemplate.java +++ b/src/main/java/org/bahmni/reports/template/ProgramDrugOrderTemplate.java @@ -13,7 +13,7 @@ import org.bahmni.reports.report.BahmniReportBuilder; import org.bahmni.reports.util.CommonComponents; import org.bahmni.reports.util.SqlUtil; -import org.codehaus.jackson.map.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectMapper; import org.stringtemplate.v4.ST; import java.io.IOException; diff --git a/src/main/java/org/bahmni/reports/template/ProgramObsTemplate.java b/src/main/java/org/bahmni/reports/template/ProgramObsTemplate.java index 09ce0836..709682bf 100644 --- a/src/main/java/org/bahmni/reports/template/ProgramObsTemplate.java +++ b/src/main/java/org/bahmni/reports/template/ProgramObsTemplate.java @@ -15,8 +15,8 @@ import org.bahmni.reports.util.CommonComponents; import org.bahmni.reports.util.SqlUtil; import org.bahmni.webclients.HttpClient; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.type.TypeReference; import org.stringtemplate.v4.ST; import java.net.URI; diff --git a/src/main/java/org/bahmni/reports/util/ConceptUtil.java b/src/main/java/org/bahmni/reports/util/ConceptUtil.java index c35d5d5c..15cf96c0 100644 --- a/src/main/java/org/bahmni/reports/util/ConceptUtil.java +++ b/src/main/java/org/bahmni/reports/util/ConceptUtil.java @@ -4,8 +4,8 @@ import org.apache.logging.log4j.Logger; import org.bahmni.webclients.HttpClient; import org.bahmni.webclients.WebClientsException; -import org.codehaus.jackson.JsonNode; -import org.codehaus.jackson.map.ObjectMapper; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import java.net.URI; import java.net.URISyntaxException; @@ -28,7 +28,7 @@ public static ConceptDataTypes getConceptDataType(String concept, HttpClient htt JsonNode rootNode = objectMapper.readTree(response); JsonNode nameNode = rootNode.path("datatype"); - String type = nameNode.path("display").getTextValue(); + String type = nameNode.path("display").asText(); try { return ConceptDataTypes.valueOf(type); } catch (IllegalArgumentException e) { diff --git a/src/main/java/org/bahmni/reports/util/GenericLabOrderReportTemplateHelper.java b/src/main/java/org/bahmni/reports/util/GenericLabOrderReportTemplateHelper.java index d641dc46..cc930b63 100644 --- a/src/main/java/org/bahmni/reports/util/GenericLabOrderReportTemplateHelper.java +++ b/src/main/java/org/bahmni/reports/util/GenericLabOrderReportTemplateHelper.java @@ -9,8 +9,8 @@ import org.bahmni.reports.model.GenericLabOrderReportConfig; import org.bahmni.reports.model.Report; import org.bahmni.webclients.HttpClient; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.type.TypeReference; import java.io.UnsupportedEncodingException; import java.net.URI; diff --git a/src/main/java/org/bahmni/reports/util/GenericObservationFormReportTemplateHelper.java b/src/main/java/org/bahmni/reports/util/GenericObservationFormReportTemplateHelper.java index 61d128e1..2b358c41 100644 --- a/src/main/java/org/bahmni/reports/util/GenericObservationFormReportTemplateHelper.java +++ b/src/main/java/org/bahmni/reports/util/GenericObservationFormReportTemplateHelper.java @@ -12,8 +12,8 @@ import org.bahmni.reports.model.Report; import org.bahmni.webclients.HttpClient; import org.bahmni.webclients.WebClientsException; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.type.TypeReference; import java.net.URI; import java.util.ArrayList; diff --git a/src/main/java/org/bahmni/reports/util/GenericObservationReportTemplateHelper.java b/src/main/java/org/bahmni/reports/util/GenericObservationReportTemplateHelper.java index 7fed15b8..04ec0ea4 100644 --- a/src/main/java/org/bahmni/reports/util/GenericObservationReportTemplateHelper.java +++ b/src/main/java/org/bahmni/reports/util/GenericObservationReportTemplateHelper.java @@ -11,8 +11,8 @@ import org.bahmni.reports.model.Report; import org.bahmni.webclients.HttpClient; import org.bahmni.webclients.WebClientsException; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.type.TypeReference; import java.io.UnsupportedEncodingException; import java.net.URI; diff --git a/src/test/java/org/bahmni/reports/report/GenericObservationFormReportTest.java b/src/test/java/org/bahmni/reports/report/GenericObservationFormReportTest.java index dd496027..c4ef675b 100644 --- a/src/test/java/org/bahmni/reports/report/GenericObservationFormReportTest.java +++ b/src/test/java/org/bahmni/reports/report/GenericObservationFormReportTest.java @@ -3,7 +3,7 @@ import org.bahmni.reports.model.ConceptName; import org.bahmni.reports.report.integrationtests.BaseIntegrationTest; import org.bahmni.reports.wrapper.CsvReport; -import org.codehaus.jackson.map.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/bahmni/reports/report/GenericObservationReportTest.java b/src/test/java/org/bahmni/reports/report/GenericObservationReportTest.java index ad712a7f..702f4104 100644 --- a/src/test/java/org/bahmni/reports/report/GenericObservationReportTest.java +++ b/src/test/java/org/bahmni/reports/report/GenericObservationReportTest.java @@ -3,7 +3,7 @@ import org.bahmni.reports.model.ConceptName; import org.bahmni.reports.report.integrationtests.BaseIntegrationTest; import org.bahmni.reports.wrapper.CsvReport; -import org.codehaus.jackson.map.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/bahmni/reports/report/ObservationFormReportTest.java b/src/test/java/org/bahmni/reports/report/ObservationFormReportTest.java index cede1cc5..83a77f5d 100644 --- a/src/test/java/org/bahmni/reports/report/ObservationFormReportTest.java +++ b/src/test/java/org/bahmni/reports/report/ObservationFormReportTest.java @@ -4,7 +4,7 @@ import org.bahmni.reports.model.ConceptName; import org.bahmni.reports.report.integrationtests.BaseIntegrationTest; import org.bahmni.reports.wrapper.CsvReport; -import org.codehaus.jackson.map.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Before; import org.junit.Test; From e3a869c0f9596d75ea918f4a73ada04ab6e29a43 Mon Sep 17 00:00:00 2001 From: SanoferSameera Date: Wed, 5 Jun 2024 15:27:07 +0530 Subject: [PATCH 2/2] BAH-3883 | Update. jackson core version to latest 2.14.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 7346d45b..3a715977 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ 5.3.27 4.0.0 - 2.14.0 + 2.17.0 true true 2.5.7 @@ -177,7 +177,7 @@ com.fasterxml.jackson.core jackson-databind - 2.14.0 + ${jackson.version} com.fasterxml.jackson.core