mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-psi] LightFieldBuilder: make hasInitializer and getInitializer consistent
Fixes IDEA-265211 2020.3 Update is causing a lombok error using log in static block Co-authored-by: Michail Plushnikov <michail.plushnikov@jetbrains.com> GitOrigin-RevId: 76f271c26948d4f6815a0404723c8e0466fb0c1e
This commit is contained in:
committed by
intellij-monorepo-bot
co-authored by
Michail Plushnikov
parent
80c48a2ce6
commit
9b0b477c92
@@ -59,6 +59,11 @@ public class LightFieldBuilder extends LightVariableBuilder<LightFieldBuilder> i
|
||||
return myInitializer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasInitializer() {
|
||||
return myInitializer != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiDocComment getDocComment() {
|
||||
return myDocComment;
|
||||
|
||||
@@ -49,6 +49,10 @@ public class LombokHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
|
||||
public void testLombokBasics() { doTest(); }
|
||||
|
||||
public void testLombokStaticVars() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected LightProjectDescriptor getProjectDescriptor() {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.slf4j;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
interface <warning descr="Interface 'Logger' is never used">Logger</warning> {
|
||||
void info(String msg);
|
||||
}
|
||||
|
||||
@Slf4j
|
||||
public class LombokStaticVars {
|
||||
static {
|
||||
log.info("This should not produce error: Variable 'log' might not have been initialized");
|
||||
}
|
||||
|
||||
public static final Runnable LAMDA = () -> {
|
||||
log.info("This should not produce error: Variable 'log' might not have been initialized");
|
||||
};
|
||||
|
||||
public static void main(String[] args) {
|
||||
LAMDA.run();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user