Re: JSR311: hashCode and equals mismatch for MediaType

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 09 Mar 2009 12:10:19 -0400

On Mar 9, 2009, at 11:50 AM, Bill Burke wrote:
>>> If you agree with #1, the "q" parameter should be extracted from
>>> the parameter map of MediaType when it is created. When a "q"
>>> parameter exists it should be stored as a specific attribute
>>> within MediaType. i.e. float MediaType.getAcceptQualifier().
>>> Since q value is never extracted, this makes it very difficult to
>>> use MediaTypes created from an Accept header and use as keys to a
>>> Map.
>> Are you suggesting to remove the q parameter from consideration in
>> the equals and hashCode methods. I.e. a q-value wouldn't be part of
>> the map returned from getParameters ?
> Yes and also remove it altogether from the parameter map. Also have
> a specific attribute on MediaType.
> float getAcceptQualifier()
Could you add an issue to keep track of this. The 1.1 MR review period
ended last week so its too late to include this in 1.1 but we can look
at it for 1.2 (though we don't currently have a plan for that).