Builder nested class not recognised by IntelliJ 2020.3.3 when called 'Builder'
See original GitHub issueShort 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
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
- Update to IntelliJ Ultimate 2020.3.3
- Clear and Set lombok.builder.classname to Builder in lombok.config
- Open Java class that references a Builder nested class
- 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.
- 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:
- Created 3 years ago
- Reactions:24
- Comments:30 (4 by maintainers)
@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 orbuilder()
method.It goes as follows:
@Builder
❌@Builder
✔️@Builder
annotation param and constructor annotated with it ✔️@Builder
annotation param and constructor annotated with it ❌@Builder
✔️@Builder
✔️@Builder
annotation param and class annotated with it ✔️@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 Lombok1.18.20
.Downgrading to 2020.2 for the time being 🙄
according to https://youtrack.jetbrains.com/issue/IDEA-262693 this issue will be more fully fixed in 2021.2