Reputation: 831
I am practicing with PMD plug-in and i want to write a rule in java for checking braces for if, while and for loops. Any idea? thanks in advance.
Upvotes: 0
Views: 211
Reputation: 719436
It is just a matter or understanding the ASTs. For example, if the body of a while statement has curly braces it will be a Block. If not, it will be some other kind of statement.
In fact, the "How to write a PMD rule" page uses while statement / curly braces as its example.
Upvotes: 2