From 7f2ea9e6a8d639f804245ad9fe19e2bcb735307a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 19:32:07 +0000 Subject: [PATCH 1/2] Update dependency com.github.ngeor:checkstyle-rules to v7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3285d47..37c4b85 100644 --- a/pom.xml +++ b/pom.xml @@ -127,7 +127,7 @@ com.github.ngeor checkstyle-rules - 6.7.2 + 7.0.0 From eb74b8ec8ad0aefcb7584520e2f7f87bd330bdd2 Mon Sep 17 00:00:00 2001 From: Niklas Reimer Date: Tue, 3 Sep 2024 11:16:04 +0200 Subject: [PATCH 2/2] fix checkstyle violations --- src/main/java/fhirspark/JsonFhirMapper.java | 21 +++++++++---------- .../adapter/ClinicalTrialAdapter.java | 5 ++--- .../fhirspark/adapter/FollowUpAdapter.java | 11 +++++----- .../java/fhirspark/adapter/MtbAdapter.java | 13 ++++++------ .../fhirspark/adapter/ReasoningAdapter.java | 11 +++++----- .../java/fhirspark/adapter/RegexAdapter.java | 1 - .../fhirspark/adapter/SpecimenAdapter.java | 7 +++---- .../adapter/TherapyRecommendationAdapter.java | 9 ++++---- .../clinicaldata/ClinicalDataAdapter.java | 3 +-- .../adapter/clinicaldata/GenericAdapter.java | 3 +-- .../java/fhirspark/resolver/HgncGeneName.java | 1 - .../java/fhirspark/resolver/OncoKbDrug.java | 1 - .../fhirspark/resolver/PubmedPublication.java | 3 +-- .../settings/ConfigurationLoader.java | 5 ++--- .../java/fhirspark/settings/Settings.java | 1 - 15 files changed, 40 insertions(+), 55 deletions(-) diff --git a/src/main/java/fhirspark/JsonFhirMapper.java b/src/main/java/fhirspark/JsonFhirMapper.java index d270d51..10fd96b 100644 --- a/src/main/java/fhirspark/JsonFhirMapper.java +++ b/src/main/java/fhirspark/JsonFhirMapper.java @@ -22,6 +22,16 @@ import fhirspark.restmodel.Mtb; import fhirspark.restmodel.TherapyRecommendation; import fhirspark.settings.Settings; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; @@ -36,17 +46,6 @@ import org.hl7.fhir.r4.model.RelatedArtifact; import org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType; -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - /** * Fulfils the persistence in HL7 FHIR resources. */ diff --git a/src/main/java/fhirspark/adapter/ClinicalTrialAdapter.java b/src/main/java/fhirspark/adapter/ClinicalTrialAdapter.java index 00a369d..d5050ae 100644 --- a/src/main/java/fhirspark/adapter/ClinicalTrialAdapter.java +++ b/src/main/java/fhirspark/adapter/ClinicalTrialAdapter.java @@ -3,11 +3,10 @@ import fhirspark.definitions.GenomicsReportingEnum; import fhirspark.definitions.UriEnum; import fhirspark.restmodel.ClinicalTrial; -import org.hl7.fhir.r4.model.Coding; -import org.hl7.fhir.r4.model.Observation.ObservationComponentComponent; - import java.util.ArrayList; import java.util.List; +import org.hl7.fhir.r4.model.Coding; +import org.hl7.fhir.r4.model.Observation.ObservationComponentComponent; public final class ClinicalTrialAdapter { diff --git a/src/main/java/fhirspark/adapter/FollowUpAdapter.java b/src/main/java/fhirspark/adapter/FollowUpAdapter.java index 88c5262..5d5fae4 100644 --- a/src/main/java/fhirspark/adapter/FollowUpAdapter.java +++ b/src/main/java/fhirspark/adapter/FollowUpAdapter.java @@ -11,6 +11,11 @@ import fhirspark.restmodel.TherapyRecommendation; import fhirspark.settings.Regex; import fhirspark.settings.Settings; +import java.lang.reflect.InvocationTargetException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; import org.hl7.fhir.r4.model.Annotation; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.CodeableConcept; @@ -22,12 +27,6 @@ import org.hl7.fhir.r4.model.Practitioner; import org.hl7.fhir.r4.model.Reference; -import java.lang.reflect.InvocationTargetException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; - public final class FollowUpAdapter { private static IGenericClient client; diff --git a/src/main/java/fhirspark/adapter/MtbAdapter.java b/src/main/java/fhirspark/adapter/MtbAdapter.java index 5fba074..c5060e6 100644 --- a/src/main/java/fhirspark/adapter/MtbAdapter.java +++ b/src/main/java/fhirspark/adapter/MtbAdapter.java @@ -10,6 +10,12 @@ import fhirspark.restmodel.TherapyRecommendation; import fhirspark.settings.Regex; import fhirspark.settings.Settings; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.DiagnosticReport; @@ -27,13 +33,6 @@ import org.hl7.fhir.r4.model.Task.TaskIntent; import org.hl7.fhir.r4.model.Task.TaskStatus; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - public final class MtbAdapter { private static IGenericClient client; diff --git a/src/main/java/fhirspark/adapter/ReasoningAdapter.java b/src/main/java/fhirspark/adapter/ReasoningAdapter.java index 20b72f7..ddeb27f 100644 --- a/src/main/java/fhirspark/adapter/ReasoningAdapter.java +++ b/src/main/java/fhirspark/adapter/ReasoningAdapter.java @@ -7,6 +7,11 @@ import fhirspark.restmodel.GeneticAlteration; import fhirspark.restmodel.Reasoning; import fhirspark.settings.Regex; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Observation; @@ -14,12 +19,6 @@ import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.Specimen; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - public final class ReasoningAdapter { private ReasoningAdapter() { diff --git a/src/main/java/fhirspark/adapter/RegexAdapter.java b/src/main/java/fhirspark/adapter/RegexAdapter.java index 40b9bdf..b668bcb 100644 --- a/src/main/java/fhirspark/adapter/RegexAdapter.java +++ b/src/main/java/fhirspark/adapter/RegexAdapter.java @@ -1,7 +1,6 @@ package fhirspark.adapter; import fhirspark.settings.Regex; - import java.util.List; public final class RegexAdapter { diff --git a/src/main/java/fhirspark/adapter/SpecimenAdapter.java b/src/main/java/fhirspark/adapter/SpecimenAdapter.java index 9679613..1d9ead3 100644 --- a/src/main/java/fhirspark/adapter/SpecimenAdapter.java +++ b/src/main/java/fhirspark/adapter/SpecimenAdapter.java @@ -3,15 +3,14 @@ import fhirspark.definitions.GenomicsReportingEnum; import fhirspark.definitions.Hl7TerminologyEnum; import fhirspark.settings.Regex; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Identifier; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.Specimen; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - /** * Builds a HL7 FHIR Speciment object with the provided specimen id. */ diff --git a/src/main/java/fhirspark/adapter/TherapyRecommendationAdapter.java b/src/main/java/fhirspark/adapter/TherapyRecommendationAdapter.java index 5bbf5b7..f93c16c 100644 --- a/src/main/java/fhirspark/adapter/TherapyRecommendationAdapter.java +++ b/src/main/java/fhirspark/adapter/TherapyRecommendationAdapter.java @@ -11,6 +11,10 @@ import fhirspark.restmodel.TherapyRecommendation; import fhirspark.restmodel.Treatment; import fhirspark.settings.Regex; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; import org.hl7.fhir.r4.model.Annotation; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Coding; @@ -29,11 +33,6 @@ import org.hl7.fhir.r4.model.ResearchStudy; import org.hl7.fhir.r4.model.codesystems.ObservationCategory; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - public final class TherapyRecommendationAdapter { private static PubmedPublication pubmedResolver = new PubmedPublication(); diff --git a/src/main/java/fhirspark/adapter/clinicaldata/ClinicalDataAdapter.java b/src/main/java/fhirspark/adapter/clinicaldata/ClinicalDataAdapter.java index 0aa5c21..61bf9e9 100644 --- a/src/main/java/fhirspark/adapter/clinicaldata/ClinicalDataAdapter.java +++ b/src/main/java/fhirspark/adapter/clinicaldata/ClinicalDataAdapter.java @@ -3,12 +3,11 @@ import ca.uhn.fhir.rest.client.api.IGenericClient; import fhirspark.restmodel.ClinicalDatum; import fhirspark.settings.Regex; +import java.util.List; import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.Resource; -import java.util.List; - /** * General interface for all adapters of clinical data. */ diff --git a/src/main/java/fhirspark/adapter/clinicaldata/GenericAdapter.java b/src/main/java/fhirspark/adapter/clinicaldata/GenericAdapter.java index 049fbcf..b289eac 100644 --- a/src/main/java/fhirspark/adapter/clinicaldata/GenericAdapter.java +++ b/src/main/java/fhirspark/adapter/clinicaldata/GenericAdapter.java @@ -6,6 +6,7 @@ import fhirspark.definitions.LoincEnum; import fhirspark.restmodel.ClinicalDatum; import fhirspark.settings.Regex; +import java.util.List; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.CodeableConcept; import org.hl7.fhir.r4.model.Observation; @@ -14,8 +15,6 @@ import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.Specimen; -import java.util.List; - /** * Generic adapter for clinical data. Also fallback if other adapter was not * found. diff --git a/src/main/java/fhirspark/resolver/HgncGeneName.java b/src/main/java/fhirspark/resolver/HgncGeneName.java index c08a728..6d6f1e3 100644 --- a/src/main/java/fhirspark/resolver/HgncGeneName.java +++ b/src/main/java/fhirspark/resolver/HgncGeneName.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.dataformat.csv.CsvMapper; import com.fasterxml.jackson.dataformat.csv.CsvSchema; import fhirspark.resolver.model.Genenames; - import java.io.FileInputStream; import java.io.IOException; import java.util.HashMap; diff --git a/src/main/java/fhirspark/resolver/OncoKbDrug.java b/src/main/java/fhirspark/resolver/OncoKbDrug.java index 65fdfca..d4b03e6 100644 --- a/src/main/java/fhirspark/resolver/OncoKbDrug.java +++ b/src/main/java/fhirspark/resolver/OncoKbDrug.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import fhirspark.resolver.model.Drug; - import java.io.FileInputStream; import java.io.IOException; import java.util.HashMap; diff --git a/src/main/java/fhirspark/resolver/PubmedPublication.java b/src/main/java/fhirspark/resolver/PubmedPublication.java index 0321054..91e33c5 100644 --- a/src/main/java/fhirspark/resolver/PubmedPublication.java +++ b/src/main/java/fhirspark/resolver/PubmedPublication.java @@ -8,9 +8,8 @@ import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.UniformInterfaceException; import com.sun.jersey.api.client.WebResource; -import org.eclipse.jetty.http.HttpStatus; - import java.io.IOException; +import org.eclipse.jetty.http.HttpStatus; /** * Resolves the title of a pubmed publication if it was not provided. diff --git a/src/main/java/fhirspark/settings/ConfigurationLoader.java b/src/main/java/fhirspark/settings/ConfigurationLoader.java index 8b3499d..1426e02 100644 --- a/src/main/java/fhirspark/settings/ConfigurationLoader.java +++ b/src/main/java/fhirspark/settings/ConfigurationLoader.java @@ -3,13 +3,12 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import com.google.common.io.ByteStreams; -import org.apache.commons.text.StringSubstitutor; -import org.apache.commons.text.lookup.StringLookupFactory; - import java.io.IOException; import java.io.InputStream; import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; +import org.apache.commons.text.StringSubstitutor; +import org.apache.commons.text.lookup.StringLookupFactory; /** * Class that enables the use of environment variables in the settings.yaml diff --git a/src/main/java/fhirspark/settings/Settings.java b/src/main/java/fhirspark/settings/Settings.java index 40ca306..3909193 100644 --- a/src/main/java/fhirspark/settings/Settings.java +++ b/src/main/java/fhirspark/settings/Settings.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; - import java.util.List; /**