Eclipse、Checkstyle 和 java 文档注释中的空格
我已经安装了 Eclipse 的 Checkstyle 插件。当我现在为某个方法编写文档注释时,我的实际注释和参数列表之间有一个空行,如下所示:
/**
* A comment.
*
* @param param A param.
*/
void aMethod(String param) {
// some code
}
Checkstyle 现在抱怨有尾随空格。而且,虽然我没有在那个位置放置空格,但还是有一个额外的空间...
..../**
.....*.A.comment\.
.....*.
.....*[email protected]\.
.....*/
在我看来,Eclipse 正在将这个额外的空间添加到文档块中。我如何关闭它或配置 checkstyle 插件以忽略文档块中的这个额外空间?
I have installed the Checkstyle plugin for Eclipse. When i habe writen now a doc comment for a 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\.
.....*.
.....*[email protected]\.
.....*/
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您已经尝试过进入
Window ->首选项-> Java->代码风格->代码模板 ->注释
并确保构造函数没有尾随空格等。我使用 Eclipse 插件 AnyEdit Tools 取得了很大的成功。有一个选项可以删除尾随空白,另一个选项可以将制表符转换为空格,这两个选项都会使 Checkstyle 更快乐。
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.