Consider the following code:
import lombok.EqualsAndHashCode;
public interface DynamicType {
interface Unloaded extends DynamicType {
}
class Default implements DynamicType {
@EqualsAndHashCode(callSuper = false)
public static class Unloaded extends Default implements DynamicType.Unloaded {
}
}
}
Compilation fails with error:
DynamicType.java:[11,9] reference to Unloaded is ambiguous
[ERROR] both class DynamicType.Default.Unloaded in DynamicType.Default and interface DynamicType.Unloaded in DynamicType match
If we check the generated code
...
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof DynamicType.Default.Unloaded)) return false;
final Unloaded other = (Unloaded) o;
...
we can see that type name is not fully specified in cast operation. All other places of generated code use canonical class name.
Fixed in release 1.16.14. It's the 'you never encountered this bug' reference in the changelog :)
Cool, thank you!
Most helpful comment
Fixed in release 1.16.14. It's the 'you never encountered this bug' reference in the changelog :)