Does “/* (non-javadoc)” have a well-understood meaning?

谁说我不能喝 提交于 2019-11-27 06:34:44

问题


Does /* (non-javadoc) have a meaning, beyond pointing out to the reader of source code that a comment block is intentionally not a Javadoc comment? Lately I've seen a lot of code that looks like this:

/*
 * (non-javadoc)
 *
 * This method converts widgets to gizmos
 */
public Foo bar() {
   ...

Is this an established convention of some kind? If so, what does it mean (beyond the obvious literal meaning) and when is it used?


回答1:


According to the info I could find, this was to fix a bug in older versions of the JavaDoc tool (or more likely older version of Eclipse's processing of JavaDoc comments) that would not display the correct documentation for a method that overrides the method of a parent class.

As noted by Konstantin, Eclipse's override template includes this text.




回答2:


It doesn't have an established meaning besides being a comment. The formatting is result of common Eclipse code formatting templates, which explains its commonality.



来源:https://stackoverflow.com/questions/4597329/does-non-javadoc-have-a-well-understood-meaning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!