question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected compile error with @Builder on record

See original GitHub issue

Short 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

  1. Create a record class Record with one Integer field with name field
  2. Annotate the class with @Builder
  3. Create a class with main method, inside the method add Record.builder().field(1).build()
  4. 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:open
  • Created 2 years ago
  • Reactions:11
  • Comments:5

github_iconTop GitHub Comments

1reaction
JarvisCraftcommented, Jan 2, 2022

@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 😃 image

1reaction
JarvisCraftcommented, Jan 2, 2022

The plugin maintainer seems to have disappeared from Github for over 6 months, I hope they are OK. I wouldn’t expect this to be fixed any time soon though, sadly.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found