Unexpected compile error with @Builder on record
See original GitHub issueShort description
Lombok has supported record
Builder, but when using the plugin
Can not resolve method
error is shown in IntelliJ, while mvn clean compile
Build Success
Expected behavior
Both IntelliJ and maven build should success.
Version information
- IDEA Version:
IntelliJ IDEA 2021.2.3 (Community Edition)
Build #IC-212.5457.46, built on October 12, 2021
Runtime version: 11.0.12+7-b1504.40 amd64 - JDK Version: openjdk 16 2021-03-16
- OS Type & Version: Window 10
- Lombok Plugin Version: bundled 212.5457.46
- Lombok Dependency Version: 1.18.22
Steps to reproduce
- Create a record class
Record
with one Integer field with namefield
- Annotate the class with
@Builder
- Create a class with main method, inside the method add
Record.builder().field(1).build()
- IntelliJ will show compile error
Cannot resolve method 'field' in 'RecordBuilder'
import lombok.Builder;
@Builder
public record Record(Integer field) {
}
public class LombokBuilderIssue {
public static void main(String[] args) {
Record.builder().field(1).build();
}
}
Sample project
Please check out this project https://github.com/samabcde/lombok-plugin-issue
- [Y] Sample project provided
- [Y] I am able to reproduce this error on the sample project by following the steps described above
Issue Analytics
- State:
- Created 2 years ago
- Reactions:11
- Comments:5
Top Results From Across the Web
Lombok's @Builder not detecting fields of the Java Record
It is a known Intellij bug. There is, however, a workaround: This doesn't work: @Builder public record MyRecord(String myField) {}.
Read more >Fix the top 10 most common compile time errors in Java
Compile time errors in Java can be confusing and frustrating. Be prepared with this list of the 10 most common Java compile errors...
Read more >On Compiler Error Messages: What They Say and ... - Hindawi
Programmers often encounter cryptic compiler error messages that are difficult to understand and thus difficult to resolve.
Read more >How to Fix FIELD_CUSTOM_VALIDATION_EXCEPTION Error
How do you resolve the FIELD_CUSTOM_VALIDATION_EXCEPTION error? The Record-Triggered Flow is a way of automating business processes.
Read more >An unexpected error occurred. Please include this ErrorId if ...
Hi Yamini, Greetings! ... I would suggest you to check the customization behind the process that you are trying to access as the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mplushnikov, looks like you haven’t configured your JetBrains email for your GitHub account thus your commits are not displayed in your profile and people are worried about you 😃
Plugin maintenance is under JetBrains now and thus seems to have been moved to their YouTrack. Michail seems to be fine as he responds to the issues there.