diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2021-05-29 18:49:05 +0200 |
---|---|---|
committer | Rawi01 <Rawi01@users.noreply.github.com> | 2021-06-03 19:23:19 +0200 |
commit | 60f575496b3184c2279e9dba470097ed164d5adf (patch) | |
tree | 61493259ec561b5d01a7a6e5361b4a7b16b5b106 /src/core/lombok/javac/handlers/HandleSuperBuilder.java | |
parent | 6758714ed564d72236564889157c4812eacb96fb (diff) | |
download | lombok-60f575496b3184c2279e9dba470097ed164d5adf.tar.gz lombok-60f575496b3184c2279e9dba470097ed164d5adf.tar.bz2 lombok-60f575496b3184c2279e9dba470097ed164d5adf.zip |
[fixes #2838] Handle anonymous classes properly
Generated qualified names (e.g. Outer.Inner) now stop at anonymous
classes instead of adding an empty part. All handlers that add static
fields/methods/types now add error messages instead of generating
invalid code.
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleSuperBuilder.java')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleSuperBuilder.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/lombok/javac/handlers/HandleSuperBuilder.java b/src/core/lombok/javac/handlers/HandleSuperBuilder.java index 87b18576..50193f99 100644 --- a/src/core/lombok/javac/handlers/HandleSuperBuilder.java +++ b/src/core/lombok/javac/handlers/HandleSuperBuilder.java @@ -163,6 +163,10 @@ public class HandleSuperBuilder extends JavacAnnotationHandler<SuperBuilder> { annotationNode.addError("@SuperBuilder is only supported on classes."); return; } + if (!isStaticAllowed(parent)) { + annotationNode.addError("@SuperBuilder is not supported on non-static nested classes."); + return; + } job.parentType = parent; JCClassDecl td = (JCClassDecl) parent.get(); |