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 170856 - "Javadoc missing" for an overridden method
Summary: "Javadoc missing" for an overridden method
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Javadoc (show other bugs)
Version: 8.0.2
Hardware: All All
: P4 blocker with 2 votes (vote)
Assignee: Jan Becicka
URL:
Keywords:
: 178287 212202 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-25 09:32 UTC by Tim Lebedkov
Modified: 2015-09-09 14:34 UTC (History)
4 users (show)

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 Tim Lebedkov 2009-08-25 09:32:21 UTC
For the following method in my servlet I get a suggestion "Create missing JavaDoc"

@Override
    public void init() throws ServletException {
Comment 1 Peter Pis 2009-08-26 15:15:52 UTC
Reassigning to java.
Comment 2 Max Sauer 2009-09-04 13:36:02 UTC
I don't understand what is wrong, please clarify, thanks.
Comment 3 Tim Lebedkov 2009-09-13 10:17:52 UTC
it is not necessary to specify JavaDoc in an overridden methods. The JavaDoc from the parent class is automatically used.
Comment 4 Peter Pis 2009-09-18 14:41:29 UTC
This is just a hint and I would expect as it works now. 

The ability of a subclass to override a method allows a class to inherit from a superclass whose behavior is "close
enough" and then to modify behavior as needed.

Modified behavior calls for modified javadoc. 

Maxi, what is your opinion?
Comment 5 Jan Pokorsky 2009-11-02 15:35:54 UTC
The present implementation checks sources whether the overridden method declares javadoc in class inheritance hierarchy.
If none exists the hint occurs. But in case of the Servlet API library there are no attached sources for Servlet thus it
always ends up with the missing javadoc hint.

Checking for @Override or missing source file of the overridden method seems to be reasonable in this case. I will
investigate not to hurt the performance.
Comment 6 Jan Pokorsky 2009-11-02 15:37:42 UTC
reassigning to javadoc
Comment 7 Jan Lahoda 2010-10-11 12:48:41 UTC
*** Bug 178287 has been marked as a duplicate of this bug. ***
Comment 8 Ralph Ruijs 2012-06-13 13:53:31 UTC
*** Bug 212202 has been marked as a duplicate of this bug. ***
Comment 9 bbeswick 2014-09-13 16:00:49 UTC
This is still open as-of 8.0.1.

Observation: while some organizations may want this to work as-is, others (like ours) find this behavior a nuisance; we want reminders of missing javadoc but our coding standards say that they are generally not needed for overrides unless there is a reason on a case-by-case. Because we generally like to see all of the yellow suggestions resolved this is an outlier for us.

Suggestion: copy this to a second hint and have the new one ignore methods that are overridden.  This should satisfy both camps of users. (Although there may be more people in the second camp.)
Comment 10 Eusebius 2015-09-09 14:34:55 UTC
Six years later, the situation is still the same in 8.0.2.

Please consider adding an option to the "Create Javadoc" hint, allowing to ignore methods tagged with @Override.