Make Java modifier order customizable (java:S1124)

The java:S1124 rule checks for adherence to the modifier order recommended by the Java Language Specification.

We use our own modifier order convention (for example, annotations are allowed in front of the type because nullability annotations like @Nullable / @NonNull can be considered part of the type). Is there a way to customize rule S1124, or can I make my own rule based on it with different sort order?


That Code Smell rule is specific to the Java Language Specification and there is no way to customize it.

It is possible to create your own coding rules for Java, but I would caution against building and maintaining a plugin unless the rule is critical to your development practice. Disabling the rule in your Java Quality Profile is the recommended route if this is creating a lot of noise for your teams.