[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[aspectj-users] Issue with generics
|
Hello,
I have a problem that I tried boiling down to as small a code sample as
possible. The following gives me the error "The method
instanceOf(Class<? extends Object>) is ambiguous for the type MyObject"
on the "instanceOf" method call in the main method:
public aspect MyAspect
{
public interface MyInterface
{
public boolean instanceOf(Class<? extends Object> c);
}
declare parents: MyObject implements MyInterface;
public boolean MyInterface.instanceOf(Class<? extends Object> c)
{
return c.isInstance(this);
}
}
class MyObject
{
}
class Main
{
public static void main(String[] args)
{
new MyObject().instanceOf(Object.class);
}
}
First, I wonder if this fails to compile for everyone or if it is just
me. Second, since I suspect I may have a compatibility issue, here are
my specs:
* Mac OS X 10.4 Tiger
* Eclipse Galileo
* Mac OS X JavaVM 1.5.0 (J2SE-1.5)
* AspectJ 1.6.6
If the problem is with the code, I'd like to know the "better" way to
accomplish the above.
I would appreciate any help you could give,
-Michel