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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.