google / google/google-java-format

Support Markdown Documentation Comments (JEP 467, JDK 23)

Ouverte
#1,193 9 commentaires 22 réactions 1 personne assignée Réclamée par @eamonnmcmanus Voir sur GitHub
Java 25
Langage dominant
Java
Étoiles
6.2k
Forks
937
Merge moyen
6 min
PR mergées (30 j)
3

Description

Consider the following code:

```java
import java.nio.ByteBuffer;

interface BufferAllocator {
/// Returns a lease for a [ByteBuffer] with at least the specified [capacity][ByteBuffer#capacity].
LeasedByteBuffer getByteBuffer(long minCapacity);
}
```

Formatting the above code causes the following issues:
1. The doc comment is split into two lines, but the second line starts with `//` instead of `///`.
2. The import statement is removed, breaking the links.

Disabling Javadoc formatting doesn't prevent either issue.
The only workaround I could find was to disable google-java-format.

Tested with JDK 23 and google-java-format 1.24.0.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.