0

Could you please help me to configure Checkstyle to warn me if the javadoc comment is empty?

Checkstyle dest not warn me in the following case (javadoc comment is totally missing):

/**
 *
 */
public enum MyType{ EQUALS }

I have checked the documentation here, but I could not see anything related this issue.

4
  • Well, have you configured Checkstyle to check for this? Which check are you expecting to trigger? Commented Oct 31, 2017 at 21:24
  • I have checked the documentation but I could not see anything related to this issue. I have no idea which property I need to set in the config file. Commented Oct 31, 2017 at 21:32
  • It is not missing, it is empty. Commented Nov 1, 2017 at 0:11
  • You are right, I have updated my question. Any idea how to check empty javadoc comment? Commented Nov 1, 2017 at 0:46

1 Answer 1

0

To do this, you can use the Style Javadoc Checkstyle module in the Javadoc Comments section. From the Checkstyle documentation on Style Javadoc:

Validates Javadoc comments to help ensure they are well formed. The following checks are performed:

  • Ensures the first sentence ends with proper punctuation (That is a period, question mark, or exclamation mark, by default). Javadoc automatically places the first sentence in the method summary table and index. Without proper punctuation the Javadoc may be malformed. All items eligible for the {@inheritDoc} tag are exempt from this requirement.
  • Check text for Javadoc statements that do not have any description. This includes both completely empty Javadoc, and Javadoc with only tags such as @param and @return.

Make sure to check the checkEmptyJavadoc checkbox:

Style Javadoc

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.