diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-01-08 23:59:22 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-01-09 00:00:32 +0100 |
commit | 14407cedb5e061d8e7a53ebdd167dc82db779df0 (patch) | |
tree | 79643976a63ac7ac1f5fc6370c9bff8aabdbc8c7 /src/core/lombok/javac/JavacResolution.java | |
parent | 209c082530cc759d26ab30c25f970ea5f7b7ab3a (diff) | |
download | lombok-14407cedb5e061d8e7a53ebdd167dc82db779df0.tar.gz lombok-14407cedb5e061d8e7a53ebdd167dc82db779df0.tar.bz2 lombok-14407cedb5e061d8e7a53ebdd167dc82db779df0.zip |
[fixes #1553] attriber of JDK9 checks the enclosing class’s type, which we intentionally haven’t set yet. To avoid NPEs, let’s set it.
Diffstat (limited to 'src/core/lombok/javac/JavacResolution.java')
-rw-r--r-- | src/core/lombok/javac/JavacResolution.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/lombok/javac/JavacResolution.java b/src/core/lombok/javac/JavacResolution.java index ded6284b..79c7cad2 100644 --- a/src/core/lombok/javac/JavacResolution.java +++ b/src/core/lombok/javac/JavacResolution.java @@ -222,6 +222,11 @@ public class JavacResolution { } private void attrib(JCTree tree, Env<AttrContext> env) { + if (env.enclClass.type == null) try { + env.enclClass.type = Type.noType; + } catch (Throwable ignore) { + // This addresses issue #1553 which involves JDK9; if it doesn't exist, we probably don't need to set it. + } if (tree instanceof JCBlock) attr.attribStat(tree, env); else if (tree instanceof JCMethodDecl) attr.attribStat(((JCMethodDecl) tree).body, env); else if (tree instanceof JCVariableDecl) attr.attribStat(tree, env); |