• Post Reply Bookmark Topic Watch Topic
  • New Topic

Javadoc issue  RSS feed

 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An abstract method is implicitly public.
If you don't put the public modifier on an abstract method declaration (which you shouldn't by convention - as per JLS), javadoc will not consider it public, and therefore, will not put any conventionally (without redundant modifiers) declared abstract methods in the output (by default).
Putting a @link to a conventionally declared abstract method fails since it doesn't exist in the javadoc output by default.
The Java compiler recognises the implicit modifiers on abstract/interface methods (as it should), but javadoc doesn't, and the implicit 'public' modifier is relevant for javadoc to behave appropriately. Thus, I must break the suggested convention in the JLS and provide and implicit public modifier for my abstract methods so that I can javadoc them appropriately.
Is this a known issue ? Is this an issue at all ?
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the issue of being pedantic , why is a code "convention" in the Java Language Specification, and not in the Java Code Conventions as expected ?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tony Morris:
An abstract method is implicitly public.

Your starting premise is wrong. Abstract methods can be public, package, or protected (they can't be private.) You may be thinking of the methods in interfaces, which are always implicitly public and always implicitly abstract.
But if you have a package-level abstract method, Javadoc doesn't generate docs because it doesn't document package-protected methods by default.
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
doh!
I take it all back. Thanks for that.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!