Revert "cleaning up checkstyle files (#4470)"

This reverts commit efae3b5d5f.
This commit is contained in:
Mark Iantorno 2023-02-02 17:24:34 -05:00
parent 0a213a52d6
commit 740fec9554
31 changed files with 534 additions and 365 deletions

View File

@ -80,12 +80,16 @@ 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

View File

@ -1,19 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>6.3.14-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>6.3.14-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>hapi-deployable-pom</artifactId>
<packaging>pom</packaging>
<name>HAPI FHIR - Deployable Artifact Parent POM</name>
<dependencies>
</dependencies>
<build>
<plugins>
<plugin>
@ -118,6 +120,27 @@
</ignoredResourcePatterns>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<logViolationsToConsole>true</logViolationsToConsole>
<failsOnError>true</failsOnError>
<suppressionsLocation>${maven.multiModuleProjectDirectory}/src/checkstyle/checkstyle_suppressions.xml</suppressionsLocation>
<enableRulesSummary>true</enableRulesSummary>
<enableSeveritySummary>true</enableSeveritySummary>
<consoleOutput>true</consoleOutput>
<configLocation>${maven.multiModuleProjectDirectory}/src/checkstyle/checkstyle.xml</configLocation>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
@ -185,6 +208,7 @@
<execution>
<phase>package</phase>
<goals>
<!--<goal>aggregate-jar</goal>-->
<goal>jar</goal>
</goals>
</execution>
@ -228,4 +252,5 @@
</build>
</profile>
</profiles>
</project>

View File

@ -196,62 +196,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<configuration>
<target>
<!--suppress UnresolvedMavenProperty -->
<delete dir="${pom.basedir}/target/" includes="checkstyle*"/>
</target>
</configuration>
<inherited>true</inherited>
<executions>
<execution>
<id>delete-module-cache-file</id>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven_checkstyle_version}</version>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<configLocation>${maven.multiModuleProjectDirectory}/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml</configLocation>
<!--suppress UnresolvedMavenProperty -->
<suppressionsLocation>${maven.multiModuleProjectDirectory}/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle-suppression.xml</suppressionsLocation>
<inputEncoding>UTF-8</inputEncoding>
<consoleOutput>true</consoleOutput>
</configuration>
<inherited>true</inherited>
<executions>
<execution>
<id>hapi-single-module-checkstyle</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-checkstyle</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle_version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<resources>
<resource>

View File

@ -333,7 +333,7 @@ public class FhirValidator {
retval.addAll(messages);
}
} catch (InterruptedException | ExecutionException exp) {
throw new InternalErrorException(Msg.code(2246) + exp);
throw new InternalErrorException(Msg.code(1975) + exp);
}
return retval;
}

View File

@ -18,7 +18,6 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle_version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@ -35,31 +34,6 @@
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.2.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle_version}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-checkstyle</artifactId>
<!-- Remember to bump this when you upgrade the version -->
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<!-- For releases, we need to generate javadoc and sources JAR -->
<profile>
@ -101,44 +75,5 @@
</plugins>
</build>
</profile>
<profile>
<id>CI</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven_checkstyle_version}</version>
<configuration>
<excludes>**/osgi/**/*, **/.mvn/**/*, **/.mvn_/**/*</excludes>
<sourceDirectories>
<!--scan base project directory to include all modules-->
<!--suppress UnresolvedMavenProperty -->
<directory>${maven.multiModuleProjectDirectory}/</directory>
</sourceDirectories>
<!--suppress UnresolvedMavenProperty -->
<configLocation>${maven.multiModuleProjectDirectory}/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml</configLocation>
<!--suppress UnresolvedMavenProperty -->
<suppressionsLocation>${maven.multiModuleProjectDirectory}/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle-suppression.xml</suppressionsLocation>
<inputEncoding>UTF-8</inputEncoding>
<consoleOutput>true</consoleOutput>
</configuration>
<executions>
<execution>
<id>checkstyle-across-all-modules</id>
<phase>install</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
<execution>
<id>hapi-single-module-checkstyle</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -1,41 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="severity" value="error"/>
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value="java, properties, xml, js, json"/>
<module name="TreeWalker">
<!-- Run custom HapiErrorCodeCheck to find duplicate error codes -->
<module name="ca.uhn.fhir.checks.HapiErrorCodeCheck"/>
<!-- Throw error if any FIX ME is left in the code -->
<module name="TodoComment">
<!-- The (?i) below means Case Insensitive -->
<property name="format" value="(?i)FIXME"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="System\.out\.println"/>
<property name="ignoreComments" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="org\.jetbrains\.annotations\.NotNull"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="org\.jetbrains\.annotations\.Nullable"/>
</module>
<!-- Should always use the Spring transactional interface, per: https://stackoverflow.com/questions/26387399/javax-transaction-transactional-vs-org-springframework-transaction-annotation-tr -->
<module name="RegexpSinglelineJava">
<property name="format" value="javax\.transaction\.Transactional"/>
<property name="message"
value="Wrong @Transactional annotation used, use instead: org.springframework.transaction.annotation.Transactional"/>
</module>
<module name="AbstractClassName">
<property name="format" value="^(Base|Abstract).+$"/>
</module>
</module>
</module>

