28

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?

Pops
  • 30,199
  • 37
  • 136
  • 151

2 Answers2

19

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.

Powerlord
  • 87,612
  • 17
  • 125
  • 175
  • 1
    FYI: http://dev.eclipse.org/newslists/news.eclipse.platform/msg34412.html is now a dead link. – Max Nanasy Aug 13 '14 at 19:00
  • 4
    @MaxNanasy Apparently Eclipse changed forum systems a while back and they didn't redirect individual posts. New location is https://www.eclipse.org/forums/index.php/m/278495/ – Powerlord Aug 13 '14 at 19:15
16

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.

Konstantin Komissarchik
  • 28,879
  • 6
  • 61
  • 61