During an override, you can change the return type (if the new return type is a subclass of the old return type).
For instance:
public class A {
public Number getNumber() { } ;
}
public class B extends A {
@Override
public Integer getNumber() { } ;
}
In your example, super.getDescriptor()it can always return an object DescriptorImpl, so you can override this method to avoid being injected into your code.
Nizil source
share