Issue Details (XML | Word | Printable)

Key: JERSEY-1699
Type: Bug Bug
Status: Resolved Resolved
Resolution: Duplicate
Priority: Blocker Blocker
Assignee: Miroslav Fuksa
Reporter: jan.supol
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

Return type GenericEntity passes unexpected GenericType to MessageBodyWriter

Created: 04/Feb/13 06:40 PM   Updated: 29/May/13 01:32 PM   Resolved: 29/May/13 01:32 PM
Component/s: core
Affects Version/s: 2.0-m12
Fix Version/s: 2.0-rc1, 2.0

Time Tracking:
Not Specified

Issue Links:

Participants: jan.supol and Miroslav Fuksa

 Description  « Hide

Spec. Section 3.3.3 says:

The return type of a resource method and the type of the returned instance are used to determine the
raw type and generic type supplied to the isWritable method of MessageBodyWriter as follows:

Return Type Returned Instance Raw Type Generic Type
GenericEntity GenericEntity<List<String>> ArrayList<?> List<String>

but resource method:

	public GenericEntity<LinkedList<String>> checkGeneric() {
		LinkedList<String> list = new LinkedList<String>();
		GenericEntity<LinkedList<String>> gells;
		gells = new GenericEntity<LinkedList<String>>(list, List.class);
		return gells;

will pass to MessageBodyWriter<Collection<?>>#isWritable(Class<?> type, Type genericType,
Annotation[] annotations, MediaType mediaType)
genericType ==<java.util.LinkedList<java.lang.String>>

Miroslav Fuksa added a comment - 14/Mar/13 11:45 PM - edited

duplicate to JERSEY-1563: these issues describe the same problem.

Miroslav Fuksa added a comment - 15/Mar/13 03:50 PM

closing as a duplication to jersey-1563 which is fixed.