-
Bug
-
Resolution: Unresolved
-
P4
-
17.0.2
-
generic
-
generic
Take a test class like the following one:
/**
* Test.
*/
public class Test {
/**
* <code>M . </code>.
*/
public void m() {}
/**
* <code>Y</code>.
*/
public void n() {}
}
Now run
javadoc Test.java
The resulting Test.html document is ill formatted starting from method m(). The subsequent methods n() (and all others, if available) will be badly formatted, the browser cannot recover from this error. See also attached screenshot
The markup in Test.html looks like this:
<div class="block"><code>M .</div>
As can be seen, the closing </code> tag is lost. It took me a while to reproduce the exact problem. It's related to there being a whitespace between the period "." and the closing tag. E.g. the following example removes the whitespace:
/**
* Test.
*/
public class Test {
/**
* <code>M .</code>.
*/
public void m() {}
/**
* <code>Y</code>.
*/
public void n() {}
}
And now, the generated markup is as expected:
<div class="block"><code>M .</code>.</div>
The real world Javadoc contained <code>BEGIN .. END</code> using the periods as ellipsis.
I guess there are two problems:
1. The resulting markup is ill-formed
2. There is no warning about the Javadoc format being wrong, because the first period marks the end of the Javadoc method title.
/**
* Test.
*/
public class Test {
/**
* <code>M . </code>.
*/
public void m() {}
/**
* <code>Y</code>.
*/
public void n() {}
}
Now run
javadoc Test.java
The resulting Test.html document is ill formatted starting from method m(). The subsequent methods n() (and all others, if available) will be badly formatted, the browser cannot recover from this error. See also attached screenshot
The markup in Test.html looks like this:
<div class="block"><code>M .</div>
As can be seen, the closing </code> tag is lost. It took me a while to reproduce the exact problem. It's related to there being a whitespace between the period "." and the closing tag. E.g. the following example removes the whitespace:
/**
* Test.
*/
public class Test {
/**
* <code>M .</code>.
*/
public void m() {}
/**
* <code>Y</code>.
*/
public void n() {}
}
And now, the generated markup is as expected:
<div class="block"><code>M .</code>.</div>
The real world Javadoc contained <code>BEGIN .. END</code> using the periods as ellipsis.
I guess there are two problems:
1. The resulting markup is ill-formed
2. There is no warning about the Javadoc format being wrong, because the first period marks the end of the Javadoc method title.