[BUG] RequiredArgsConstructor breaks Eclipse compilation
Describe the bug
When using @RequiredArgsConstructor on a class with both an initialized and a non-initialized final field, ECJ gives the error: The blank final field ___ may not have been initialized.
If the class only has uninitialized final fields, no compilation error is reported, but the program crashes on startup.
To Reproduce
@RequiredArgsConstructor
public class Test {
final int f;
final int i = 3;
// Test(int f) {
// this.f = f;
// }
}Create this class in Eclipse, you should see The blank final field i may not have been initialized. However, manually writing the equivalent constructor (commented out) and commenting out the annotation fixes the problem.
The Eclipse Outline view does show a Test(int) constructor, and there is no complaint about f, so the constructor initializes it correctly. It complains only about the already initialized fields.
Additionally, running
@RequiredArgsConstructor
public class Test {
final int f;
public static void main(String[] args) {
}
}will result in
Error: Unable to initialize main class com.Test
Caused by: java.lang.VerifyError: Constructor must call super() or this() before return
Exception Details:
Location:
com/Test.<init>(I)V @5: return
Reason:
Error exists in the bytecode
Bytecode:
0000000: 2a1b b500 13b1 Expected behavior Compilation with no errors and run with no crashes.
Version info (please complete the following information):
- Lombok v1.18.48
- Eclipse Version: 2026-12 (4.42) Build id: I20260926-2300
- Java 27
Additional context This is a regression from 1.18.46. Could be related to https://github.com/eclipse-jdt/eclipse.jdt.core/pull/5350
Source: projectlombok/lombok