Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] ecj output of Elements.getAllMembers() differs from javac

Hello everyone,

I am currently writing an annotation processor for classes that use generics. Since I am new to APT and am not sure whether this is an actual issue I am asking here first.

Given the following interfaces:

interface Test2<T extends java.io.Serializable> { String test(T test); }
interface Test extends Test2<Long> { }

Calling Elements.getAllMembers() on Test's TypeElement in javac returns:

String test(T)

In ecj it returns:

String test(String)

Is this the intended behavior?

I realize that ecj's output is "more correct" but javac's output can be later used for reflection. E.g. calling getMethod with a String argument type doesn't work due to type erasure.

Am I using the wrong method? Should I traverse the supertypes "manually" instead?

If required I can upload some test code to github that demonstrates this.

Thanks in advance,

Arlo

--
Arlo O'Keeffe

Back to the top