This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 153352 - false warning for missing @throws tag, when using {@inheritDoc}
Summary: false warning for missing @throws tag, when using {@inheritDoc}
Status: RESOLVED DUPLICATE of bug 242857
Alias: None
Product: java
Classification: Unclassified
Component: Javadoc (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-18 01:47 UTC by jn
Modified: 2014-07-30 11:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jn 2008-11-18 01:47:08 UTC
the {@inheritDoc} javadoc tag is supposed to inherit the parent method's javadoc for description, parameters, return
value, thrown exceptions, etc.  The NetBeans warnings for missing javadoc elements (missing @param, @returns, etc.)
seems to respect the {@inheritDoc} tag for all cases except for the @throws tag.

For example, consider the following code:

In the parent class:

  /**
   * Gets a key spec for all keys which contain samples with the given value,
   * for the given band.
   * @param <E> the band data type
   * @param band the band
   * @param value the sample value to return keys for; may be null
   * @return a key spec
   * @throws DataAccessException if a data access exception occurred
   */
  public <E> KeySpec getKeySpec(Band<E> band, E value) throws DataAccessException;

In the child class:

  /**
   * {@inheritDoc}
   */
  @Override
  public <E> KeySpec getKeySpec(Band<E> band, E value)
    throws DataAccessException {

The child class has exactly one warning:  "Missing @throws tag for DataAccessException".  This is a false warning since
the @throws tag is inherited.  As a result of this problem, I have hundreds of false warnings throughout my code, making
the warnings virtually useless.
Comment 1 Peter Pis 2008-11-18 08:50:52 UTC
Reassigning to javadoc.
Comment 2 Jiri Prox 2008-11-18 11:27:07 UTC
Which build of 6.5 do you use? I cannot reproduce it in 6.5-fcs
Comment 3 Jan Pokorsky 2008-11-18 12:08:47 UTC
BTW,  /** {@inheritDoc} */ stands for explicitly inherited main description not for tags. They are inherited
automatically if you omit them. You can omit the whole javadoc declaration in case you want to inherit everything.

Anyway what you reported is a reproducible bug. Thanks for the report.

jiriprox: In order to reproduce this it is necessary to place the exception declaration to another package.
Comment 4 Jan Pokorsky 2008-11-19 09:48:16 UTC
fixed http://hg.netbeans.org/main/rev/ef6e18b0c437
Comment 5 Quality Engineering 2008-11-19 16:43:43 UTC
Integrated into 'main-golden', will be available in build *200811191401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/ef6e18b0c437
User: Jan Pokorsky <jpokorsky@netbeans.org>
Log: #153352: load context for inherited javadoc to resolve java elements properly
Comment 6 kidnapper 2014-07-30 11:44:50 UTC
I'm still able to reproduce this problem with NetBeans IDE 8.0 (Build 201403101706) on OSX.
Comment 7 Jiri Prox 2014-07-30 11:58:43 UTC

*** This bug has been marked as a duplicate of bug 242857 ***