I think it's a bug. I created a JUnit test here to demonstrate it:

http://pastebin.com/xfvC6y2a

The two resource hierarchies are identical except that in one case the
@Post annotation is on the generic version of the method and in the other
it isn't. That's enough to confuse the machinery in AnnotationInfo,
specifically this code:

        // From AnnotationInfo, with index == 0 at run time:
        return getJavaActualType(
            method.getParameterTypes()[index],
            method.getGenericParameterTypes()[index]);

The private method getJavaActualType has a complicated implementation that
I don't have time to follow, but the upshot is that the @Post on the
generic method causes a null to be returned, which turns into an internal
server error.

--tim

On Wed, Jan 25, 2012 at 6:20 AM, Dencel <[email protected]> wrote:

> If you use an annotated interface like
> [CODE]
> interface CRUDHandler<T extends Request>{
>
>    @Post
>    public Object handlePost(T request);
> }
> [/CODE]
>
> Parameter conversion does not work, because Restlet can't figure out T. It
> should find it on the implementing class, but Restlet uses the interface to
> resolve the actual parameter.
>
> @See AnnotationInfo
>
>
> I don't know if this is a bug or a missing feature.
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2910995
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2911101

Reply via email to