The formatter incorrectly encodes certain @ symbols that are included in <pre> {@code javadoc blocks. I am not sure the rules for encoding the @ on annotations, it doesn't appear to break anything but encoding it on a {@code does break the javadoc rendering.
Possibly related to: #2071
Reproduction Input:
/**
* Example showing formatter bug with {@code @} in pre blocks.
*
* <pre>
* {@code
* @MyAnnotation
* public class Example {
*
* @AnotherAnnotation
* private String field;
* }
* }
* </pre>
*/
public interface ExampleService {
/**
* Another method with annotation in javadoc.
*
* <pre>
* {@code
* @Override
* public void doSomething() {
* // implementation
* }
* }
* </pre>
*/
void doSomething();
}
With "Enable Classic Javadoc formatting" : False
With "Format Java code snippets inside 'pre' tags": False
Result: No Change
With "Enable Classic Javadoc formatting" : True
With "Format Java code snippets inside 'pre' tags": False
Result: @'s on some Annotations are converted to @
/**
* Example showing formatter bug with {@code @} in pre blocks.
*
* <pre>
* {@code
* @MyAnnotation <--- Possible error
* public class Example {
*
* @AnotherAnnotation <--- Why did this not get encoded
* private String field;
* }
* }
* </pre>
*/
public interface ExampleService {
/**
* Another method with annotation in javadoc.
*
* <pre>
* {@code
* @Override <--- Possible error
* public void doSomething() {
* // implementation
* }
* }
* </pre>
*/
void doSomething();
}
With "Enable Classic Javadoc formatting" : True
With "Format Java code snippets inside 'pre' tags": True
Result: @'s on some Annotations and some {@code are converted to @
/**
* Example showing formatter bug with {@code @} in pre blocks.
*
* <pre>
* {
* @code <--- Definitive error
* @MyAnnotation
* public class Example {
* @AnotherAnnotation
* private String field;
* }
* }
* </pre>
*/
public interface ExampleService {
/**
* Another method with annotation in javadoc.
*
* <pre>
* {@code
* @Override
* public void doSomething() {
* // implementation
* }
* }
* </pre>
*/
void doSomething();
}
The formatter incorrectly encodes certain
@symbols that are included in<pre> {@codejavadoc blocks. I am not sure the rules for encoding the@on annotations, it doesn't appear to break anything but encoding it on a{@codedoes break the javadoc rendering.Possibly related to: #2071
Reproduction Input:
With "Enable Classic Javadoc formatting" : False
With "Format Java code snippets inside 'pre' tags": False
Result: No Change
With "Enable Classic Javadoc formatting" : True
With "Format Java code snippets inside 'pre' tags": False
Result:
@'s on some Annotations are converted to@With "Enable Classic Javadoc formatting" : True
With "Format Java code snippets inside 'pre' tags": True
Result:
@'s on some Annotations and some{@codeare converted to@