Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

code example in a javadoc comment

Tags:

javadoc

I have multiple programmers contributing examples for javadocs and some examples contain comments formatted with

/*
 *
 */

When I put these examples into a javadoc comment, the comment close in the example closes the javadoc comment.

/**
 *
 * /*
 *  *
 *  */  <-- right here
 *
 */

Is there a proper way to handle this without telling everyone that they cannot write comments in this format?

like image 541
Roger Avatar asked Dec 14 '22 03:12

Roger


1 Answers

Javadoc comments use html, so encode the / as an entity: &#47;

/**
 *
 * /*
 *  *
 *  *&#47;  <-- right here
 *
 */

Telling everyone not to put that kind of comment in their code examples might be easier.

like image 147
Stephen Denne Avatar answered Mar 16 '23 03:03

Stephen Denne