View File

@ -1,6 +1,6 @@
package ca.uhn.fhir.checks;
import com.puppycrawl.tools.checkstyle.FileStatefulCheck;
import com.puppycrawl.tools.checkstyle.StatelessCheck;
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
@ -9,13 +9,15 @@ import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@FileStatefulCheck
/**
* mvn -P CI checkstyle:check
*/
@StatelessCheck
public final class HapiErrorCodeCheck extends AbstractCheck {
private static final Logger ourLog = LoggerFactory.getLogger(HapiErrorCodeCheck.class);
private static final ErrorCodeCache ourCache = ErrorCodeCache.INSTANCE;
private static final Map<Integer, String> ourCodesUsed = new HashMap<>();
@Override
public int[] getDefaultTokens() {
@ -40,6 +42,10 @@ 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()) {
@ -62,13 +68,14 @@ 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 (ourCache.containsKey(code)) {
if (ourCodesUsed.containsKey(code)) {
log(theAst.getLineNo(), "Two different exception messages call Msg.code(" +
code + "). \nEach thrown exception must call Msg.code() with a different code. " +
"\nPreviously found at: " + ourCache.get(code));
code +
"). Each thrown exception throw call Msg.code() with a different code. " +
"Previously found at: " + ourCodesUsed.get(code));
} else {
String location = getFilePath() + ":" + instantiation.getLineNo() + ":" + instantiation.getColumnNo() + "(" + code + ")";
ourCache.put(code, location);
String location = getFileContents().getFileName() + ":" + instantiation.getLineNo() + ":" + instantiation.getColumnNo() + "(" + code + ")";
ourCodesUsed.put(code, location);
}
} else {
log(theAst.getLineNo(), "Called Msg.code() with a non-integer argument");
@ -103,30 +110,5 @@ public final class HapiErrorCodeCheck extends AbstractCheck {
}
return null;
}
public enum ErrorCodeCache {
INSTANCE;
private static final Map<Integer, String> 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<Integer> keySet() {
return ourCodesUsed.keySet();
}
}
}

View File

@ -44,13 +44,12 @@ class HapiErrorCodeCheckTest {
// validate
String[] errorLines = errors.toString().split("\r?\n");
Arrays.stream(errorLines).forEach(ourLog::info);
assertEquals(4, errorLines.length);
assertEquals(2, 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("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:"));
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"));
}
private Checker buildChecker() throws CheckstyleException {

View File

@ -2,15 +2,16 @@ public class BadClass {
public void init() throws Exception {
int i = 1;
if (i == 0) {
throw new MessagingException(theMessage, Msg.code(2259) + "Failure handling subscription payload", e);
throw new MessagingException(theMessage, Msg.code(6) + "Failure handling subscription payload", e);
} else if (i == 1) {
throw new RuntimeException("nocode");
} else if (i == 2) {
throw new RuntimeException(Msg.code(2258) + "duplicate code");
throw new RuntimeException(Msg.code(2) + "duplicate code");
} else if (i == 3) {
throw new RuntimeException(Msg.code(2258) + "duplicate code");
throw new RuntimeException(Msg.code(2) + "duplicate code");
} else if (i == 4) {
throw new RuntimeException(Msg.code(1) + "good");
}
ClassCastException e = new ClassCastException();
throwException(i, e);
}

View File

@ -531,7 +531,7 @@ public abstract class BaseCommand implements Comparable<BaseCommand> {
return Optional.of(new TlsAuthentication(keyStoreInfo, trustStoreInfo));
}
catch(Exception e){
throw new RuntimeException(Msg.code(2253)+"Could not create TLS configuration options", e);
throw new RuntimeException(Msg.code(2115)+"Could not create TLS configuration options", e);
}
}

View File

@ -48,7 +48,7 @@ public class ValidationSupportChainCreator {
chain.addValidationSupport(localFileValidationSupport);
chain.addValidationSupport(new SnapshotGeneratingValidationSupport(ctx));
} catch (IOException e) {
throw new RuntimeException(Msg.code(2254) + "Failed to load local profile.", e);
throw new RuntimeException(Msg.code(2207) + "Failed to load local profile.", e);
}
}
if (commandLine.hasOption("r")) {

View File

@ -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<String, List<String>> theParams, EncodingEnum theEncoding) {
initBaseRequest(theContext, theEncoding, getFormBodyFromParams(theParams));
return myRequest;
return myRequest;
}
private RequestBody getFormBodyFromParams(Map<String, List<String>> queryParams) {

View File

@ -20,7 +20,6 @@ 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;

View File

@ -549,7 +549,7 @@ public class JpaBulkExportProcessor implements IBulkExportProcessor<JpaPid> {
Optional<RuntimeSearchParam> 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(2242) + errorMessage);
throw new IllegalArgumentException(Msg.code(2103) + errorMessage);
} else {
return oPatientSearchParam.get();
}

