리팩토링 검출 메시지
"Reorder the modifiers to comply with the Java Language Specification."
Java class, method 선언 시 표현 순서
2. 접근자 (public/protected/private)
잘못된 예 :
참고 및 발췌
8.1. Class Declarations
The rules in this section apply to all class declarations, including enum declarations. However, special rules apply to enum declarations with regard to class modifiers, inner classes, and superclasses; these rules are stated in §8.9.
The access modifiers
private pertain only to member classes within a directly enclosing class declaration (§8.5).
static pertains only to member classes (§8.5.1), not to top level or local or anonymous classes.
If two or more (distinct) class modifiers appear in a class declaration, then it is customary, though not required, that they appear in the order consistent with that shown above in the production for ClassModifier.
3.1.3 Class and Interface Declarations
The following table describes the parts of a class or interface declaration, in the order that they should appear. See "Java Source File Example" on page 19 for an example that includes comments.
Part of Class/Interface Declaration
See "Documentation Comments" on page 9 for information on what should be in this comment.
These methods should be grouped by functionality rather than by scope or accessibility. For example, a private class method can be in between two public instance methods. The goal is to make reading and understanding the code easier.
- Spring Boot
- ag grid