-
Feature Request
-
Resolution: Done
-
Major
-
2.1.0
-
None
If a call to an interface method is included in a rule body Byteman may fail to type check it correctly, notifying an invalid method error (it probably should say unknown method but anyway ...). This only happens in a specific case where the class which implements the interface is abstract and so does not actually include an implementation method.
As an example, assume
interface I
{ public void foo(); }abstract class Foo implements I { public void test()
{ ... } }class Bar extends Foo { public void foo() { ... }
}
and then let the rule be
RULE bad method check
CLASS Foo
METHOD test
IF TRUE
DO $0.foo()
ENDRULE
Method foo is only looked for via classes Foo and Object. Since neither of them implements foo() the lookup fails. However, foo() should also be searched for via interface I (and then also executed via the Method instance defined by that interface).