RE: method signature specificity when using interface types
this is an old email re-posted by the list server, please
i looked into the source and found my answer, beanshell
throws away the return type after executing the java method.
it looks like it would be fairly simple to track this
type information in the future by adding the return type to a global hash
for a given object reference.
this would allow for improved specificity when
resolving method calls.
[mailto:[hidden email]] On Behalf Of Chris
Greener Sent: Friday, November 04, 2005 8:34 AM To:[hidden email] Subject: [Beanshell-users]
method signature specificity when using interface types
Friends, I'm seeing an issue with beanshell choosing the wrong method
signatures when using interface types.
If the following java code below is called from beanshell it seems to
incorrectly select the wrong display method signature. see output below
Another issue I'm seeing (not illustrated here) is when methods have
ambiguous java signatures, beanshell executes the first method it finds.
This still happens even if the method call is explicitly typed from
I'm trying to understand the extent of these issue and any workarounds. I'm
maily concerned by the first issue as our interface implementations are broad
and its somewhat difficult to detect when this happens. I first
noticed this when application behaviour changed as method order
in the compiled java source changed.
output from below
java IFoo shell IFoo2 // this is incorrect - should
have used method signature with IFoo java IFoo2 shell IFoo2