google / google/google-java-format

Support Markdown Documentation Comments (JEP 467, JDK 23)

未关闭
#1,193 9 条评论 22 个 reaction 已指派 1 人 已被 @eamonnmcmanus 认领 在 GitHub 查看
Java 25
主要语言
Java
星标
6.2k
派生
937
平均合并
6 分钟
30 天内合并 PR
3

描述

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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。