View File

@ -452,7 +452,7 @@ public class ExtendedHSearchClauseBuilder {
booleanStep.minimumShouldMatchNumber(1);
return booleanStep;
}
throw new IllegalArgumentException(Msg.code(2255) + "Date search param does not support prefix of type: " + prefix);
throw new IllegalArgumentException(Msg.code(2025) + "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(2256) + "Date search param does not support prefix of type: " + prefix);
throw new IllegalArgumentException(Msg.code(2026) + "Date search param does not support prefix of type: " + prefix);
}

View File

@ -20,7 +20,6 @@ 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;

View File

@ -35,7 +35,7 @@ public class NicknameMatcher implements IMdmStringMatcher {
try {
myNicknameSvc = new NicknameSvc();
} catch (IOException e) {
throw new ConfigurationException(Msg.code(2234) + "Unable to load nicknames", e);
throw new ConfigurationException(Msg.code(2078) + "Unable to load nicknames", e);
}
}

View File

@ -173,7 +173,7 @@ public class HashMapResourceProvider<T extends IBaseResource> implements IResour
TreeMap<Long, T> versions = myIdToVersionToResourceMap.get(theId.getIdPart());
if (versions == null || versions.isEmpty()) {
throw new ResourceNotFoundException(Msg.code(2250) + theId);
throw new ResourceNotFoundException(Msg.code(1979) + theId);
}
T deletedInstance = (T) myFhirContext.getResourceDefinition(myResourceType).newInstance();
@ -240,7 +240,7 @@ public class HashMapResourceProvider<T extends IBaseResource> implements IResour
public synchronized List<IBaseResource> historyInstance(@IdParam IIdType theId, RequestDetails theRequestDetails) {
LinkedList<T> retVal = myIdToHistory.get(theId.getIdPart());
if (retVal == null) {
throw new ResourceNotFoundException(Msg.code(2248) + theId);
throw new ResourceNotFoundException(Msg.code(1980) + theId);
}
return fireInterceptorsAndFilterAsNeeded(retVal, theRequestDetails);
@ -255,7 +255,7 @@ public class HashMapResourceProvider<T extends IBaseResource> implements IResour
public synchronized T read(@IdParam IIdType theId, RequestDetails theRequestDetails) {
TreeMap<Long, T> versions = myIdToVersionToResourceMap.get(theId.getIdPart());
if (versions == null || versions.isEmpty()) {
throw new ResourceNotFoundException(Msg.code(2247) + theId);
throw new ResourceNotFoundException(Msg.code(1981) + theId);
}
T retVal;
@ -271,14 +271,14 @@ public class HashMapResourceProvider<T extends IBaseResource> implements IResour
}
if (retVal == null || ResourceMetadataKeyEnum.DELETED_AT.get(retVal) != null) {
throw new ResourceGoneException(Msg.code(2244) + theId);
throw new ResourceGoneException(Msg.code(1983) + theId);
}
myReadCount.incrementAndGet();
retVal = fireInterceptorsAndFilterAsNeeded(retVal, theRequestDetails);
if (retVal == null) {
throw new ResourceNotFoundException(Msg.code(2243) + theId);
throw new ResourceNotFoundException(Msg.code(1984) + theId);
}
return retVal;
}

View File

@ -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(2245) + theId);
throw new ResourceNotFoundException(Msg.code(1977) + 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(2249) + theId);
throw new ResourceNotFoundException(Msg.code(1978) + theId);
}
private String getOperationId(IIdType theId) {

View File

@ -122,7 +122,7 @@ public class FetchResourceIdsStep implements IFirstJobStepWorker<BulkExportJobPa
theDataSink.recoveredError(ex.getMessage());
throw new JobExecutionFailedException(Msg.code(2239) + " : " + ex.getMessage());
throw new JobExecutionFailedException(Msg.code(2104) + " : " + ex.getMessage());
}
ourLog.info("Submitted {} groups of ids for processing", submissionCount);

View File

