This post originated from an RSS feed registered with Agile Buzz
by Ryan Ransford.
Original Post: Java Problem: Generic Inheritance and Calling GetMethod().getReturnType()
Feed Title: Active-Active Configuration
Feed URL: http://active-active.blogspot.com/feeds/posts/default
Feed Description: Active-Active Configuration is a blog about making my place in the enterprise world better. This blog is primarily focused on Java articles, but be prepared to be challenged by posts about dynamic languages, agile tools, and the lighter side of geek culture.
In my current project, I have classes which are modeled like the following. At some point, a method like getReturnTypeForGetId() is called on classes A and B. Calling the method with A returns Integer as expected, but B returns Serializable.
What am I missing here? Am I getting bitten by some heinous erasure thing, or am I just missing out on some sort of generic context-clobbering?
EDIT: Adding an over-ridden getId() method to B fixes the problem, but I would still like to understand what I am running into.