Skip to main content

Java

Follow the Google Java Style Guide.

When using Gradle, use the HMCTS Java plugin to ensure consistent formatting and code quality checks.

Otherwise, install Checkstyle and use the HMCTS Checkstyle configuration.

Immutability

Make objects immutable where possible. Be particularly wary of shared mutable state and stateful objects. Mutability of variables inside a method is acceptable.

Lombok

Optionally, use Lombok to reduce boilerplate code.

JSON

Use Jackson to serialise and deserialise JSON. Ensure you keep it up to date to avoid security vulnerabilities.

Logging

Use SLF4J for logging. When using Lombok, make use the @Slf4j annotation from Lombok to get a logger.

Feign

Use Feign for HTTP clients.

Testing

Use JUnit for testing.

This page was last reviewed on 25 March 2025. It needs to be reviewed again on 25 March 2026 by the page owner platops-build-notices .
This page was set to be reviewed before 25 March 2026 by the page owner platops-build-notices. This might mean the content is out of date.