users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] readEntity() question (relates to TCK)

From: Bill Burke <bburke_at_redhat.com>
Date: Wed, 08 May 2013 06:18:17 -0400

Say you do an abortWith() in a ClientRequestFilter

ctx.abortWith(Response.ok(new Integer(42)).build());


This should fail shouldn't it?

String val = response.readEntity(String.class);

why?

Firstly, is the response supposed to *buffer* the Integer object? I
don't remember ever agreeing to this requirement. IMO, this should fail
because the underlying entity's Java type is not String. Even so,
there's also no default provider that turns Integer of type */* into a
raw byte array, nor a provider that unmarshals a raw byte array into a
String.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com