[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:
Rawi01 committed 2021-06-03 19:23:19 +02:00
1 parent 6758714ed5
commit 60f575496b
75 files changed
+1103 -28

No files matched your search

@@ -0,0 +1,33 @@
import lombok.NonNull;
public class ConstructorsInAnonymousClass {
Object annonymous = new Object() {
class Inner {
private String string;
@NonNull
private String string2;
@java.lang.SuppressWarnings("all")
public Inner(final String string, @NonNull final String string2) {
if (string2 == null) {
throw new java.lang.NullPointerException("string2 is marked non-null but is null");
}
this.string = string;
this.string2 = string2;
}
@java.lang.SuppressWarnings("all")
public Inner(@NonNull final String string2) {
if (string2 == null) {
throw new java.lang.NullPointerException("string2 is marked non-null but is null");
}
this.string2 = string2;
}
@java.lang.SuppressWarnings("all")
public Inner() {
}
}
};
}