[lombok] ignore implicit constructor usages in generated code (IDEA-300494)

GitOrigin-RevId: bcafd4fbb0f0771ccd46acf7cff9bc23ee3e9130
This commit is contained in:
Anna Kozlova
2023-01-23 11:11:27 +01:00
committed by intellij-monorepo-bot
parent c645fa338c
commit 630b9cb64f
4 changed files with 31 additions and 1 deletions

View File

@@ -167,7 +167,7 @@ class ConstructorReferencesSearchHelper {
} }
for (PsiMethod method : constructors) { for (PsiMethod method : constructors) {
PsiCodeBlock body = method.getBody(); PsiCodeBlock body = method.getBody();
if (body == null || method == constructor && isStrictSignatureSearch) { if (body == null || method == constructor && isStrictSignatureSearch || !method.isPhysical()) {
continue; continue;
} }
PsiStatement[] statements = body.getStatements(); PsiStatement[] statements = body.getStatements();

View File

@@ -25,4 +25,8 @@ public class RenameClassActionTest extends AbstractLombokLightCodeInsightTestCas
public void testLogClassRenamed() throws Exception { public void testLogClassRenamed() throws Exception {
doTest("CakeCooked"); doTest("CakeCooked");
} }
public void testConstructors() throws Exception {
doTest("MyBaseClass1");
}
} }

View File

@@ -0,0 +1,13 @@
import lombok.*;
@AllArgsConstructor
class NewEntity extends MyBaseClass1 {
private Long id;
public NewEntity() {
super();
}
}
abstract class MyBase<caret>Class1 {
public MyBaseClass1() {}
}

View File

@@ -0,0 +1,13 @@
import lombok.*;
@AllArgsConstructor
class NewEntity extends MyBaseClass {
private Long id;
public NewEntity() {
super();
}
}
abstract class MyBase<caret>Class {
public MyBaseClass() {}
}