diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2021-10-26 04:14:46 +0200 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2021-10-26 04:14:46 +0200 |
commit | 3a0176fd907ec594194cabf843a5681fd7b811fd (patch) | |
tree | d40257a3a2583974f936234e01c601a8c2fc4b0c /src/core/lombok/eclipse | |
parent | c359a4b41f2800c63ad28037fe02ccf8910dcc2e (diff) | |
download | lombok-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')
-rw-r--r-- | src/core/lombok/eclipse/EclipseNode.java | 9 |
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) { |