[fixes #3605] Remove outer type reference when marking class as static

The class now implements Serializable to trigger generation of this$0
fields in the inner class. Since Java 18 the compiler only generates the
reference to the outer class if it is in use or the class is
Serializable.
This commit is contained in:
Rawi01 committed 2024-11-24 20:58:41 +01:00
1 parent 9f5de53e06
commit 4294ebd301
4 files changed
+19 -15

No files matched your search

@@ -1,5 +1,5 @@
class UtilityClassInner {
static final @lombok.experimental.UtilityClass class UtilClass {
@java.lang.SuppressWarnings("serial") class UtilityClassInner {
static final @lombok.experimental.UtilityClass class UtilClass implements java.io.Serializable {
private @java.lang.SuppressWarnings("all") @lombok.Generated UtilClass() {
super();
throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated");