[clang-format] Regression: Java field annotation forces a break after `->` in a short lambda (23 vs 22)
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
`--style='{BasedOnStyle: Google, BreakAfterJavaFieldAnnotations: true, BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}'`:
```java
class C {
@NonNull
private static final Runnable NO_OP = state -> {};
}
```
22.1.8 keeps it as written. 23.1.0:
```java
@NonNull
private static final Runnable NO_OP = state ->
{
};
```
The empty body splitting to `{`/`}` here is probably the same as #219711.
Contributor guide
Research direction
Reproduce the provided Java snippet with the Google-based style in clang-format 22.1.8 and 23.1.0, then trace the formatting path responsible for the lambda's empty body. Done means the configured short lambda remains on one line instead of breaking after `->` and splitting its braces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100