Search code examples
eclipsejavadoc

Why I cannot see the dash mark between @param name and description?


I am using Ecliplse and when hovering my mouse over a method name e.g. Integer.valueOf(0);

the Javadoc gives me parameters info:

Parameters:
      i - an int value.

However, if I write my own method (and doc comment):

/**
* @param i an {@code int} value.
*/
public static void bar(int i) {
}

I would have the following when placing my mouse over my method name

Parameters:

      i an int value.

So, why the appeared "javadocs" (at mouse hover) are rendered with different format, even if I write exactly the same comment as found in the source file of java.lang.Integer?

I kind of dislike the sencond format with bold param names and would like to stick to the first format. Any way I can configure Eclipse to achieve that? Please could someone help me to demystify...Many thanks


Solution

  • The difference stems from the individual templates (doclets) you can use when generating Javadoc. If Eclipse generates Javadoc (on-the-fly) from comments in code it obviously uses a template that omits the '-'. When Oracle generated the official API documentation for the JRE it used a template that generates a '-'.

    So, why do you see a '-' in Eclipse when you browse JRE code but not in your own code? It seems like you configured the JRE in Eclipse (Window > Preferences > Java > Installed JREs) such that the Javadoc is available in the file system but the JRE source is not. Hence, Eclipse will show you the official Oracle version rather then generating it on-the-fly from source.