Lombok-intellij-plugin: IDEA 2019.2 highlights builder() method invocation as an error

Created on 24 Jul 2019  路  34Comments  路  Source: mplushnikov/lombok-intellij-plugin

Short description

builder() method usage causes a warning message:

Cannot access CustomerDto.CustomerDtoBuilder

Expected behavior

The IDEA warning message should not appear.

Version information

  • IDEA Version: IDEA 2019.2 (Ultimate Edition)
  • JDK Version: 1.8
  • OS Type & Version: Windows 10
  • Lombok Plugin Version: 0.25-2019.1
  • Lombok Dependency Version: 1.18.8

Steps to reproduce

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@FieldDefaults(level = PRIVATE)
public class CustomerDto {
    String id;
    String firstName;
}

screen

bug

Most helpful comment

Hello everyone!
Can you please test this build (Only Intellij 2019.2 and hiher) of plugin: https://github.com/mplushnikov/lombok-intellij-plugin/releases/download/0.26.alpha/lombok-plugin-0.26-2019.2.jar
You have to install it manually: Settings->Plugins->Install Plugin from Disk...

It contains some fixes for general caching. Does it fix you issue in your environment?

All 34 comments

I'v just updated intellij and faced this problem

+1 I am also experiencing the same issue... is there a workaround?

+1 same issue

I've just run _Invalidate Cache and Restart_ and the problem has gone.

Nop... After some time it appears again. :D

Ok, disabling and enabling Lombok Plugin (with IDEA restarts) fixed this problem for me.

Ok, disabling and enabling Lombok Plugin (with IDEA restarts) fixed this problem for me.

Seemed to work for me as well but the errors are back

+1, affected by this as well.
Seems related to #637. Looking at the logs provide a Non-idempotent computation on the builder class.

+1 seeing this issue with 2019.2 update

+1 seeing same issue

+1 same issue on 2019.2; various fixes seems to work but after some amount of time it appears again

+1 same issue

+1 same issue

OPs example doesn't error for me, but I do get an error like what @Bluecodelf shows. It's caused by the @Singular annotation and removing it fixes any builder errors intelliJ flagged. I think the error is being thrown from here. Pretty annoying bug, but the build still compiles and intellisense autocomplete still works as well.

+1 same issue
I have several classes with Builder annotation but only one shows this problem.

Removing @Singular annotation worked for me. However I do want @Singular annotation in my class. Its a bug in the plugin.

There is a bug with plugin. When you add @Singular annotation to Collection field Idea begins to complain on static builder() method.
Please fix that.
Do I need to create extra issue for this case?

+1 same issue. If I set the value property of the @Singular annotation then Idea didn't complain. Please fix it.

The problem also goes away if you use @Singular("foo") instead of just @Singular on property called "foo". Its a workaround. The bug is definitely present.

I am already using @Singular("..."). In my case the property name is in plural and I used singular in the annotation value like:

@Singular("prop")
private List<String> props

I changed to use the annotation value exactly as the property name like bellow, but still got the same problem.

@Singular("props")
private List<String> props

The only way to remove the error is to remove Singular annotation.

@Bluecodelf Good catch!

Looks like new check for internal caches made by Intellij in 2019.2 breaks parts of @Singular implementation in the plugin :-( Have to investigate it deeper...

My experience is the same - if I remove @Singular, the errors go away, but I've come to love that annotation. Hope this gets fixed soon because I've postponed updating IntelliJ until it is.

Hello everyone!
Can you please test this build (Only Intellij 2019.2 and hiher) of plugin: https://github.com/mplushnikov/lombok-intellij-plugin/releases/download/0.26.alpha/lombok-plugin-0.26-2019.2.jar
You have to install it manually: Settings->Plugins->Install Plugin from Disk...

It contains some fixes for general caching. Does it fix you issue in your environment?

@mplushnikov hey, I just tested it. It looks good. I don't see this error anymore.

Works for me. Thank you.

Works for me as well. Thank you.

Works for me as well. Thank you.

Works just fine, thanks!

Thank you very much for testing!

Just released new plugin version (0.26.2) for IntelliJ 2019.2+

image

After an update to releasebuild_0.26.2 I started experiencing this issue in my project. I see in assets you have to zips:

lombok-plugin-0.26.2-2019.2.1.zip
lombok-plugin-0.26.2-2019.2.zip

Which is actually right one?
Are you sure that you published to marketplace the right version?

After manual update to lombok-plugin-0.26.2-2019.2.1.zip I needed to run Invalidate Cache and Restart in IntelliJ and after that it worked again as usual.

Look like the issue is back in 2020.3 with plugin 0.32-EAP.
Workaround still is _Invalidate Cache and Restart_.

Android Studio 4.1.2 with plugin 0.34-2020.1 occurs.
Workaround still is Invalidate Cache and Restart.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wellhor picture wellhor  路  6Comments

clayreimann picture clayreimann  路  3Comments

chrvip picture chrvip  路  5Comments

gigaSproule picture gigaSproule  路  4Comments

pedegie picture pedegie  路  4Comments