Thanks for the detailed explanation with example. Now I understand the
difference between binary vs source backward compatibility.

The type change would have been source compatible where existing
applications would have to recompile  (without any code changes) to run
with the new version?

So yes, we cannot change Complex type to interface to maintain binary
runtime compatibility

I assume, binary compatibility would be maintained if we add additional
interfaces with new methods to Complex class?

For example, we should be ok if we add  a new ComplexDouble interface with
possibly new methods to Complex class?



On Fri, Jun 10, 2022, 20:45 Alex Herbert <alex.d.herb...@gmail.com> wrote:

>
> > These are expected changes... Is there a compatibility issue here?
> >
>
> Yes. These are reported as errors.
>
> This is the main issue:
>
> https://revapi.org/revapi-java/differences.html#java.class.kindChanged
>
> Changing a class to an interface. In this case methods on the object are
> invoked using a different instruction.
>

So if you change class A to an interface then Test will have a runtime
> linkage error as it cannot find the method
>

Thus we have to keep Complex as a class.
>

Reply via email to