I'm trying to insert a {@code } annotation in a Javadoc comment using Netbeans 8.0 and it's not working properly.
I've seen other questions on this from before (i.e., How can you escape the @ character in javadoc?) but the html escape @
and {@literal @}
both don't seem to work.
My comment looks like this (using both methods for sake of the example):
/**
* blah blah blah
* <p>
* For example:
* <pre>
* {@code
* {@literal @}begin_specification
* ...
* @end_specification
* }
* </pre>
*/
I can hit Run -> Generate Javadoc
and everything runs fine with no errors but I see this when I look at the resulting output in a browser:
{@literal @}begin_specification
...
@end_specification
Which isn't the desired result... Any suggestions/ideas?
I'm fairly new to Java but have used things like Doxygen in C/C++ in the past. Am I doing something wrong here? I'm using NetBeans 8.0 (Build 201403101706) with Java 1.8.0_05 x64.
One way is to use:
<pre> <code>
{@literal @}
</code> </pre>
instead of an {@code ...}
block. See this example around line 86.
This is a known bug. The link to the corresponding bug is:
https://bugs.openjdk.java.net/browse/JDK-8130754
As of 2016-10-07 there is no scheduled version for a fix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With