mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[lombok] IDEA-326444 Fix handling of static fields already containing lombok annotation
GitOrigin-RevId: 6f6583bd542f2c3d2dd46858b61c9904d5781152
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b8256fd542
commit
c4210cf6d8
@@ -57,7 +57,7 @@ public abstract class LombokGetterOrSetterMayBeUsedInspection extends LombokJava
|
||||
for (PsiField field : psiClass.getFields()) {
|
||||
PsiAnnotation annotation = field.getAnnotation(getAnnotationName());
|
||||
if (annotation != null) {
|
||||
if (!annotation.getAttributes().isEmpty()) {
|
||||
if (!annotation.getAttributes().isEmpty() || field.hasModifierProperty(PsiModifier.STATIC)) {
|
||||
isLombokAnnotationAtClassLevel = false;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Use lombok @Getter for 'Foo'" "false"
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public class Foo {
|
||||
@Getter
|
||||
private static char bar;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Use lombok @Getter for 'Foo'" "false"
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public class Foo<caret> {
|
||||
@Getter
|
||||
private static char bar;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Use lombok @Setter for 'Foo'" "false"
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
public class Foo<caret> {
|
||||
@Setter
|
||||
private static char bar;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Use lombok @Setter for 'Foo'" "false"
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
public class Foo<caret> {
|
||||
@Setter
|
||||
private static char bar;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user