Make comment clearer

This commit is contained in:
Gwilym Kuiper
2020-04-03 15:17:01 +01:00
parent 4aae0e2ebf
commit 1331eec208

View File

@ -58,9 +58,9 @@ public class FieldDeclarationsShouldBeAtStartRule extends AbstractApexRule {
}
private List<ApexNode<?>> getMethodNodes(ASTUserClass node) {
// The method <clinit> represents static initializer blocks, of which there can be many. Given that the
// <clinit> method doesn't contain location information, only the containing ASTBlockStatements, we fetch
// them for that method only.
// The method <clinit> represents static initializer blocks, of which there can be many. The
// <clinit> method doesn't contain location information, however the containing ASTBlockStatements do,
// so we fetch them for that method only.
return node.findChildrenOfType(ASTMethod.class).stream()
.flatMap(method -> method.getImage().equals("<clinit>")
? method.findChildrenOfType(ASTBlockStatement.class).stream() : Stream.of(method))