the following test fails:
import javax.swing.*
interface ISub extends Action {}
class Super extends AbstractAction {}
class Sub extends AbstractAction implements ISub {}
static String foo(Action x) { "super" }
static String foo(ISub x) { "sub" }
def result = [new Super(), new Sub()].collect { foo(it) }
assert ["super","sub"] == result // result is ["super","super"]
The special thing here is that Action is a Java interface. If you use
a Groovy interface instead, all works fine.
I just wrote up a similar bug - http://jira.codehaus.org/browse/GROOVY-2719