jsr370-experts@jax-rs-spec.java.net

AW: Re: [jax-rs-spec users] Proposal for small API change: Make MessageBodyWriter.getSize a default method

From: Markus Karg <markus_at_headcrashing.eu>
Date: Wed, 17 Feb 2016 22:52:17 +0100

Done. Please see #527 :-)

Marek Potociar <marek.potociar_at_oracle.com> hat geschrieben:

Hi Markus,

This is certainly worth considering. Please can you open a new issue in Jira to track this enhancement?

Thank you,
Marek
On 04 Feb 2016, at 19:39, Markus KARG <markus_at_headcrashing.eu> wrote:

Experts,
 
I'd like to propose a late but very tiny API change and I hope you all agree with me. :-)
 
As JAX-RS 2.1 targets Java 8, we can get rid of the useless MessageBodyWrite.getSize method in implementations if we simply turn it into a default method in the API which returns -1 always. By doing this real no-brainener in the API, all MessageBodyWriter implementation classes can simply omit that method completey. In the end, cases like this are what Java 8 default methods are really good for… :-)
 
I think this is such simple, easy and risk-free that we really should do it!
 
-Markus