Thanks Lance, you're correct of course.
Michael, as this is still relevant to you, could you please update the "Affects Version/s:" field of your JIRA issue (TAP5-1213) accordingly?


Am 13.05.2014 11:38, schrieb Lance Java:
No, there is no way to access the generic type, this information is lost
during the compilation process.

That's not actually correct. Lets consider the following class:

public class MyClass {
    private List<Foo> foos;

    public List<Bar> getBars() {
       ...
    }

    public void doStuffWithBaz() {
       List<Baz> bazs = new ArrayList<Baz>();
       ...
    }
}

In this example, the ONLY generic that will be lost after compilation (due
to type erasure) is Baz. Both Foo and Bar ARE available at runtime.

@see
http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html#getGenericReturnType()
http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Field.html#getGenericType()



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tapestry.apache.org
For additional commands, e-mail: dev-h...@tapestry.apache.org

Reply via email to