Community
Participate
Working Groups
I set "Problems in Javadoc tags" to warning and checked "Missing javadoc tags in public types, methods, and fields". /** {@inheritDoc} */ public synchronized boolean equals(Object obj) { return false; } The method above flags annotation warnings which it should not. I want to have a "javadoc" -- so that tools can flag "missing javadoc" -- but I do not want to copy the actual doc again.
Is the construct "/** {@inheritDoc} */" a standard javadoc feature ?
Since 1.4, yes: http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/whatsnew-1.4.html#{@inheritDoc} Actually it's quite sophisticated -- it will only copy the stuff you have not "overwritten".
hmm there seems to be a bug in bugzilla itself =D the trailing } should have been underlined also :/
Unsure this would be for 3.0.
*** Bug 47397 has been marked as a duplicate of this bug. ***
Note that due to bug 47339 fix, you have now an equivalent of this tag using @see tag: see duplicate bug 47387.
@see <fully-javadoc-qualified methodname> is a coding/style convention {@inheritDoc} is a Javadoc tag
*** Bug 49618 has been marked as a duplicate of this bug. ***
Fixed. Due to bug 48385 fix, compiler is able to detect this inline tag in javadoc comment. When it happens, it flags Javadoc which does not report missing tags during resolve process. Simply add condition (overriding && this.inherited) while computing reportMissing flag in jdt.internal.compiler.ast.Javadoc.resolve(MethodScope). Note that this mean that tag is inefficient if it's written in a javadoc comment of a method which neither overrides superclass nor implements interfaces methods... Test cases added in jdt.core.tests.compiler.regression.JavadocTestMixed.
Verified for 3.0M7
I am seeing this bug in eclipse M8
Verified with build I200404131334 and M8 build: this bug is really fixed. My test case is: public class TestBug45782 implements Comparable { /** * {@inheritDoc} */ public boolean equals(Object obj) { return super.equals(obj); } /** * {@inheritDoc} */ public int compareTo(Object o) { return 0; } /** * {@inheritDoc} */ public int foo(String str) { return 0; } } My project options are: - Process Javadoc comments: ON - Malformed Javadoc comments: Warning + Only consider member as visible as: Private + Report errors in tags: ON - Missing Javadoc tags: Warning + Only consider member as visible as: Private + Check overriding and implementing methods: ON As expected: 1) I have no warning on equals(Object) and compareTo(Object) methods as they respectively override and implement methods from hierarchy 2) I have warnings on method foo(String) return type and parameter as this method neither overrides nor implements method from hierarchy. Please provide a test case which shows your assumption, thx
Created attachment 9584 [details] screenshot of wrong erros being reported it would take too long to describe so I took a couple of screen shots
Created attachment 9585 [details] the settings used
Just put the code of the class in comment would have been enough and not take so long... Warnings are: 1) on a constructor on which overriding has no sense in Java 2) on compareTo(Object) method which neither override nor implements method of hierarchy as your class A inherits from Object and does not implements any interface... So there's no problem, compiler warns you accurately...
To get rid of the bottom warning just add "implements Comparable" to your class declaration.