mplushnikov / lombok-intellij-plugin

Lombok Plugin for IntelliJ IDEA
Apache License 2.0
3.11k stars 635 forks source link

Delombok hangs if nested class carries @Builder(toBuilder = true) #1122

Open nicoweidner opened 2 years ago

nicoweidner commented 2 years ago

Short description

When using the delombok action on a nested class with @Builder(toBuilder = true) annotation, IntelliJ hangs (see below for example project)

Expected behavior

No hangup, delombok should produce code as expected

Version information

Steps to reproduce

Use delombok on @Builder in the sample project below

Sample project

I created a fresh gradle project; I believe only the following two files will be relevant, though I am happy to provide the rest if required: OuterClass.java

import lombok.Builder;

public class OuterClass {

    @Builder(toBuilder = true)
    class InnerClass extends OuterClass {
    }
}

build.gradle

plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.projectlombok:lombok:1.18.22'
    annotationProcessor 'org.projectlombok:lombok:1.18.22'
}

Additional information

The same problem happens if the outer class is an interface instead (this is the setup we had in our project).

Either of the following resolve the hangup, though delombok produces compile errors in the generated code:

Stacktrace

The following threaddump is produced by IntelliJ; unfortunately, I cannot make much sense of it (attached as file since it's quite long)

threadDump-20220405-152256.txt

topr commented 2 years ago

I can confirm the same issue.