Please suggest how to use @Wither when inheritance applied.
I have an abstract class Parent and concrete Child. Child is supposed to be immutable. Putting @Wither on both gives me two errors:
- The constructor Child(String) is undefined
- The type Child must implement the inherited abstract method Parent.withA(String)
@Value
@Wither
@NonFinal
@SuperBuilder
abstract class Parent {
String a;
}
@Value
@Wither
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
class Child extends Parent {
String b;
}
I'd be happy to just remove @Wither and use the builder methods, but I'm refactoring a public library (trying to optimize the model classes) and I don't want compilation errors on my clients.
I also found this issue that explains the second error. But the logic of the intention is not clear https://github.com/rzwitserloot/lombok/issues/945