@ -98,7 +98,7 @@ public class WriteBinaryStep implements IJobStepWorker<BulkExportJobParameters,
ex.getMessage());
ourLog.error(errorMsg);
throw new JobExecutionFailedException(Msg.code(2238) + errorMsg);
throw new JobExecutionFailedException(Msg.code(2105) + errorMsg);
}
DaoMethodOutcome outcome = binaryDao.create(binary,

View File

@ -72,7 +72,7 @@ public class Batch2JobRunnerImpl implements IBatch2JobRunner {
public Batch2JobInfo getJobInfo(String theJobId) {
JobInstance instance = myJobCoordinator.getInstance(theJobId);
if (instance == null) {
throw new ResourceNotFoundException(Msg.code(2240) + " : " + theJobId);
throw new ResourceNotFoundException(Msg.code(2102) + " : " + theJobId);
}
return fromJobInstanceToBatch2JobInfo(instance);
}

View File

@ -475,7 +475,7 @@ public class ServerCapabilityStatementProvider extends BaseServerCapabilityState
if (searchBindings != null && !searchBindings.isEmpty()) {
return readOperationDefinitionForNamedSearch(searchBindings);
}
throw new ResourceNotFoundException(Msg.code(2257) + theId);
throw new ResourceNotFoundException(Msg.code(1985) + theId);
}
private OperationDefinition readOperationDefinitionForNamedSearch(List<SearchMethodBinding> bindings) {

View File

@ -106,7 +106,7 @@ public final class HapiWorkerContext extends I18nBase implements IWorkerContext
@Override
public Map<String, NamingSystem> getNSUrlMap() {
throw new UnsupportedOperationException(Msg.code(2241));
throw new UnsupportedOperationException(Msg.code(2107));
}
@Override

View File

@ -66,7 +66,7 @@ public class RestServerDstu3Helper extends BaseRestServerHelper implements IPoin
try {
myRestServer.initialize();
} catch (ServletException e) {
throw new RuntimeException(Msg.code(2252)+"Failed to initialize server", e);
throw new RuntimeException(Msg.code(2112)+"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(2251)+"Failed update operation");
throw new PreconditionFailedException(Msg.code(2113)+"Failed update operation");
}
return super.update(theResource, theConditional, theRequestDetails);
}

View File

@ -162,13 +162,13 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo
@Override
public IWorkerContextManager.IPackageLoadingTracker getPackageTracker() {
throw new UnsupportedOperationException(Msg.code(2235));
throw new UnsupportedOperationException(Msg.code(2108));
}
@Override
public IWorkerContext setPackageTracker(
IWorkerContextManager.IPackageLoadingTracker packageTracker) {
throw new UnsupportedOperationException(Msg.code(2266));
throw new UnsupportedOperationException(Msg.code(2114));
}
@Override
@ -180,7 +180,7 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo
@Override
public PackageInformation getPackageForUrl(String s) {
throw new UnsupportedOperationException(Msg.code(2236));
throw new UnsupportedOperationException(Msg.code(2109));
}
@Override
@ -417,7 +417,7 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo
@Override
public Map<String, NamingSystem> getNSUrlMap() {
throw new UnsupportedOperationException(Msg.code(2265));
throw new UnsupportedOperationException(Msg.code(2111));
}
@Override

View File

@ -62,6 +62,12 @@
<build>
<plugins>
<!-- <plugin> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-tinder-plugin</artifactId> <version>1.0-SNAPSHOT</version> <executions> <execution> <id>structs</id> <goals> <goal>generate-structures</goal>
</goals> <configuration> <package>ca.uhn.tindertest</package> <baseResourceNames> <baseResourceName>patient</baseResourceName> <baseResourceName>valueset</baseResourceName> <baseResourceName>organization</baseResourceName>
<baseResourceName>device</baseResourceName> <baseResourceName>location</baseResourceName> <baseResourceName>practitioner</baseResourceName> </baseResourceNames> </configuration> </execution> <execution>
<id>client</id> <goals> <goal>generate-client</goal> </goals> <configuration> <clientClassName>ca.uhn.hitest.HiTest</clientClassName> <serverBaseHref>http://fhir.healthintersections.com.au/open</serverBaseHref>
<generateSearchForAllParams>true</generateSearchForAllParams> </configuration> </execution> </executions> </plugin> -->
<plugin>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-tinder-plugin</artifactId>
@ -130,6 +136,37 @@
</dependency>
</dependencies>
<executions>
<!--
<execution>
<id>custom-structs</id>
<goals>
<goal>generate-structures</goal>
</goals>
<configuration>
<package>ca.uhn.test.customstructs</package>
<profileHttpBase>http://foo</profileHttpBase>
<version>dstu</version>
<resourceProfileFiles>
<resourceProfileFile>
<profileFile>${project.basedir}/src/test/resources/profile/patient.xml</profileFile>
<profileSourceUrl>http://foo1</profileSourceUrl>
</resourceProfileFile>
<resourceProfileFile>
<profileFile>${project.basedir}/src/test/resources/profile/organization.xml</profileFile>
<profileSourceUrl>http://foo1</profileSourceUrl>
</resourceProfileFile>
</resourceProfileFiles>
<resourceValueSetFiles>
<resourceValueSetFile>
<valueSetFile>${project.basedir}/src/test/resources/valueset/valueset-cgta-patientidpool.xml</valueSetFile>
</resourceValueSetFile>
<resourceValueSetFile>
<valueSetFile>${project.basedir}/src/test/resources/valueset/valueset-cgta-provideridpool.xml</valueSetFile>
</resourceValueSetFile>
</resourceValueSetFiles>
</configuration>
</execution>
-->
<execution>
<id>generalstructs</id>
<goals>
@ -346,6 +383,8 @@
</includeResources>
</configuration>
</execution>
<!-- <execution> <id>client</id> <goals> <goal>generate-client</goal> </goals> <configuration> <clientClassName>ca.uhn.hitest.HiTest</clientClassName> <serverBaseHref>http://fhir.healthintersections.com.au/open</serverBaseHref>
<generateSearchForAllParams>true</generateSearchForAllParams> </configuration> </execution> -->
</executions>
</plugin>
<plugin>
@ -381,6 +420,7 @@
targetPackage="ca.uhn.test.ant.multi.r5" filenameSuffix="ResourceTest.java" projectHome="${project.basedir}/.."
version="r5" includeResources="patient,organization" />
<hapi-tinder templateFile="${project.basedir}/src/test/resources/templates/resource_test_beans_java.vm"
generateResources="true" targetSourceDirectory="${project.build.directory}/generated-sources/tinder"
targetFile="TestConfigDstu2.java" targetPackage="ca.uhn.test.ant.single" packageBase="ca.uhn.test.ant.multi"

301
pom.xml
View File

@ -866,104 +866,109 @@
<ucum_version>1.0.3</ucum_version>
<surefire_jvm_args>-Dfile.encoding=UTF-8 -Xmx2048m</surefire_jvm_args>
<!-- configure timestamp in MANIFEST.MF for maven-war-provider -->
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<fhir_core_version>5.6.84</fhir_core_version>
<ucum_version>1.0.3</ucum_version>
<!-- For site-deploy -->
<siteMainDirectory>${user.home}/sites/hapi-fhir</siteMainDirectory>
<scmPubCheckoutDirectory>${user.home}/sites/scm/hapi-fhir</scmPubCheckoutDirectory>
<surefire_jvm_args>-Dfile.encoding=UTF-8 -Xmx2048m</surefire_jvm_args>
<!-- Dependency Versions -->
<activation_api_version>1.2.0</activation_api_version>
<apache_karaf_version>4.2.5</apache_karaf_version>
<aries_spifly_version>1.2</aries_spifly_version>
<caffeine_version>3.1.1</caffeine_version>
<checkstyle_version>10.6.0</checkstyle_version>
<maven_checkstyle_version>3.2.0</maven_checkstyle_version>
<maven_changes_version>2.12.1</maven_changes_version>
<commons_codec_version>1.15</commons_codec_version>
<commons_compress_version>1.21</commons_compress_version>
<commons_text_version>1.10.0</commons_text_version>
<commons_io_version>2.11.0</commons_io_version>
<commons_lang3_version>3.12.0</commons_lang3_version>
<com_jamesmurty_utils_version>1.2</com_jamesmurty_utils_version>
<derby_version>10.14.2.0</derby_version>
<error_prone_core_version>2.10.0</error_prone_core_version>
<mockito_version>4.8.1</mockito_version>
<nullaway_version>0.7.9</nullaway_version>
<guava_version>31.0.1-jre</guava_version>
<gson_version>2.8.9</gson_version>
<jaxb_bundle_version>2.2.11_1</jaxb_bundle_version>
<jaxb_api_version>2.3.1</jaxb_api_version>
<jaxb_core_version>2.3.0.1</jaxb_core_version>
<jaxb_runtime_version>3.0.0</jaxb_runtime_version>
<jena_version>4.2.0</jena_version>
<jersey_version>3.0.3</jersey_version>
<jetty_version>10.0.12</jetty_version>
<jsr305_version>3.0.2</jsr305_version>
<junit_version>5.9.1</junit_version>
<flexmark_version>0.50.40</flexmark_version>
<flyway_version>9.4.0</flyway_version>
<hibernate_version>5.6.12.Final</hibernate_version>
<hibernate_search_version>6.1.6.Final</hibernate_search_version>
<logback_version>1.4.4</logback_version>
<!-- Update lucene version when you update hibernate-search version -->
<lucene_version>8.11.1</lucene_version>
<hamcrest_version>2.2</hamcrest_version>
<hibernate_validator_version>6.1.5.Final</hibernate_validator_version>
<httpcore_version>4.4.13</httpcore_version>
<httpclient_version>4.5.13</httpclient_version>
<jackson_version>2.14.1</jackson_version>
<jackson_databind_version>2.14.1</jackson_databind_version>
<maven_assembly_plugin_version>3.3.0</maven_assembly_plugin_version>
<maven_license_plugin_version>1.8</maven_license_plugin_version>
<okhttp_version>4.10.0</okhttp_version>
<poi_version>4.1.2</poi_version>
<poi_ooxml_schemas_version>1.4</poi_ooxml_schemas_version>
<resteasy_version>5.0.2.Final</resteasy_version>
<ph_schematron_version>5.6.5</ph_schematron_version>
<ph_commons_version>9.5.4</ph_commons_version>
<plexus_compiler_api_version>2.9.0</plexus_compiler_api_version>
<servicemix_saxon_version>9.8.0-15</servicemix_saxon_version>
<servicemix_xmlresolver_version>1.2_5</servicemix_xmlresolver_version>
<swagger_version>2.1.12</swagger_version>
<slf4j_version>2.0.3</slf4j_version>
<log4j_to_slf4j_version>2.19.0</log4j_to_slf4j_version>
<spring_version>5.3.23</spring_version>
<spring_data_bom_version>2021.2.2</spring_data_bom_version>
<spring_batch_version>4.3.3</spring_batch_version>
<spring_boot_version>2.7.5</spring_boot_version>
<spring_retry_version>1.2.2.RELEASE</spring_retry_version>
<!-- configure timestamp in MANIFEST.MF for maven-war-provider -->
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
<stax2_api_version>3.1.4</stax2_api_version>
<testcontainers_version>1.17.1</testcontainers_version>
<thymeleaf-version>3.0.14.RELEASE</thymeleaf-version>
<woodstox_core_asl_version>4.4.1</woodstox_core_asl_version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- We are aiming to still work on a very old version of SLF4j even though we depend on the newest, just to be nice to users of the API. This version is tested in the hapi-fhir-cobertura. -->
<slf4j_target_version>1.6.0</slf4j_target_version>
<!-- For site-deploy -->
<siteMainDirectory>${user.home}/sites/hapi-fhir</siteMainDirectory>
<scmPubCheckoutDirectory>${user.home}/sites/scm/hapi-fhir</scmPubCheckoutDirectory>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<ebay_cors_filter_version>1.0.1</ebay_cors_filter_version>
<!-- Dependency Versions -->
<activation_api_version>1.2.0</activation_api_version>
<apache_karaf_version>4.2.5</apache_karaf_version>
<aries_spifly_version>1.2</aries_spifly_version>
<caffeine_version>3.1.1</caffeine_version>
<checkstyle_version>10.4</checkstyle_version>
<commons_codec_version>1.15</commons_codec_version>
<commons_compress_version>1.21</commons_compress_version>
<commons_text_version>1.10.0</commons_text_version>
<commons_io_version>2.11.0</commons_io_version>
<commons_lang3_version>3.12.0</commons_lang3_version>
<com_jamesmurty_utils_version>1.2</com_jamesmurty_utils_version>
<derby_version>10.14.2.0</derby_version>
<!--<derby_version>10.15.1.3</derby_version>-->
<error_prone_core_version>2.10.0</error_prone_core_version>
<mockito_version>4.8.1</mockito_version>
<nullaway_version>0.7.9</nullaway_version>
<guava_version>31.0.1-jre</guava_version>
<gson_version>2.8.9</gson_version>
<jaxb_bundle_version>2.2.11_1</jaxb_bundle_version>
<jaxb_api_version>2.3.1</jaxb_api_version>
<jaxb_core_version>2.3.0.1</jaxb_core_version>
<jaxb_runtime_version>3.0.0</jaxb_runtime_version>
<jena_version>4.2.0</jena_version>
<jersey_version>3.0.3</jersey_version>
<jetty_version>10.0.12</jetty_version>
<jsr305_version>3.0.2</jsr305_version>
<junit_version>5.9.1</junit_version>
<flexmark_version>0.50.40</flexmark_version>
<flyway_version>9.4.0</flyway_version>
<hibernate_version>5.6.12.Final</hibernate_version>
<hibernate_search_version>6.1.6.Final</hibernate_search_version>
<logback_version>1.4.4</logback_version>
<!-- Update lucene version when you update hibernate-search version -->
<lucene_version>8.11.1</lucene_version>
<hamcrest_version>2.2</hamcrest_version>
<hibernate_validator_version>6.1.5.Final</hibernate_validator_version>
<httpcore_version>4.4.13</httpcore_version>
<httpclient_version>4.5.13</httpclient_version>
<jackson_version>2.14.1</jackson_version>
<jackson_databind_version>2.14.1</jackson_databind_version>
<maven_assembly_plugin_version>3.3.0</maven_assembly_plugin_version>
<maven_license_plugin_version>1.8</maven_license_plugin_version>
<okhttp_version>4.10.0</okhttp_version>
<poi_version>4.1.2</poi_version>
<poi_ooxml_schemas_version>1.4</poi_ooxml_schemas_version>
<resteasy_version>5.0.2.Final</resteasy_version>
<ph_schematron_version>5.6.5</ph_schematron_version>
<ph_commons_version>9.5.4</ph_commons_version>
<plexus_compiler_api_version>2.9.0</plexus_compiler_api_version>
<servicemix_saxon_version>9.8.0-15</servicemix_saxon_version>
<servicemix_xmlresolver_version>1.2_5</servicemix_xmlresolver_version>
<swagger_version>2.1.12</swagger_version>
<slf4j_version>2.0.3</slf4j_version>
<log4j_to_slf4j_version>2.19.0</log4j_to_slf4j_version>
<spring_version>5.3.23</spring_version>
<spring_data_bom_version>2021.2.2</spring_data_bom_version>
<spring_batch_version>4.3.3</spring_batch_version>
<spring_boot_version>2.7.5</spring_boot_version>
<spring_retry_version>1.2.2.RELEASE</spring_retry_version>
<elastic_apm_version>1.28.4</elastic_apm_version>
<!-- CQL Support -->
<cqframework.version>2.4.0</cqframework.version>
<cql-engine.version>2.3.0</cql-engine.version>
<cql-evaluator.version>2.3.0</cql-evaluator.version>
<stax2_api_version>3.1.4</stax2_api_version>
<testcontainers_version>1.17.1</testcontainers_version>
<thymeleaf-version>3.0.14.RELEASE</thymeleaf-version>
<woodstox_core_asl_version>4.4.1</woodstox_core_asl_version>
<!-- Site properties -->
<fontawesomeVersion>5.4.1</fontawesomeVersion>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.testSource>17</maven.compiler.testSource>
<maven.compiler.testTarget>17</maven.compiler.testTarget>
<maven.compiler.testRelease>17</maven.compiler.testRelease>
<!-- We are aiming to still work on a very old version of SLF4j even though we depend on the newest, just to be nice to users of the API. This version is tested in the hapi-fhir-cobertura. -->
<slf4j_target_version>1.6.0</slf4j_target_version>
<!-- Jacoco -->
<argLine></argLine>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<ebay_cors_filter_version>1.0.1</ebay_cors_filter_version>
<elastic_apm_version>1.28.4</elastic_apm_version>
<!-- CQL Support -->
<cqframework.version>2.4.0</cqframework.version>
<cql-engine.version>2.3.0</cql-engine.version>
<cql-evaluator.version>2.3.0</cql-evaluator.version>
<!-- Site properties -->
<fontawesomeVersion>5.4.1</fontawesomeVersion>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.testSource>17</maven.compiler.testSource>
<maven.compiler.testTarget>17</maven.compiler.testTarget>
<maven.compiler.testRelease>17</maven.compiler.testRelease>
<!-- Jacoco -->
<argLine></argLine>
</properties>
<dependencyManagement>
@ -2121,6 +2126,24 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.2.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle_version}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-checkstyle</artifactId>
<!-- Remember to bump this when you upgrade the version -->
<version>6.3.14-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
@ -2172,6 +2195,8 @@
<meminitial>500m</meminitial>
<maxmem>2000m</maxmem>
</configuration>
<dependencies>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -2284,11 +2309,6 @@
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty_version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>${maven_changes_version}</version>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
@ -2361,6 +2381,47 @@
<ignore></ignore>
</action>
</pluginExecution>
<!--
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
build-helper-maven-plugin
</artifactId>
<versionRange>
[1.9.1,)
</versionRange>
<goals>
<goal>add-source</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<versionRange>
[3.3,)
</versionRange>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
-->
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
@ -2422,7 +2483,6 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<inherited>false</inherited>
<executions>
@ -2710,7 +2770,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>${maven_changes_version}</version>
<version>2.12.1</version>
<inherited>false</inherited>
<reportSets>
<reportSet>
@ -2755,7 +2815,20 @@
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
<inherited>false</inherited>
<!--
<reportSets>
<reportSet>
<reports>
<report>team</report>
<report>issue-management</report>
<report>license</report>
<report>scm</report>
</reports>
</reportSet>
</reportSets>
-->
</plugin>
<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-linkcheck-plugin</artifactId> <version>1.1</version> </plugin> -->
</plugins>
</reporting>
@ -2828,25 +2901,24 @@
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>delete-module-cache-file</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven_checkstyle_version}</version>
<executions>
<execution>
<id>hapi-single-module-checkstyle</id>
<phase>none</phase>
<id>validate</id>
<phase>generate-sources</phase>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<configLocation>${maven.multiModuleProjectDirectory}/src/checkstyle/checkstyle_config_nofixmes.xml</configLocation>
<inputEncoding>UTF-8</inputEncoding>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<failsOnError>false</failsOnError>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
@ -2939,6 +3011,13 @@
<execution><id>integration-test</id><phase>none</phase></execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution><id>validate</id><phase>none</phase></execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

