- Ah ha! We see that the curly braces add a couple more AST elements - a Block and a BlockStatement. So all we have
- to do is write a rule to detect a WhileStatement that has a Statement that's not followed by a Block, and we've got a rule violation.
+ Ah ha! We see that the curly braces add a couple more AST elements - a Block and a BlockStatement. So all we have
+ to do is write a rule to detect a WhileStatement that has a Statement that's not followed by a Block, and we've got a rule violation.
@@ -143,7 +143,7 @@ public class WhileLoopsMustUseBracesRule extends AbstractRule {
That was easy. PMD works by creating the AST and then traverses it recursively so a rule can get a callback
- for any type it's interested in. So let's make sure our rule gets called whenever the AST traversal finds a WhileStatement:
+ for any type it's interested in. So let's make sure our rule gets called whenever the AST traversal finds a WhileStatement: