As a consultant I am part of a lot of different Java projects.
Some of these project use Lombok.
When you use a Lombok annotation code gets generated when the code is compiled.
This code is not visible in the IntelliJ IDEA editor which could be a problem when you want to debug your application and need to add a breakpoint for the generated code.
Suppose you have a Java class with a simple constructor without using Lombok annotations.
You can place a breakpoint in the constructor and when you debug the application in IntelliJ IDEA the execution stops at the breakpoint.
Now you can check for example the values of parameters that are passed into the constructor call.
But when you use a Lombok annotation like @RequiredArgsConstructor the code for the constructor is generated and not visible in your editor.
If you want to check the values of parameters passed into the constructor you need to set a breakpoint at the line that has the @RequiredArgsConstructor statement.
When you debug your application IntelliJ IDEA will stop execution when the constructor is invoked and you can check values of parameters.
The following example shows first a Java class with a constructor in the code:
package mrhaki.blog;
public class UserContext {
private final UserProvider userProvider;
public UserContext(UserProvider userProvider) {
this.userProvider = userProvider; // Add breakpoint on this line
}
String getName() {
return userProvider.getId();
}
}
It is easy to set the breakpoint as you have all the source code:
Now suppose you use Lombok and instead of writing the constructor in the code you use the @RequiredArgsConstructor Lombok annotation:
package mrhaki.blog;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor // Add breakpoint on this line
public class UserContext {
private final UserProvider userProvider;
String getName() {
return userProvider.getId();
}
}
The compiled class file will have the constructor code just as you would have written it yourself. In order to set a breakpoint you simply place it on the line of the annotation:
Running the application in debug mode will stop execution at the generated constructor code and allows you to check the value of the constructor argument that is used:
To be able to set breakpoints even when Lombok annotations are used can be very useful. For example to check if Spring components are created with values that you expect.
Written with Intellij IDEA 2026.2.3.