View File

@ -0,0 +1,192 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="cacheFile" value="target/cache_non_main_files"/>
<!-- <module name="SuppressionFilter">-->
<!-- <property name="file" value="${basedir}/src/checkstyle/checkstyle_suppressions.xml" />-->
<!-- </module> TODO GGG propagate this to master -->
<module name="TreeWalker">
<module name="RegexpSinglelineJava">
<property name="format" value="System\.out\.println"/>
<property name="ignoreComments" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="org\.jetbrains\.annotations\.NotNull"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="org\.jetbrains\.annotations\.Nullable"/>
</module>
<!-- Should always use the Spring transactional interface, per: https://stackoverflow.com/questions/26387399/javax-transaction-transactional-vs-org-springframework-transaction-annotation-tr -->
<module name="RegexpSinglelineJava">
<property name="format" value="javax\.transaction\.Transactional"/>
<property name="message"
value="Wrong @Transactional annotation used, use instead: org.springframework.transaction.annotation.Transactional"/>
</module>
<module name="AbstractClassName">
<property name="format" value="^(Base|Abstract).+$"/>
</module>
</module>
<!--
<module name="TreeWalker">
<property name="tabWidth" value="3"/>
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message"
value="Avoid using corresponding octal or Unicode escape."/>
</module>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="LineLength">
<property name="max" value="300"/>
<property name="ignorePattern"
value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="org.jetbrains.annotations.NotNull"/>
<property name="message" value="Incorrect NotNull annotation used: The &quot;javax.annotation.Nonnull&quot; annotation should be used for non-null things"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="org.jetbrains.annotations.Nullable"/>
<property name="message" value="Incorrect Nullable annotation used: The &quot;javax.annotation.Nullable&quot; annotation should be used for nullable things"/>
</module>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<module name="RightCurly">
<property name="option" value="alone"/>
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<module name="FallThrough"/>
<module name="UpperEll"/>
<module name="ModifierOrder"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="SeparatorWrap">
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<module name="UncommentedMain"/>
<module name="Indentation">
<property name="basicOffset" value="3"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="0"/>
<property name="throwsIndent" value="6"/>
<property name="lineWrappingIndentation" value="6"/>
<property name="arrayInitIndent" value="3"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="1"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="MethodParamPad"/>
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens"
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
</module>
<module name="AnnotationLocation">
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadocCheck">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc"/>
</module>
-->
</module>

