Closed siom79 closed 10 months ago
From https://github.com/siom79/japicmp/commit/a941c343cfddf2dbcb19b2d0281c1e6026e07b69#r128486069:
In case it was abstract and changed to static, then the Class C must have an implementation of the method (as it was abstract) and therefore it is still source compatible (
new C().doSomething()
calls the method inC
) and binary compatible (the method inC
gets called).
The problem here is though when the method is not called on the class C
but on a variable with the type of the interface I
:
I i = ...;
i.doSomething();
If doSomething()
is changed from abstract to static this causes
illegal static interface method call
IncompatibleClassChangeError: Expected instance not static method 'void I.doSomething()'
@Marcono1234 Got it. Thanks for pointing out.
Thanks for the changes!
METHOD_NON_STATIC_IN_INTERFACE_NOW_STATIC
has still JApiSemanticVersionLevel.MINOR
though. Is that intentional or should it rather be MAJOR
now?
Yes, you are right again. :smile: And then we don't need METHOD_DEFAULT_NOW_STATIC
, too.
Released with 0.18.1
see discussion in https://github.com/siom79/japicmp/commit/a941c343cfddf2dbcb19b2d0281c1e6026e07b69#r128449820