Trying to escape the "@" character in the {@code} block in javadoc comment with Netbeans 8.0

I am trying to insert annotation {@code} in Javadoc comments using Netbeans 8.0 and it is not working properly.

I saw other questions about this before (i.e. how can you escape the @ character in javadoc? ), But html escape @ and {@literal @} both do not work.

My comment looks like this (using both methods as an example):

 /** * blah blah blah * <p> * For example: * <pre> * {@code * {@literal @}begin_specification * ... * &#64;end_specification * } * </pre> */ 

I can click Run -> Generate Javadoc , and everything works fine, without errors, but I see this when I look at the result in the browser:

 {@literal @}begin_specification ... &#64;end_specification 

What is not the desired result ... Any suggestions / ideas?

I am new to Java, but used things like Doxygen in C / C ++ before. Am I something wrong here? I am using NetBeans 8.0 (Build 201403101706) with Java 1.8.0_05 x64.

+8
java java-8 escaping netbeans javadoc
source share
4 answers

One of the methods:

 <pre> <code> {@literal @} </code> </pre> 

instead of the {@code ...} block. See this example on line 86.

+6
source share

This is a known bug. Link to the corresponding error:

https://bugs.openjdk.java.net/browse/JDK-8130754

Starting from 2016-10-07 there is no planned version for correction.

+1
source share

I ran into this problem too with NetBeans 8.0.1 just now, so it failed with it for about 15 minutes. At first with the format {@code } in javadoc, nothing appeared in parens, so I had actual breaks in the text in javadoc. Then, after he went into it and changed it (using <pre> and a couple of other tags) and opening other classes with {@link } and something else, he just started working.

Not sure what is going on, but maybe the javadoc renderer for the IDE needs some time to fully warm up. As non-technical as it sounds, it really is. One javadoc title showed one block {@code } correctly, but not one of several words. Now everything is showing correctly. Not sure if this will help anyone, but when I think that I will send a new bugzilla ticket to NetBeans, I will return and work. Back to my own ...

0
source share

One way around this error is to use a different character that looks like the standard "@" character. I found several Unicode characters that are similar:

  • @ (U + 0040): COMMERCIAL AT (normal, which is broken)
  • Ⓐ (U + 24D0): CIRCLED LATIN SMALL LETTER A
  • @ (U + FE6B): SMALL COMMERCIAL AT
  • @ (U + FF20): FULLWIDTH COMMERCIAL AT

I tried to write "@Override" with all these javadoc comments in the {@code ...} tag. (I use the Netbeans editor and Mozilla Firefox browser.) All characters work except for # 1, of course. In addition, # 3 did not appear in the editor, but it worked fine in the browser.

0
source share

All Articles