View File

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name = "Checker">
<property name="severity" value="error"/>
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value="java, properties, xml, js, json"/>
<module name="TreeWalker">
<module name="TodoComment">
<!-- The (?i) below means Case Insensitive -->
<property name="format" value="(?i)FIXME"/>
</module>
<module name="ca.uhn.fhir.checks.HapiErrorCodeCheck"/>
</module>
</module>

View File

@ -1,18 +1,10 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress files="[/\\]test[/\\]" checks="[a-zA-Z0-9]*" />
<suppress files="[/\\]resources[/\\]" checks="[a-zA-Z0-9]*" />
<suppress files="[\\/]target[\\/]" checks="[a-zA-Z0-9]*" />
<suppress files="[\\/]hapi-fhir-docs[\\/]" checks="[a-zA-Z0-9]*" />
<suppress files="[\\/]hapi-fhir-checkstyle[\\/]" checks="[a-zA-Z0-9]*" />
<suppress files="[\\/]hapi-fhir-jpaserver-test-utilities[\\/]" checks="[a-zA-Z0-9]*" />
<suppress files="[\\/]hapi-tinder-plugin[\\/]" checks="[a-zA-Z0-9]*" />
<suppress files="[\\/]osgi[\\/]" checks="[a-zA-Z0-9]*"/>
<!-- Name suppressions -->
<suppress files="Base64BinaryDt\.java" checks="AbstractClassName"/>
<!-- TODO KHS cdr instantiates these. Remove them once cdr has been fixed. -->
@ -24,6 +16,4 @@
<suppress files="RequestDetails\.java" checks="AbstractClassName"/>
<suppress files="RestfulClientFactory\.java" checks="AbstractClassName"/>
<suppress files="MatchUrlService\.java" checks="AbstractClassName"/>
<suppress files="BaseController\.java" checks="AbstractClassName"/>
</suppressions>