Submitted On 30-MAR-2003
ccerberus
What about this, exactly, is "poor commenting practice"? I
write javadoc much more carefully than most developers, and
using inherited documentation is not poor practice in most
cases, but instead keeps large projects' documentation in
sync. Should the javadoc be changed on every
implementation when the javadoc for the interface changes?
That doesn't seem realistic or even good. What's the point
of @inheritDoc if not to allow this sort of thing?
Submitted On 30-MAR-2003
crzyltlman
I strongly disagree with every point in the evaluation.
Given the following interfaces and classes, a variation of this
bug can be reproduced that has valid commenting practice
and is not due to user error. The files are as follows:
-- SuperInterface.java
public interface SuperInterface {
/** Some docs. */
public void someMethod();
}
-- SubInterface.java
public interface SubInterface {
/** Some other docs. */
public void someOtherMethod();
}
-- SuperClass.java
public class SuperClass implements SubInterface {
/** {@inheritDoc} */
public void someMethod() { return; }
/** {@inheritDoc} */
public void someOtherMethod() { return; }
}
-- SubClass.java
public class SubClass extends SuperClass {
/** {@inheritDoc} */
public void someMethod() { return; }
/** {@inheritDoc} */
public void someOtherMethod() { return; }
}
---- End Files ----
If you then execute "javadoc -d docs *Class.java", the task
will hang, or more accurately it will max out your CPU in what
is presumably an infinite loop until the task is forcibly halted.
I get absolutely no error message indicating that there is a
problem or where the problem might be, although the order of
file processing may cause this to differ (?). Either way, the
behavior is unacceptable and would easily be a nightmare to
track down given a large set of source files. The workaround
is also highly undesirable.
This problem or a variation of it has apparently been around
for a long time (ref:
http://developer.java.sun.com/developer/bugParade/bugs/472
0974.html ).
I believe that a re-evaluation is in order. Hopefully one as
hasty but less dismissive.
Submitted On 01-APR-2003
ccerberus
Thanks for following up on it, Doug! Your efforts on resolving
this are certainly appreciated.
Submitted On 01-APR-2003
ccerberus
One idea...Shouldn't an {@inheritDoc} of a non-existent
comment simply act like a typical non-existent comment
would in JavaDoc? That is, shouldn't it be possible to inherit
a lack of comment?
Without knowing exactly how it's implemented, it would seem
that the fix would be as simple as a (comment != null) ?
comment : "" line in the doclet.
Just an idea. Might be faster to fix it than to write up the
workaround documentation. :)
Submitted On 01-APR-2003
dkramer
Didn't mean to sound "dismissive". The bug reported was:
"javadoc hangs when inheritdoc inherits from inheritdoc that
can't inherit". ccerberus, the reference to "poor
commenting practice" was the use of
@inheritDoc to inherit from comments that cannot be inherited.
The workaround seems reasonable until we can get this bug fixed.
On the other hand, the new example of javadoc hanging when
using @inheritDoc properly is a cause of great concern, as
there is no good workaround.
I will extend the synopsis to include the case of the
infinite loop.
-Doug Kramer
Javadoc team
Submitted On 05-APR-2003
dkramer
>.Shouldn't an {@inheritDoc} of a non-existent comment simply
> act like a typical non-existent comment would in JavaDoc?
Yes. This would be an easy and important fix. The
constraint is
that Java 1.4.2 code was frozen when this bug was submitted
(1.4.2
was released April 3). The original bug had a workaround
and was
deemed not a showstopper -- that is, not important enough to
slip
the release of 1.4.2, thus the comment "can put off fix
until Tiger"
(1.5.0). Unfortunately, Tiger is many months away.
-Doug Kramer
Javadoc team
Submitted On 17-APR-2003
spainhou
another thought, is there a way to get an unofficial patch
out to people who are hitting this problem? We just
finished a massive documentation effort and now our nightly
javadocs builds hang. Going through 10's of thousand of
lines of comments and removing all {@inheritDoc} is a really
bad option.
Submitted On 17-APR-2003
spainhou
This really is a showstoper. Can we get this scheduled into
1.4.2 or 1.4.2_01 or 1.4.1_03 or something?
Submitted On 27-JUN-2003
rdifalco
Ugh, this will also happen if an abstract class implements an
interface. For example:
interface a
{
/** Blah */
void foo();
}
public abstract class b implmements a
{
/** {@iheritDoc} */
public void foo()
{
}
abstract void bar();
}
public class c extends b
{
/** {@inheritDoc} */
public void foo()
{
}
public void bar()
{
}
}
This will also hang. Ugh. Ugh. Ugh.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|