开发者

Eclipse, Checkstyle and spaces in a java doc comment

I have installed the Checkstyle plugin for Eclipse. When i habe writen now a doc comment for 开发者_StackOverflowa method and there is an empty line line between my acutal comment and the parameter list, like this:

/**
 * A comment.
 *
 * @param param A param.
 */
void aMethod(String param) {
    // some code
}

Checkstyle now complaints that there is an trailing space. And, although i didn't put a space at that postition there is an extra space...

..../**
.....*.A.comment\.
.....*.
.....*.@param.param.A.param\.
.....*/

It looks to me that Eclipse is adding this extra space to the docblock. How can i turn that off or configure the checkstyle plugin to ignore this extra space in a docblock?


I am supposing that you have already tried going to Window -> Preferences -> Java -> Code Style -> Code Templates -> Comments and ensuring that there is no trailing space for Constructors and so on.

I have had a lot of success with the Eclipse Plugin AnyEdit Tools. There is an option to removing trailing whitespace and another to Convert tabs to space, both of which will make Checkstyle much happier.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