Javadoc: How to fix: "bad HTML entity" error
Asked Answered
W

2

7

I am getting this error:

[ERROR] /Users/daniel/ideaProjects/lbjava/lbjava/src/main/java/edu/illinois/cs/cogcomp/lbjava/learn/NaiveBayes.java:638: error: bad HTML entity
[ERROR] * P(e's label && e)
[ERROR] ^
[ERROR] /Users/daniel/ideaProjects/lbjava/lbjava/src/main/java/edu/illinois/cs/cogcomp/lbjava/learn/NaiveBayes.java:638: error: bad HTML entity
[ERROR] * P(e's label && e)
[ERROR] ^

Here is the full comment:

    /**
     * Takes the dot product of this vector with the given vector, using the specified default
     * weight when encountering a feature that is not yet present in this vector. Here, weights
     * are taken as <i>log(feature count / prior count)</i>. The output of this method is
     * related to the empirical probability of the example <i>e</i> as follows: <br>
     * <br>
     *
     * <i>exp(dot(e)) / (sum of all labels' prior counts)) =</i><br>
     * P(e's label && e)
     *
     * @param exampleFeatures The example's array of feature indices.
     * @param exampleValues The example's array of feature values.
     * @param defaultW The default weight.
     * @return The computed dot product.
     **/

Any ideas what might be causing this error? How can I fix it?

Note: I don't want to disable doclint; instead I want to resolve the issue with the comment.

Wheatear answered 29/6, 2016 at 23:43 Comment(0)
K
19

You need to escape some symbols

&& should be entered as &amp;&amp; if you want to render as &&

Kaseykasha answered 29/6, 2016 at 23:47 Comment(0)
G
1

Many of the symbols you use in programming are not valid HTML. As JavaDoc uses HTML one must substitute these with the examples below. This will stop JavaDoc complaining and is the proper way to do it.

&ge;      is >=
&le;      is <=
&gt;      is >
&lt;      is <
&ne;      is !=
&equals;  is =
&amp;     is &
&Vert;    is ||  (double pipe).
&vert;    is |   (Single pipe).
Givens answered 2/3, 2023 at 7:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.