users@jsr311.java.net

declared return-type ignored for selection of MessageBodyWriter?

From: Reto Bachmann-Gmür <reto_at_gmuer.ch>
Date: Mon, 29 Sep 2008 16:04:59 +0200

Hello

Rereading section 4.2.2 I'm insecure if its correct to look at the
declared return type of a method (for those that are not Response or
GenericEntity) for selecting the MessageBodyWriter.

Currently I'm passing the type of the object returned at runtime as the
"type" argument to Providers.getMessageBodyWriter and the declared
return type as genericType.

Does "for other return types it is the returned object." (section 4.2.2)
means that only the class of the object returned at runtime is to be
considered?

Issue 46 I think would be easier to solve looking at the declared
return-type only, but currently it would be most useful to consider both.

Cheers,
reto