JDK-8176131 : Simplify new Taglet API
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2017-03-03
  • Updated: 2017-05-17
  • Resolved: 2017-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 9
10Fixed 9 b161Fixed
Related Reports
Relates :  
Relates :  
Description
The new Taglet API added as part of the new Doclet API has two similar .toString methods, one takes a DocTree and the other takes a List<DocTree>.  The documentation does not explain when each might be called (which is a bug in itself) but the fact is, we don't need both: we can eliminate the one that takes a single DocTree and always/only use the one taking a List<DocTree>.

In addition, we should clarify the use of this method.

The API is currently:


    /**
     * Given the {@link DocTree DocTree} representation of this custom
     * tag, return its string representation, which is output
     * to the generated page.
     * @param tag the <code>Tag</code> representation of this custom tag.
     * @return the string representation of this <code>Tag</code>.
     */
    String toString(DocTree tag);

    /**
     * Given a List of {@link DocTree DocTrees} representing this custom
     * tag, return its string representation, which is output
     * to the generated page.  This method should
     * return null if this taglet represents an inline or body tag.
     * @param tags the list of <code>DocTree</code>s representing this custom tag.
     * @return the string representation of this <code>Tag</code>.
     */
    String toString(List<? extends DocTree> tags);

Comments
This is new-in-9 API -- we should get it right, before the API is fixed.
03-03-2017