diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2022-01-30 00:22:36 +0100 |
---|---|---|
committer | Rawi01 <Rawi01@users.noreply.github.com> | 2022-01-30 00:22:36 +0100 |
commit | 7af752602af4cab91bb6929c9a9b4d93babd629c (patch) | |
tree | c14a63e3cf6d30ae24f4316210bb47c81a08bb49 /src | |
parent | 36db0524e4d0f6bc6fa2440b0df2c425c4d130fc (diff) | |
download | lombok-7af752602af4cab91bb6929c9a9b4d93babd629c.tar.gz lombok-7af752602af4cab91bb6929c9a9b4d93babd629c.tar.bz2 lombok-7af752602af4cab91bb6929c9a9b4d93babd629c.zip |
[fixes #3097] Update inner class type when creating a static class
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleUtilityClass.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/lombok/javac/handlers/HandleUtilityClass.java b/src/core/lombok/javac/handlers/HandleUtilityClass.java index 6fa630e2..716d6d63 100644 --- a/src/core/lombok/javac/handlers/HandleUtilityClass.java +++ b/src/core/lombok/javac/handlers/HandleUtilityClass.java @@ -25,6 +25,9 @@ import static lombok.core.handlers.HandlerUtil.handleExperimentalFlagUsage; import static lombok.javac.handlers.JavacHandlerUtil.*; import com.sun.tools.javac.code.Flags; +import com.sun.tools.javac.code.Symbol.ClassSymbol; +import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.code.Type.ClassType; import com.sun.tools.javac.tree.JCTree.JCAnnotation; import com.sun.tools.javac.tree.JCTree.JCBlock; import com.sun.tools.javac.tree.JCTree.JCClassDecl; @@ -124,6 +127,10 @@ public class HandleUtilityClass extends JavacAnnotationHandler<UtilityClass> { } else if (element.getKind() == Kind.TYPE) { JCClassDecl innerClassDecl = (JCClassDecl) element.get(); innerClassDecl.mods.flags |= Flags.STATIC; + ClassSymbol innerClassSymbol = innerClassDecl.sym; + if (innerClassSymbol != null && innerClassSymbol.type instanceof ClassType) { + ((ClassType) innerClassSymbol.type).setEnclosingType(Type.noType); + } } } |