aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/EclipseNode.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-10-26 04:14:46 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-10-26 04:14:46 +0200
commit3a0176fd907ec594194cabf843a5681fd7b811fd (patch)
treed40257a3a2583974f936234e01c601a8c2fc4b0c /src/core/lombok/eclipse/EclipseNode.java
parentc359a4b41f2800c63ad28037fe02ccf8910dcc2e (diff)
downloadlombok-3a0176fd907ec594194cabf843a5681fd7b811fd.tar.gz
lombok-3a0176fd907ec594194cabf843a5681fd7b811fd.tar.bz2
lombok-3a0176fd907ec594194cabf843a5681fd7b811fd.zip
[fixes #3014] Detecting whether inner classes are static wouldn't work if placed inside an enum or interface.
Diffstat (limited to 'src/core/lombok/eclipse/EclipseNode.java')
-rw-r--r--src/core/lombok/eclipse/EclipseNode.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/lombok/eclipse/EclipseNode.java b/src/core/lombok/eclipse/EclipseNode.java
index 4f86f0a5..4950aeef 100644
--- a/src/core/lombok/eclipse/EclipseNode.java
+++ b/src/core/lombok/eclipse/EclipseNode.java
@@ -215,13 +215,16 @@ public class EclipseNode extends lombok.core.LombokNode<EclipseAST, EclipseNode,
@Override public boolean isStatic() {
if (node instanceof TypeDeclaration) {
+ TypeDeclaration t = (TypeDeclaration) node;
+ int f = t.modifiers;
+ if (((ClassFileConstants.AccInterface | ClassFileConstants.AccEnum) & f) != 0) return true;
+
EclipseNode directUp = directUp();
if (directUp == null || directUp.getKind() == Kind.COMPILATION_UNIT) return true;
if (!(directUp.get() instanceof TypeDeclaration)) return false;
TypeDeclaration p = (TypeDeclaration) directUp.get();
- int f = p.modifiers;
- if ((ClassFileConstants.AccInterface & f) != 0) return true;
- if ((ClassFileConstants.AccEnum & f) != 0) return true;
+ f = p.modifiers;
+ if (((ClassFileConstants.AccInterface | ClassFileConstants.AccEnum) & f) != 0) return true;
}
if (node instanceof FieldDeclaration) {