From 64d776ac0ebe1453ccd7da449a480f0a11d21e36 Mon Sep 17 00:00:00 2001 From: Mark Iantorno Date: Fri, 3 Feb 2023 09:40:32 -0500 Subject: [PATCH] Checkstyle cleanup (#4501) * cleaning up checkstyle files * added exlusions for files at base project level so checkstyle doesn't error out * duplicate error code from merge * One more fix for #4467 * changing lifecycle goal for all module checkstyle check * moving checkstyle to base pom file, changing exectution phase on base check, cleaning dependency, resolving duplicate error code * wip * trying to figure out why pipeline cannot copy files * removing modules that don't actually need to be built. * I messed up the version * missing model --------- Co-authored-by: James Agnew --- azure-pipelines.yml | 4 - hapi-deployable-pom/pom.xml | 33 +- hapi-fhir-base/pom.xml | 56 ++++ .../ca/uhn/fhir/validation/FhirValidator.java | 2 +- hapi-fhir-checkstyle/pom.xml | 65 ++++ .../hapi-base-checkstyle-suppression.xml | 16 +- .../src/checkstyle/hapi-base-checkstyle.xml | 41 +++ .../uhn/fhir/checks/HapiErrorCodeCheck.java | 50 ++- .../fhir/checks/HapiErrorCodeCheckTest.java | 7 +- .../src/test/resources/BadClass.java | 9 +- .../java/ca/uhn/fhir/cli/BaseCommand.java | 2 +- .../cli/ValidationSupportChainCreator.java | 2 +- .../okhttp/client/OkHttpRestfulClient.java | 4 +- .../CircularQueueCaptureQueriesListener.java | 1 + .../export/svc/JpaBulkExportProcessor.java | 2 +- .../search/ExtendedHSearchClauseBuilder.java | 4 +- .../jpa/util/WebsocketSubscriptionClient.java | 1 + .../mdm/rules/matcher/NicknameMatcher.java | 2 +- .../provider/HashMapResourceProvider.java | 10 +- .../ServerCapabilityStatementProvider.java | 4 +- .../jobs/export/FetchResourceIdsStep.java | 2 +- .../batch2/jobs/export/WriteBinaryStep.java | 2 +- .../jobs/services/Batch2JobRunnerImpl.java | 2 +- .../ServerCapabilityStatementProvider.java | 2 +- .../fhir/r5/hapi/ctx/HapiWorkerContext.java | 2 +- .../test/utilities/RestServerDstu3Helper.java | 4 +- .../VersionSpecificWorkerContextWrapper.java | 8 +- hapi-tinder-test/pom.xml | 40 --- pom.xml | 308 +++++++----------- src/checkstyle/checkstyle.xml | 192 ----------- src/checkstyle/checkstyle_config_nofixmes.xml | 21 -- 31 files changed, 366 insertions(+), 532 deletions(-) rename src/checkstyle/checkstyle_suppressions.xml => hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle-suppression.xml (50%) create mode 100644 hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml delete mode 100644 src/checkstyle/checkstyle.xml delete mode 100644 src/checkstyle/checkstyle_config_nofixmes.xml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 13987de4279..3278f295938 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -80,16 +80,12 @@ stages: module: hapi-fhir-server-mdm - name: hapi_fhir_server_openapi module: hapi-fhir-server-openapi - - name: hapi_fhir_serviceloaders - module: hapi-fhir-serviceloaders - name: hapi_fhir_caching_api module: hapi-fhir-serviceloaders/hapi-fhir-caching-api - name: hapi_fhir_caching_caffeine module: hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine - name: hapi_fhir_caching_guava module: hapi-fhir-serviceloaders/hapi-fhir-caching-guava - - name: hapi_fhir_caching_testing - module: hapi-fhir-serviceloaders/hapi-fhir-caching-testing - name: hapi_fhir_spring_boot_autoconfigure module: hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure - name: hapi_fhir_spring_boot_sample_server_jersey diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml index 2bb90c5f35b..78b4a363ebd 100644 --- a/hapi-deployable-pom/pom.xml +++ b/hapi-deployable-pom/pom.xml @@ -1,7 +1,8 @@ - - 4.0.0 + + 4.0.0 - + ca.uhn.hapi.fhir hapi-fhir 6.5.0-SNAPSHOT @@ -13,9 +14,6 @@ HAPI FHIR - Deployable Artifact Parent POM - - - @@ -120,27 +118,6 @@ - - org.apache.maven.plugins - maven-checkstyle-plugin - - - process-sources - - check - - - true - true - ${maven.multiModuleProjectDirectory}/src/checkstyle/checkstyle_suppressions.xml - true - true - true - ${maven.multiModuleProjectDirectory}/src/checkstyle/checkstyle.xml - - - - @@ -208,7 +185,6 @@ package - jar @@ -252,5 +228,4 @@ - diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index 8a5bc10ca9b..1a12470d99a 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -196,6 +196,62 @@ + + org.apache.maven.plugins + maven-antrun-plugin + 1.8 + + + + + + + true + + + delete-module-cache-file + validate + + run + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${maven_checkstyle_version} + + + ${maven.multiModuleProjectDirectory}/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml + + ${maven.multiModuleProjectDirectory}/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle-suppression.xml + UTF-8 + true + + true + + + hapi-single-module-checkstyle + validate + + check + + + + + + ca.uhn.hapi.fhir + hapi-fhir-checkstyle + ${project.version} + + + com.puppycrawl.tools + checkstyle + ${checkstyle_version} + + + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java index b22b8eeefdc..d5eb604015f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java @@ -333,7 +333,7 @@ public class FhirValidator { retval.addAll(messages); } } catch (InterruptedException | ExecutionException exp) { - throw new InternalErrorException(Msg.code(1975) + exp); + throw new InternalErrorException(Msg.code(2246) + exp); } return retval; } diff --git a/hapi-fhir-checkstyle/pom.xml b/hapi-fhir-checkstyle/pom.xml index 405d85e54ec..afbd19e7ea4 100644 --- a/hapi-fhir-checkstyle/pom.xml +++ b/hapi-fhir-checkstyle/pom.xml @@ -18,6 +18,7 @@ com.puppycrawl.tools checkstyle + ${checkstyle_version} commons-io @@ -34,6 +35,31 @@ + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.2.0 + + + com.puppycrawl.tools + checkstyle + ${checkstyle_version} + + + ca.uhn.hapi.fhir + hapi-fhir-checkstyle + + ${project.version} + + + + + + + @@ -75,5 +101,44 @@ + + CI + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${maven_checkstyle_version} + + **/osgi/**/*, **/.mvn/**/*, **/.mvn_/**/* + + + + ${maven.multiModuleProjectDirectory}/ + + + ${maven.multiModuleProjectDirectory}/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml + + ${maven.multiModuleProjectDirectory}/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle-suppression.xml + UTF-8 + true + + + + checkstyle-across-all-modules + install + + check + + + + hapi-single-module-checkstyle + none + + + + + + diff --git a/src/checkstyle/checkstyle_suppressions.xml b/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle-suppression.xml similarity index 50% rename from src/checkstyle/checkstyle_suppressions.xml rename to hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle-suppression.xml index 7c1de5e4e4b..910deb076bc 100644 --- a/src/checkstyle/checkstyle_suppressions.xml +++ b/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle-suppression.xml @@ -1,10 +1,18 @@ - + "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" + "https://checkstyle.org/dtds/suppressions_1_2.dtd"> + + + + + + + + + @@ -16,4 +24,6 @@ + + diff --git a/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml b/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml new file mode 100644 index 00000000000..5ff02a4549d --- /dev/null +++ b/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-checkstyle/src/main/java/ca/uhn/fhir/checks/HapiErrorCodeCheck.java b/hapi-fhir-checkstyle/src/main/java/ca/uhn/fhir/checks/HapiErrorCodeCheck.java index 60b1cacf187..6a22f208d72 100644 --- a/hapi-fhir-checkstyle/src/main/java/ca/uhn/fhir/checks/HapiErrorCodeCheck.java +++ b/hapi-fhir-checkstyle/src/main/java/ca/uhn/fhir/checks/HapiErrorCodeCheck.java @@ -1,6 +1,6 @@ package ca.uhn.fhir.checks; -import com.puppycrawl.tools.checkstyle.StatelessCheck; +import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -9,15 +9,13 @@ import org.slf4j.LoggerFactory; import java.util.HashMap; import java.util.Map; +import java.util.Set; -/** - * mvn -P CI checkstyle:check - */ -@StatelessCheck +@FileStatefulCheck public final class HapiErrorCodeCheck extends AbstractCheck { private static final Logger ourLog = LoggerFactory.getLogger(HapiErrorCodeCheck.class); - private static final Map ourCodesUsed = new HashMap<>(); + private static final ErrorCodeCache ourCache = ErrorCodeCache.INSTANCE; @Override public int[] getDefaultTokens() { @@ -42,10 +40,6 @@ public final class HapiErrorCodeCheck extends AbstractCheck { } private void validateMessageCode(DetailAST theAst) { - // TODO KHS this should be done in the checkstyle plugin pom config, not here - if (getFileContents().getFileName().contains("/generated-sources/")) { - return; - } DetailAST instantiation = theAst.getFirstChild().getFirstChild(); // We only expect message codes on new exception instantiations if (TokenTypes.LITERAL_NEW != instantiation.getType()) { @@ -68,14 +62,13 @@ public final class HapiErrorCodeCheck extends AbstractCheck { DetailAST numberNode = msgNode.getParent().getNextSibling().getFirstChild().getFirstChild(); if (TokenTypes.NUM_INT == numberNode.getType()) { Integer code = Integer.valueOf(numberNode.getText()); - if (ourCodesUsed.containsKey(code)) { + if (ourCache.containsKey(code)) { log(theAst.getLineNo(), "Two different exception messages call Msg.code(" + - code + - "). Each thrown exception throw call Msg.code() with a different code. " + - "Previously found at: " + ourCodesUsed.get(code)); + code + "). \nEach thrown exception must call Msg.code() with a different code. " + + "\nPreviously found at: " + ourCache.get(code)); } else { - String location = getFileContents().getFileName() + ":" + instantiation.getLineNo() + ":" + instantiation.getColumnNo() + "(" + code + ")"; - ourCodesUsed.put(code, location); + String location = getFilePath() + ":" + instantiation.getLineNo() + ":" + instantiation.getColumnNo() + "(" + code + ")"; + ourCache.put(code, location); } } else { log(theAst.getLineNo(), "Called Msg.code() with a non-integer argument"); @@ -110,5 +103,30 @@ public final class HapiErrorCodeCheck extends AbstractCheck { } return null; } + + public enum ErrorCodeCache { + INSTANCE; + + private static final Map ourCodesUsed = new HashMap<>(); + + ErrorCodeCache() { + } + + public boolean containsKey(Integer s) { + return ourCodesUsed.containsKey(s); + } + + public String get(Integer i) { + return ourCodesUsed.get(i); + } + + public String put(Integer code, String location) { + return ourCodesUsed.put(code, location); + } + + public Set keySet() { + return ourCodesUsed.keySet(); + } + } } diff --git a/hapi-fhir-checkstyle/src/test/java/ca/uhn/fhir/checks/HapiErrorCodeCheckTest.java b/hapi-fhir-checkstyle/src/test/java/ca/uhn/fhir/checks/HapiErrorCodeCheckTest.java index fb0ae2bf889..698251a669d 100644 --- a/hapi-fhir-checkstyle/src/test/java/ca/uhn/fhir/checks/HapiErrorCodeCheckTest.java +++ b/hapi-fhir-checkstyle/src/test/java/ca/uhn/fhir/checks/HapiErrorCodeCheckTest.java @@ -44,12 +44,13 @@ class HapiErrorCodeCheckTest { // validate String[] errorLines = errors.toString().split("\r?\n"); Arrays.stream(errorLines).forEach(ourLog::info); - assertEquals(2, errorLines.length); + assertEquals(4, errorLines.length); assertThat(errorLines[0], startsWith("[ERROR] ")); assertThat(errorLines[0], endsWith("BadClass.java:7: Exception thrown that does not call Msg.code() [HapiErrorCode]")); assertThat(errorLines[1], startsWith("[ERROR] ")); - assertThat(errorLines[1], containsString("BadClass.java:11: Two different exception messages call Msg.code(2). Each thrown exception throw call Msg.code() with a different code.")); - assertThat(errorLines[1], containsString("BadClass.java:9:9")); + assertThat(errorLines[1], containsString("Two different exception messages call Msg.code(2258).")); + assertThat(errorLines[2], containsString("Each thrown exception must call Msg.code() with a different code.")); + assertThat(errorLines[3], containsString("Previously found at:")); } private Checker buildChecker() throws CheckstyleException { diff --git a/hapi-fhir-checkstyle/src/test/resources/BadClass.java b/hapi-fhir-checkstyle/src/test/resources/BadClass.java index f0470ffb221..acd57340891 100644 --- a/hapi-fhir-checkstyle/src/test/resources/BadClass.java +++ b/hapi-fhir-checkstyle/src/test/resources/BadClass.java @@ -2,16 +2,15 @@ public class BadClass { public void init() throws Exception { int i = 1; if (i == 0) { - throw new MessagingException(theMessage, Msg.code(6) + "Failure handling subscription payload", e); + throw new MessagingException(theMessage, Msg.code(2259) + "Failure handling subscription payload", e); } else if (i == 1) { throw new RuntimeException("nocode"); } else if (i == 2) { - throw new RuntimeException(Msg.code(2) + "duplicate code"); + throw new RuntimeException(Msg.code(2258) + "duplicate code"); } else if (i == 3) { - throw new RuntimeException(Msg.code(2) + "duplicate code"); - } else if (i == 4) { - throw new RuntimeException(Msg.code(1) + "good"); + throw new RuntimeException(Msg.code(2258) + "duplicate code"); } + ClassCastException e = new ClassCastException(); throwException(i, e); } diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BaseCommand.java b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BaseCommand.java index bab9aae7936..cfa243dd0d4 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BaseCommand.java +++ b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BaseCommand.java @@ -531,7 +531,7 @@ public abstract class BaseCommand implements Comparable { return Optional.of(new TlsAuthentication(keyStoreInfo, trustStoreInfo)); } catch(Exception e){ - throw new RuntimeException(Msg.code(2115)+"Could not create TLS configuration options", e); + throw new RuntimeException(Msg.code(2253)+"Could not create TLS configuration options", e); } } diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ValidationSupportChainCreator.java b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ValidationSupportChainCreator.java index 4224901ba1e..1eb6407a568 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ValidationSupportChainCreator.java +++ b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ValidationSupportChainCreator.java @@ -48,7 +48,7 @@ public class ValidationSupportChainCreator { chain.addValidationSupport(localFileValidationSupport); chain.addValidationSupport(new SnapshotGeneratingValidationSupport(ctx)); } catch (IOException e) { - throw new RuntimeException(Msg.code(2207) + "Failed to load local profile.", e); + throw new RuntimeException(Msg.code(2254) + "Failed to load local profile.", e); } } if (commandLine.hasOption("r")) { diff --git a/hapi-fhir-client-okhttp/src/main/java/ca/uhn/fhir/okhttp/client/OkHttpRestfulClient.java b/hapi-fhir-client-okhttp/src/main/java/ca/uhn/fhir/okhttp/client/OkHttpRestfulClient.java index 48dc93279d5..5d4acce5b4a 100644 --- a/hapi-fhir-client-okhttp/src/main/java/ca/uhn/fhir/okhttp/client/OkHttpRestfulClient.java +++ b/hapi-fhir-client-okhttp/src/main/java/ca/uhn/fhir/okhttp/client/OkHttpRestfulClient.java @@ -89,13 +89,13 @@ public class OkHttpRestfulClient implements IHttpClient { } private RequestBody createPostBody(String theContents, String theContentType) { - return RequestBody.create(MediaType.parse(theContentType), theContents); + return RequestBody.create(MediaType.parse(theContentType), theContents); } @Override public IHttpRequest createParamRequest(FhirContext theContext, Map> theParams, EncodingEnum theEncoding) { initBaseRequest(theContext, theEncoding, getFormBodyFromParams(theParams)); - return myRequest; + return myRequest; } private RequestBody getFormBodyFromParams(Map> queryParams) { diff --git a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java index bc558009870..b41dc31d3fe 100644 --- a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java +++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.util; * #L% */ +import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.util.StopWatch; import com.google.common.collect.Queues; import net.ttddyy.dsproxy.support.ProxyDataSourceBuilder; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java index 0ad04a80b8e..de1aa0c08de 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java @@ -549,7 +549,7 @@ public class JpaBulkExportProcessor implements IBulkExportProcessor { Optional oPatientSearchParam = SearchParameterUtil.getOnlyPatientSearchParamForResourceType(myContext, theResource.fhirType()); if (!oPatientSearchParam.isPresent()) { String errorMessage = String.format("[%s] has no search parameters that are for patients, so it is invalid for Group Bulk Export!", theResource.fhirType()); - throw new IllegalArgumentException(Msg.code(2103) + errorMessage); + throw new IllegalArgumentException(Msg.code(2242) + errorMessage); } else { return oPatientSearchParam.get(); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchClauseBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchClauseBuilder.java index 824709ccfa7..069288c8d99 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchClauseBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchClauseBuilder.java @@ -452,7 +452,7 @@ public class ExtendedHSearchClauseBuilder { booleanStep.minimumShouldMatchNumber(1); return booleanStep; } - throw new IllegalArgumentException(Msg.code(2025) + "Date search param does not support prefix of type: " + prefix); + throw new IllegalArgumentException(Msg.code(2255) + "Date search param does not support prefix of type: " + prefix); } private PredicateFinalStep generateDateInstantSearchTerms(DateParam theDateParam, PathContext theSpContext) { @@ -496,7 +496,7 @@ public class ExtendedHSearchClauseBuilder { return ((SearchPredicateFactory) theSpContext).range().field(lowerInstantField).atMost(upperBoundAsInstant); } - throw new IllegalArgumentException(Msg.code(2026) + "Date search param does not support prefix of type: " + prefix); + throw new IllegalArgumentException(Msg.code(2256) + "Date search param does not support prefix of type: " + prefix); } diff --git a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/util/WebsocketSubscriptionClient.java b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/util/WebsocketSubscriptionClient.java index 95c7600b0fa..73c737a9ee9 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/util/WebsocketSubscriptionClient.java +++ b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/util/WebsocketSubscriptionClient.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.util; * #L% */ +import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.jpa.model.entity.ModelConfig; import ca.uhn.fhir.jpa.subscription.SocketImplementation; import ca.uhn.fhir.rest.api.EncodingEnum; diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/matcher/NicknameMatcher.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/matcher/NicknameMatcher.java index 8e3a3c5fd24..685e84bf5fa 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/matcher/NicknameMatcher.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/matcher/NicknameMatcher.java @@ -35,7 +35,7 @@ public class NicknameMatcher implements IMdmStringMatcher { try { myNicknameSvc = new NicknameSvc(); } catch (IOException e) { - throw new ConfigurationException(Msg.code(2078) + "Unable to load nicknames", e); + throw new ConfigurationException(Msg.code(2234) + "Unable to load nicknames", e); } } diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/HashMapResourceProvider.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/HashMapResourceProvider.java index 045147d5aa0..9c982bb9c86 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/HashMapResourceProvider.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/HashMapResourceProvider.java @@ -173,7 +173,7 @@ public class HashMapResourceProvider implements IResour TreeMap versions = myIdToVersionToResourceMap.get(theId.getIdPart()); if (versions == null || versions.isEmpty()) { - throw new ResourceNotFoundException(Msg.code(1979) + theId); + throw new ResourceNotFoundException(Msg.code(2250) + theId); } T deletedInstance = (T) myFhirContext.getResourceDefinition(myResourceType).newInstance(); @@ -240,7 +240,7 @@ public class HashMapResourceProvider implements IResour public synchronized List historyInstance(@IdParam IIdType theId, RequestDetails theRequestDetails) { LinkedList retVal = myIdToHistory.get(theId.getIdPart()); if (retVal == null) { - throw new ResourceNotFoundException(Msg.code(1980) + theId); + throw new ResourceNotFoundException(Msg.code(2248) + theId); } return fireInterceptorsAndFilterAsNeeded(retVal, theRequestDetails); @@ -255,7 +255,7 @@ public class HashMapResourceProvider implements IResour public synchronized T read(@IdParam IIdType theId, RequestDetails theRequestDetails) { TreeMap versions = myIdToVersionToResourceMap.get(theId.getIdPart()); if (versions == null || versions.isEmpty()) { - throw new ResourceNotFoundException(Msg.code(1981) + theId); + throw new ResourceNotFoundException(Msg.code(2247) + theId); } T retVal; @@ -271,14 +271,14 @@ public class HashMapResourceProvider implements IResour } if (retVal == null || ResourceMetadataKeyEnum.DELETED_AT.get(retVal) != null) { - throw new ResourceGoneException(Msg.code(1983) + theId); + throw new ResourceGoneException(Msg.code(2244) + theId); } myReadCount.incrementAndGet(); retVal = fireInterceptorsAndFilterAsNeeded(retVal, theRequestDetails); if (retVal == null) { - throw new ResourceNotFoundException(Msg.code(1984) + theId); + throw new ResourceNotFoundException(Msg.code(2243) + theId); } return retVal; } diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ServerCapabilityStatementProvider.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ServerCapabilityStatementProvider.java index ea3fc0946e9..c5eeb97e097 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ServerCapabilityStatementProvider.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ServerCapabilityStatementProvider.java @@ -636,7 +636,7 @@ public class ServerCapabilityStatementProvider implements IServerConformanceProv @Read(typeName = "OperationDefinition") public IBaseResource readOperationDefinition(@IdParam IIdType theId, RequestDetails theRequestDetails) { if (theId == null || theId.hasIdPart() == false) { - throw new ResourceNotFoundException(Msg.code(1977) + theId); + throw new ResourceNotFoundException(Msg.code(2245) + theId); } RestfulServerConfiguration configuration = getServerConfiguration(); Bindings bindings = configuration.provideBindings(); @@ -650,7 +650,7 @@ public class ServerCapabilityStatementProvider implements IServerConformanceProv if (searchBindings != null && !searchBindings.isEmpty()) { return readOperationDefinitionForNamedSearch(searchBindings); } - throw new ResourceNotFoundException(Msg.code(1978) + theId); + throw new ResourceNotFoundException(Msg.code(2249) + theId); } private String getOperationId(IIdType theId) { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java index d6012ee366d..37f89c9fe2f 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java @@ -122,7 +122,7 @@ public class FetchResourceIdsStep implements IFirstJobStepWorker bindings) { diff --git a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java index 0860043f5d0..6da640e9afa 100644 --- a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java +++ b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java @@ -106,7 +106,7 @@ public final class HapiWorkerContext extends I18nBase implements IWorkerContext @Override public Map getNSUrlMap() { - throw new UnsupportedOperationException(Msg.code(2107)); + throw new UnsupportedOperationException(Msg.code(2241)); } @Override diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/RestServerDstu3Helper.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/RestServerDstu3Helper.java index 303aee6a72c..1150bfa416f 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/RestServerDstu3Helper.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/RestServerDstu3Helper.java @@ -66,7 +66,7 @@ public class RestServerDstu3Helper extends BaseRestServerHelper implements IPoin try { myRestServer.initialize(); } catch (ServletException e) { - throw new RuntimeException(Msg.code(2112)+"Failed to initialize server", e); + throw new RuntimeException(Msg.code(2252)+"Failed to initialize server", e); } } } @@ -294,7 +294,7 @@ public class RestServerDstu3Helper extends BaseRestServerHelper implements IPoin @Override public MethodOutcome update(T theResource, String theConditional, RequestDetails theRequestDetails) { if (myFailNextPut) { - throw new PreconditionFailedException(Msg.code(2113)+"Failed update operation"); + throw new PreconditionFailedException(Msg.code(2251)+"Failed update operation"); } return super.update(theResource, theConditional, theRequestDetails); } diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java index 435aadb4977..6baac0f80c2 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java @@ -162,18 +162,18 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo @Override public IWorkerContextManager.IPackageLoadingTracker getPackageTracker() { - throw new UnsupportedOperationException(Msg.code(2108)); + throw new UnsupportedOperationException(Msg.code(2235)); } @Override public IWorkerContext setPackageTracker( IWorkerContextManager.IPackageLoadingTracker packageTracker) { - throw new UnsupportedOperationException(Msg.code(2114)); + throw new UnsupportedOperationException(Msg.code(2266)); } @Override public PackageInformation getPackageForUrl(String s) { - throw new UnsupportedOperationException(Msg.code(2109)); + throw new UnsupportedOperationException(Msg.code(2236)); } @Override @@ -410,7 +410,7 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo @Override public Map getNSUrlMap() { - throw new UnsupportedOperationException(Msg.code(2111)); + throw new UnsupportedOperationException(Msg.code(2265)); } @Override diff --git a/hapi-tinder-test/pom.xml b/hapi-tinder-test/pom.xml index 675bc8c3168..d0decbb3444 100644 --- a/hapi-tinder-test/pom.xml +++ b/hapi-tinder-test/pom.xml @@ -62,12 +62,6 @@ - - ca.uhn.hapi.fhir hapi-tinder-plugin @@ -136,37 +130,6 @@ - generalstructs @@ -383,8 +346,6 @@ - @@ -420,7 +381,6 @@ targetPackage="ca.uhn.test.ant.multi.r5" filenameSuffix="ResourceTest.java" projectHome="${project.basedir}/.." version="r5" includeResources="patient,organization" /> - - + + 5.6.84 + 1.0.3 + -Dfile.encoding=UTF-8 -Xmx2048m - 5.6.84 - 1.0.3 + + yyyy-MM-dd'T'HH:mm:ss'Z' + UTF-8 - -Dfile.encoding=UTF-8 -Xmx2048m + + ${user.home}/sites/hapi-fhir + ${user.home}/sites/scm/hapi-fhir - - yyyy-MM-dd'T'HH:mm:ss'Z' + + 1.2.0 + 4.2.5 + 1.2 + 3.1.1 + 10.6.0 + 3.2.0 + 2.12.1 + 1.15 + 1.21 + 1.10.0 + 2.11.0 + 3.12.0 + 1.2 + 10.14.2.0 + 2.10.0 + 4.8.1 + 0.7.9 + 31.0.1-jre + 2.8.9 + 2.2.11_1 + 2.3.1 + 2.3.0.1 + 3.0.0 + 4.2.0 + 3.0.3 + 10.0.12 + 3.0.2 + 5.9.1 + 0.50.40 + 9.4.0 + 5.6.12.Final + 6.1.6.Final + 1.4.4 + + 8.11.1 + 2.2 + 6.1.5.Final + 4.4.13 + 4.5.13 + 2.14.1 + 2.14.1 + 3.3.0 + 1.8 + 4.10.0 + 4.1.2 + 1.4 + 5.0.2.Final + 5.6.5 + 9.5.4 + 2.9.0 + 9.8.0-15 + 1.2_5 + 2.1.12 + 2.0.3 + 2.19.0 + 5.3.23 + 2021.2.2 + 4.3.3 + 2.7.5 + 1.2.2.RELEASE - UTF-8 + 3.1.4 + 1.17.1 + 3.0.14.RELEASE + 4.4.1 - - ${user.home}/sites/hapi-fhir - ${user.home}/sites/scm/hapi-fhir + + 1.6.0 - - 1.2.0 - 4.2.5 - 1.2 - 3.1.1 - 10.4 - 1.15 - 1.21 - 1.10.0 - 2.11.0 - 3.12.0 - 1.2 - 10.14.2.0 - - 2.10.0 - 4.8.1 - 0.7.9 - 31.0.1-jre - 2.8.9 - 2.2.11_1 - 2.3.1 - 2.3.0.1 - 3.0.0 - 4.2.0 - 3.0.3 - 10.0.12 - 3.0.2 - 5.9.1 - 0.50.40 - 9.4.0 - 5.6.12.Final - 6.1.6.Final - 1.4.4 - - 8.11.1 - 2.2 - 6.1.5.Final - 4.4.13 - 4.5.13 - 2.14.1 - 2.14.1 - 3.3.0 - 1.8 - 4.10.0 - 4.1.2 - 1.4 - 5.0.2.Final - 5.6.5 - 9.5.4 - 2.9.0 - 9.8.0-15 - 1.2_5 - 2.1.12 - 2.0.3 - 2.19.0 - 5.3.23 - 2021.2.2 - 4.3.3 - 2.7.5 - 1.2.2.RELEASE + UTF-8 + 1.0.1 - 3.1.4 - 1.17.1 - 3.0.14.RELEASE - 4.4.1 + 1.28.4 + + 2.4.0 + 2.3.0 + 2.3.0 - - 1.6.0 + + 5.4.1 + 11 + 11 + 11 + 17 + 17 + 17 - UTF-8 - 1.0.1 - - 1.28.4 - - 2.4.0 - 2.3.0 - 2.3.0 - - - 5.4.1 - 11 - 11 - 11 - 17 - 17 - 17 - - - + + @@ -2126,24 +2124,6 @@ - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.2.0 - - - com.puppycrawl.tools - checkstyle - ${checkstyle_version} - - - ca.uhn.hapi.fhir - hapi-fhir-checkstyle - - 6.5.0-SNAPSHOT - - - org.apache.maven.plugins maven-resources-plugin @@ -2195,8 +2175,6 @@ 500m 2000m - - org.apache.maven.plugins @@ -2309,6 +2287,11 @@ jetty-maven-plugin ${jetty_version} + + org.apache.maven.plugins + maven-changes-plugin + ${maven_changes_version} + org.eluder.coveralls coveralls-maven-plugin @@ -2381,47 +2364,6 @@ - @@ -2483,6 +2425,7 @@ + org.apache.maven.plugins maven-antrun-plugin false @@ -2770,7 +2713,7 @@ org.apache.maven.plugins maven-changes-plugin - 2.12.1 + ${maven_changes_version} false @@ -2815,20 +2758,7 @@ maven-project-info-reports-plugin 3.0.0 false - - @@ -2903,22 +2833,23 @@ org.apache.maven.plugins - maven-checkstyle-plugin + maven-antrun-plugin + 1.8 - validate - generate-sources - - - ${maven.multiModuleProjectDirectory}/src/checkstyle/checkstyle_config_nofixmes.xml - UTF-8 - true - true - false - - - check - + delete-module-cache-file + none + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${maven_checkstyle_version} + + + hapi-single-module-checkstyle + none @@ -3011,13 +2942,6 @@ integration-testnone - - org.apache.maven.plugins - maven-checkstyle-plugin - - validatenone - - diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml deleted file mode 100644 index d175e39ca3c..00000000000 --- a/src/checkstyle/checkstyle.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/checkstyle/checkstyle_config_nofixmes.xml b/src/checkstyle/checkstyle_config_nofixmes.xml deleted file mode 100644 index 3a6f659b155..00000000000 --- a/src/checkstyle/checkstyle_config_nofixmes.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - -