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.

Builder nested class not recognised by IntelliJ 2020.3.3 when called 'Builder'

See original GitHub issue

Short description

Update to intellij 2020.3.3 ultimate Open Java class that references XXX.Builder Observe red squiggles under Builder and IntelliJ indicated an error ij-2020 3 3-lombok – Reference java 2021-03-17 13-07-46

Expected behavior

XXX.Builder nested class should be recognised

Version information

IntelliJ Ultimate 2020.3.3 OpenJDK Runtime Environment Zulu11.45+27-CA (build 11.0.10+9-LTS) macOS 11.2.3 (20D91) MacBookPro17,1 Apple M1 bundled 203.7717.56 lombok-1.18.16 through spring-boot-dependencies-2.4.2 through spring-boot-starter-parent-2.4.2

Steps to reproduce

  1. Update to IntelliJ Ultimate 2020.3.3
  2. Clear and Set lombok.builder.classname to Builder in lombok.config
  3. Open Java class that references a Builder nested class
  4. Observe squiggles.

Sample project

Please provide a sample project that exhibits the problem. You should also include .idea folder so we can inspect the settings.

ij-2020.3.3-lombok.zip

  • Sample project provided
  • I am able to reproduce this error on the sample project by following the steps described above

Additional information

Not specifying builder class name as Builder solves this problem however I do want to be able to call the nested class of XXX XXX.Builder instead of XXX.XXXBuilder because the second XXX is superfluous. I have encountered this problem in earlier incarnations of Lombok together with IntelliJ but 2020.3.2 did not flag this as an error.

Stacktrace

Not applicable

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:24
  • Comments:30 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
toprcommented, Apr 9, 2021

@v1nc3n4 thanks, to clarify. It’s always been generated all just fine. Only IntelliJ got it in red not being able to recognise. I mean, build works both with Gradle/Maven and even with IntelliJ itself but builder class and method are in red / no auto-complete, etc.

@fhomasp there you go, I can confirm for me on 2021.1 also it is the case constructor annotated with @Builder isn’t working - IDE does not recognise neither builder class or builder() method.

It goes as follows:

  • name specified as “Builder” at lombok.config and constructor annotated with @Builder
  • name specified as “Foo” at lombok.config and constructor annotated with @Builder ✔️
  • name specified as “Foo” as @Builder annotation param and constructor annotated with it ✔️
  • name specified as “Builder” as @Builder annotation param and constructor annotated with it ❌
  • name specified as “Builder” at lombok.config and class annotated with @Builder ✔️
  • name specified as “Foo” at lombok.config and class annotated with @Builder ✔️
  • name specified as “Foo” as @Builder annotation param and class annotated with it ✔️
  • name specified as “Builder” as @Builder annotation param and class annotated with it ✔️

In short it does not work properly only when constructor is annotated and builder class name is “Builder”, regardless of whether the name is set at the annotation or at lombok.config file.

Checked with IntelliJ 2021.1 and Lombok 1.18.20.

Downgrading to 2020.2 for the time being 🙄

1reaction
mihxilcommented, Jul 1, 2021

according to https://youtrack.jetbrains.com/issue/IDEA-262693 this issue will be more fully fixed in 2021.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Builder nested class not recognised by IntelliJ 2020.3.3 when ...
Builder nested class not recognised by IntelliJ 2020.3.3 when called 'Builder'
Read more >
[2020.3.3] Lombok Builder with builderClassName not working
Create any class using lombok's @Builder annotation with a specified builder class name. @Builder(builderClassName = "Builder") · Try to use the class anywhere....
Read more >
Lombok @Builder Not Recognised By Intellij - ADocLib
Lombok is available in maven central so telling Gradle to. Builder nested class not recognised by IntelliJ 2020.3.3 when called 'Builder'. Short description....
Read more >
Lombok @Builder not recognised by IntelliJ - Stack Overflow
I am using Lombok version 1.14.​​ And Java 11. The problem is similar to this one: Lombok not working with Intellij But the...
Read more >
flutter getx how to get context parent widget - You.com
GetBuilder. Does not listen to obs changes. Must be rebuilt manually by you, calling controller.update() . Similar to a ...
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