restlet/restlet-framework-java — pull request #652 by adennie (2012-09-06 19:50:40+00:00)
Title: fix issue 559 - (strict conneg should evaluate media type parameters)

[Note: this pull request replaces a previous one.]

1) Added method
MediaType.includes(Metadata included, boolean ignoreParameters)
which is similar to the prior
MediaType.includes(Metadata included)
but includes the following logic:
If ignoreParameters is true, behave as before. Otherwise, loop
through the media type parameters of "this". Consider "this" to
include "included" iff for each param name/value pair in "this", "included"
contains the same name/value.
2) Changed the prior MediaType.includes(Metadata included) method so that it
passes through to the new method, supplying true for the 2nd argument and
thus maintaining the original behavior for callers of that method signature.

3) Replaced the implementation of
StrictConneg.scoreMediaType(MediaType mediaType) with code copied from
scoreMetadata(T, List>), modified slightly to pass false
for the new 2nd argument to MediaType.includes(). Thus, under strict
content negotiation, media type parameters will be considered in the
inclusion test.

Also added unit tests for new MediaType.includes() functionality.