JDK-4266005 : Need isDefault() to identify default constructors
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1999-08-26
  • Updated: 2002-06-27
  • Resolved: 2001-03-06
Related Reports
Duplicate :  
Description
Need isDefault() to identify default constructors.
Allows comment-checking doclets to distinguish 
between explicit constructors missing a comment 
and auto-generated constructors missing from the 
source code.

Our programming guidelines say that default 
constructors should be avoided.  This would 
allow us to test for their presence and emit
a warning when Javadoc is run.


Comments
PUBLIC COMMENTS .
10-06-2004

EVALUATION Looks like a possible dupe to 4304047: MemberDoc.isSynthetic() returns false for compiler-gen'd constructor doug.kramer@Eng 2001-02-27 Personally, I think your programming guidelines are exactly backwards. In general its a poor idea to let the compiler generate default constructors for you. You're better off making them yourself. If you don't want one, make it private and have the implementation throw an exception. In addition, I think you will find that many of the source-to-source translation tools will insert the default constructor if you don't write one. If you make your programming guidelines more reasonable - require an explicit default constructor for all classes - then javadoc helps you identify those cases where it is missing by the absence of documentation on the constructor. Anyway, that's just my opinion. Back to the javadoc question. In the context of 4208989, I'm adding support for getting the source position of the MemberDoc. That will tell you if the thing even has a source position. If it doesn't, then it wasn't written by the user. So I expect your issue will be resolved with 4208989. neal.gafter@Eng 2001-03-06
06-03-2001