8

When I use {@inheritDoc} in Eclipse, the superclass' javadoc comments are not appearing in my class' javadoc.

I have the following piece of code:

import javax.swing.table.AbstractTableModel;

public class TestTableModel extends AbstractTableModel {

  /**
   * {@inheritDoc}
   */
  @Override
  public int getRowCount() {
    return 1;
  }

  @Override
  public Object getValueAt(int rowIndex, int columnIndex) {
    return null;
  }

  @Override
  public int getColumnCount() {
    return 0;
  }
}

I make sure that rt.jar library (which contains javax.swing.table.AbstractTableModel) has source code and javadoc locations set, and indeed when I hover over getRowCount() I get the AbstractTableModel javadoc in a tool tip. When I generate the javadoc from Eclipse, I make sure that in the "referenced archives and projects" section that rt.jar is selected. But the inherit doc does not work.

Michi
  • 681
  • 1
  • 7
  • 25
tekumara
  • 8,357
  • 10
  • 57
  • 69

1 Answers1

3

It looks like the superclass's source (in this case AbstractTableModel.java) must be on the sourcepath of javadoc. This is done in Eclipse by creating a project for AbstractTableModel and selecting it in the "Select types for which Javadoc will be generated" selection during javadoc generation.

tekumara
  • 8,357
  • 10
  • 57
  • 69
  • I don't understand exactly how this should work. In my case, it seems that all the classes that extend from Android.jar have this problem. What should i do now? Create a extra project for this jar file?? – RoflcoptrException Aug 09 '10 at 15:40