Details
-
Bug
-
Resolution: Done
-
Major
-
3.0.24.Final, 3.1.4.Final
-
None
Description
If a superclass with generic type parameters of a root resource contains resource methods with generic type parameters and JAX-RS Annotations, the JAX-RS annotations are not used.
This case should be within the scope of the JAX-RS Annotation inheritance specification.
The issue lies within the discovery process of overridden methods in superclasses / interfaces which does not resolve generic type arguments to actual types at runtime.
The current discovery process for overridden methods iterates over all superclasses and interfaces and looks for methods with the same function signature. But because of type erasure the overridden method presents the generic parameters as Object which does not match the specific type of the implemented method at runtime.
As a solution generic type parameters in method signatures have to be resolved in the course of the annotation inheritance discovery process.
https://github.com/resteasy/Resteasy/blob/3.0/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java#L342
https://github.com/resteasy/Resteasy/blob/3.0/resteasy-jaxrs/src/main/java/org/jboss/resteasy/spi/metadata/ResourceBuilder.java#L794