mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 18:15:55 +00:00
[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.
This commit is contained in:
1 parent
6758714ed5
commit
60f575496b
75 files changed
+1103
-28
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
public class ConstructorsInAnonymousClass {
|
||||
Object annonymous = new Object() {
|
||||
@AllArgsConstructor @RequiredArgsConstructor @NoArgsConstructor class Inner {
|
||||
private String string;
|
||||
private @NonNull String string2;
|
||||
public @java.lang.SuppressWarnings("all") Inner(final String string, final @NonNull String string2) {
|
||||
super();
|
||||
if ((string2 == null))
|
||||
{
|
||||
throw new java.lang.NullPointerException("string2 is marked non-null but is null");
|
||||
}
|
||||
this.string = string;
|
||||
this.string2 = string2;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") Inner(final @NonNull String string2) {
|
||||
super();
|
||||
if ((string2 == null))
|
||||
{
|
||||
throw new java.lang.NullPointerException("string2 is marked non-null but is null");
|
||||
}
|
||||
this.string2 = string2;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") Inner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
x() {
|
||||
super();
|
||||
}
|
||||
};
|
||||
public ConstructorsInAnonymousClass() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user