Java modifier sort order
已回答
An IntelliJ Java inspection considers the following modifiers as missorted:
private static abstract
It wants to reorder them as:
private abstract static
I much prefer the order that I used. Is there any way to change the preferred modifier order?
请先登录再写评论。
Hello,
The "Missorted modifiers" inspection follows the order as specified in the Java Language Specification. In chapter 8 paragraph 1.1 the order of modifiers for classes is listed as
public protected private abstract static final strictfp. The "private abstract static" order is also confirmed by the OpenJDK guidelines.You can only disable this inspection, but not to change the predefined order.