lombok-intellij-plugin icon indicating copy to clipboard operation
lombok-intellij-plugin copied to clipboard

@Builder on constructor with @Singular on parameters gives "Cannot resolve method ..." error/warning

Open djarnis73 opened this issue 4 years ago • 1 comments

Short description

When using @Builder on a constructor that takes a collection annotated with @Singular, intellij gives "red" warning on the builder methods (both singular and collection methods). Project still builds though.

Version information

IntelliJ IDEA 2020.2.3 (Ultimate Edition) Build #IU-202.7660.26, built on October 6, 2020 Runtime version: 11.0.8+10-b944.34 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 10.15.7 Non-Bundled Plugins: Lombook Plugin, org.jetbrains.kotlin

Lombok plugin version: 0.32-2020.2

Steps to reproduce

The following class demonstrates the issue:

public class LombokBuilderSingularBug {
    final Set<String> strings;

    @Builder
    private LombokBuilderSingularBug(@Singular Set<String> strings) {
        this.strings = strings;
    }

    public void test() {
        LombokBuilderSingularBug.builder().string("A");
        LombokBuilderSingularBug.builder().strings(new HashSet<>());
    }
}

Screenshot

image

djarnis73 avatar Oct 21 '20 07:10 djarnis73

I experience the same thing, but it happens with @Builder on a normal method (not a constructor).

It cannot resolve the method, but once I do some simple change to the file (or the builder call, or builder itself) it refreshes and works for some time before it stops working again later (couldn't figure what is the cause of it stopping working).

Version: Lombok 0.33-2020.2 IDEA version: 2020.2.3

redhead avatar Nov 06 '20 09:11 redhead