Modifiers are written in another order than the one the language specification recommends

tx0/java:modifier-orderstrictwarningstyle

What it finds

The Java Language Specification recommends one order for modifiers: access first (public, protected, private), then abstract or default, static, final or sealed and non-sealed, transient, volatile, synchronized, native and strictfp. Code that keeps to it reads the same everywhere.

Annotations may stand anywhere among the modifiers, since annotations of the type often stand right before it. The fix sorts the keywords when nothing but spaces stands between them.

From the rule's source, modifier_order.rs.

Example from the rule's tests
class Config {  static public final int LIMIT = 3;tx0 reports: static public final is usually written public static final  public static final int MAX = 4;  final static String NAME = "x";tx0 reports: final static is usually written static final  public @Deprecated static int legacy;  synchronized public void run() {}tx0 reports: synchronized public is usually written public synchronized}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/java:modifier-order" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/java:modifier-order] reason="..."

tx0 explain tx0/java:modifier-order shows the same in the terminal. Found a false positive? Report it.