aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lombok/eclipse/EclipseNode.java9
-rw-r--r--src/core/lombok/javac/JavacNode.java8
2 files changed, 11 insertions, 6 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) {
diff --git a/src/core/lombok/javac/JavacNode.java b/src/core/lombok/javac/JavacNode.java
index 035f7c53..fca0d0d1 100644
--- a/src/core/lombok/javac/JavacNode.java
+++ b/src/core/lombok/javac/JavacNode.java
@@ -286,13 +286,15 @@ public class JavacNode extends lombok.core.LombokNode<JavacAST, JavacNode, JCTre
@Override public boolean isStatic() {
if (node instanceof JCClassDecl) {
+ JCClassDecl t = (JCClassDecl) node;
+ long f = t.mods.flags;
+ if (((Flags.INTERFACE | Flags.ENUM) & f) != 0) return true;
JavacNode directUp = directUp();
if (directUp == null || directUp.getKind() == Kind.COMPILATION_UNIT) return true;
if (!(directUp.get() instanceof JCClassDecl)) return false;
JCClassDecl p = (JCClassDecl) directUp.get();
- long f = p.mods.flags;
- if ((Flags.INTERFACE & f) != 0) return true;
- if ((Flags.ENUM & f) != 0) return true;
+ f = p.mods.flags;
+ if (((Flags.INTERFACE | Flags.ENUM) & f) != 0) return true;
}
if (node instanceof JCVariableDecl) {