Sonar建议Reorder the modifiers to comply with the Java Language Specification重新排序修饰符以符合Java语言规范
Posted 秋9
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Sonar建议Reorder the modifiers to comply with the Java Language Specification重新排序修饰符以符合Java语言规范相关的知识,希望对你有一定的参考价值。
Sonar建议Reorder the modifiers to comply with the Java Language Specification重新排序修饰符以符合Java语言规范。
代码举例:
规范说明:
The Java Language Specification recommends listing modifiers in the following order:
1. Annotations
2. public
3. protected
4. private
5. abstract
6. static
7. final
8. transient
9. volatile
10. synchronized
11. native
12. strictfp
Not following this convention has no technical impact, but will reduce the code's readability because most developers are used to the standard order.
解决方法:
public final static String ROLE_ID = "1";
修改为:
public static final String ROLE_ID = "1";
以上是关于Sonar建议Reorder the modifiers to comply with the Java Language Specification重新排序修饰符以符合Java语言规范的主要内容,如果未能解决你的问题,请参考以下文章
Reorder array to construct the minimum number
leetcode1466. Reorder Routes to Make All Paths Lead to the City Zero