google / google/google-java-format

Support Markdown Documentation Comments (JEP 467, JDK 23)

Offen
#1,193 9 Kommentare 22 Reaktionen 1 zugewiesene Person Beansprucht von @eamonnmcmanus Auf GitHub ansehen
Java 25
Vorherrschende Sprache
Java
Sterne
6.2k
Forks
937
Ø Merge
6 Min.
Gemergte PRs (30 T.)
3

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.