mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 02:14:44 +00:00
[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.
This commit is contained in:
1 parent
209c082530
commit
14407cedb5
1 file changed
+5
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user