Skip to content

Add Spring Nullability Checkstyle Rule #465

Description

@rwinch

It would be nice if there was a rule that could be applied to checkstyle that would ensure that the code follows Spring's best practices for nullability.

  • Only use org.jspecify annotations
  • The org.jspecify annotations are immediately before the type (after modifiers like final, private, public) and on the same line as the type

This would be used in conjunction with RequireExplicitNullMarking (e.g. Enable RequireExplicitNullMarking checker #23) to ensure consistency across the Spring portfolio.

NOTE: I think that ideally this could be used in isolation to apply the nullability checkstyle rules so that teams (e.g. Spring Framework) not using other parts of spring-javaformat can still benefit.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions