Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javadoc closing tags [duplicate]

Tags:

java

javadoc

Reading Oracle's Javadoc Documentation, I noticed that the author did not close the <p> tag.

/**
 * The method used for creating the tree. Any structural 
 * modifications to the display of the Jtree should be done 
 * by overriding this method.
 * <p>
 * This method adds an anonymous TreeSelectionListener to 
 * the returned JTree.  Upon receiving TreeSelectionEvents, 
 * this listener calls refresh with the selected node as a 
 * parameter. 
 */
public JTree makeTree(AreaInfo ai){
}

The documentation states:

If you have more than one paragraph in the doc comment, separate the paragraphs with a <p> paragraph tag, as shown.

In Eclipse, the Javadoc is formatted correctly, but just because it works, does it mean it's "correct"?

like image 987
budi Avatar asked Nov 18 '15 18:11

budi


1 Answers

Yes, it's correct. Quote from the specifications:

Some HTML element types allow authors to omit end tags (e.g., the P and LI element types)

like image 156
JB Nizet Avatar answered Oct 15 '22 05:10

JB Nizet