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.
Summary: | [tasklist/javadoc] Reports missing Javadoc for override method | ||
---|---|---|---|
Product: | contrib | Reporter: | Jesse Glick <jglick> |
Component: | Tasklist | Assignee: | Torbjorn Norbye <tor> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | ||
Priority: | P4 | ||
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Jesse Glick
2003-01-31 23:24:11 UTC
Agreed. I'm currently using the AutoCommenter code for the Auto Comment tool - it has the same limitation, right? (Or perhaps I'm not using it right). Is there an easy way to tell if a MemberElement is overriding something in super? Do I have to iterate up the Class hierarchy and do method lookups in each? Is there any code you know if in NetBeans which does the right thing here (for example, does the popup completion javadoc window look up the parent javadoc?) that I can leverage/copy? Duh, I guess checking with the immediate superclass should be enough. Immediate superclass (don't forget interfaces!) may not suffice: public interface A { /** some doc */ void x(); /** more doc */ void y(); } public abstract class B implements A { // inherits doc from A public final void x() {} } public class C extends B { // inherits doc from A public final void y() {} } Sorry, forgot to give references. Issue #25429 for popup Javadoc; issue #24406 for Auto Comment; issue #7115 for interface synchronization. You can tell I have a pet peeve here! :-) Fixed. It only deals with methods. A class missing a javadoc will be listed as needing a javadoc even if its parent class has a javadoc; this seems right to me (if a class has the same description as its parent, why is it a different class? Something must differentiate it, and that ought to be documented in the class javadoc.) Fix available in tasklist.javadoc/1 0.8.26. Right, of course classes and constructors and fields and static methods cannot inherit Javadoc comments - only instance methods whose signature matches that of the super signature (possibly with protected -> public). org.netbeans.modules.tasklist.javadoc/1 [1.1 200304230100] Does not appear to be fixed to me. 0. Suggestions view open. 1. Create package test in sampledir. 2. Create interface Foo in it: package test; /** X */ public interface Foo { /** does x */ void x(); } (Save it.) No Javadoc warnings here. (Ignore any copyright warning.) 3. Create empty class FooImpl, make it impl Foo: package test; /** Y */ public class FooImpl implements Foo { public void x() {} } (Save it.) Suggestions window incorrectly says: "x: Javadoc comment is missing." Code was only looking for class name, not FQN, when using ClassElement.forName. Also I noticed that adding "extends Object" affected whether a docless toString() would be reported. Fixed - everything now assumed to implicitly extend Object. Checking in tasklist/javadoc/manifest.mf; /cvs/tasklist/javadoc/manifest.mf,v <-- manifest.mf new revision: 1.18; previous revision: 1.17 done Checking in tasklist/javadoc/module-updates.txt; /cvs/tasklist/javadoc/module-updates.txt,v <-- module-updates.txt new revision: 1.6; previous revision: 1.5 done Checking in tasklist/javadoc/src/org/netbeans/modules/tasklist/javadoc/DocSuggester.java; /cvs/tasklist/javadoc/src/org/netbeans/modules/tasklist/javadoc/DocSuggester.java,v <-- DocSuggester.java new revision: 1.14; previous revision: 1.13 done BTW if you extend/implement a class for which you have only bytecode, and no mounted source, it will complain although the original method may have in fact had Javadoc. You thus need to mount sources, incl. e.g. the JRE. I've merged your fix to the dev35 branch, the tasklist-3.5 compatible branch which is feature compatible with the tasklist 4.0 version (trunk). |