“First sentence should end with a period.”

三世轮回 提交于 2019-12-01 15:13:07
Jimmy Zhang

The first sentence should end with a dot.

/**
 *An abstract class that represents an algorithm.
 *
 * @author zhangtj
 *
 * @version 1.0
*/

Would pass.

Just tested on my machine and actually can't reproduce: I don't get a warning with a dot at the end of the sentence. But once I remove it (and run checkstyle again), the rule is triggered correctly and I get the warning on the /** line.

The blank line after the comment doesn't make a difference.

Double-check that the dot is really a dot and not some other character that "looks" like a dot. And double-check that you really re-run checkstyle after you've changed the file. It will not perform checks automagically.


Maybe someone played with the checkstyle settings. Actually there are two properties that control this rule: checkFirstSentence which is either true or false and endOfSentenceFormat which is a regular expression and should match the period. But if the ruleset has redefined that property... ;)

Further Reading

This just annoyed me. To remove this add:

...

<module name="JavadocStyle">
   <property name="checkFirstSentence" value="false"/>
</module>

...

And also, for me I TOTALLY removed the SummaryJavadoc module.

in your checkstyle.xml to switch this check off.

See: http://checkstyle.sourceforge.net/config_javadoc.html#JavadocStyle & http://checkstyle.sourceforge.net/config_javadoc.html#SummaryJavadoc

aarathi

Thin can be caused by space after end of the comment or '.'

I use 2 lines to avoid this warning. For example:

/**
 * Let's call this as the first sentence,
 * here the second one.
*/
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!