New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revisit MediaType ordering #27580
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Comments
poutsma
added
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
labels
Oct 19, 2021
poutsma
added a commit
to poutsma/spring-framework
that referenced
this issue
Oct 20, 2021
This commit makes several changes to MimeType and MediaType related to the topic of specificity. This commit deprecates the MimeType and MediaType Comparators. Comparators require a transitive relationship, and the desired order for these types is not transitive (see spring-projects#27488). Instead, this commit introduces two new MimeType methods: isMoreSpecific and isLessSpecific, both of which return booleans. MediaType overrides these methods to include the quality factor (q) in the comparison. All MediaType sorting methods have been deprecated in favor of MimeTypeUtils::sortBySpecificity. This sorting method now uses MimeType::isLessSpecific in combination a bubble sort algorithm (which does not require a transitive compare function). Closes spring-projectsgh-27580
poutsma
added a commit
to poutsma/spring-framework
that referenced
this issue
Oct 20, 2021
This commit changes all code that uses now deprecated methods in MimeType and MediaType. See spring-projectsgh-27580
poutsma
added a commit
to poutsma/spring-framework
that referenced
this issue
Oct 20, 2021
This commit makes several changes to MimeType and MediaType related to the topic of specificity. This commit deprecates the MimeType and MediaType Comparators. Comparators require a transitive relationship, and the desired order for these types is not transitive (see spring-projects#27488). Instead, this commit introduces two new MimeType methods: isMoreSpecific and isLessSpecific, both of which return booleans. MediaType overrides these methods to include the quality factor (q) in the comparison. All MediaType sorting methods have been deprecated in favor of MimeTypeUtils::sortBySpecificity. This sorting method now uses MimeType::isLessSpecific in combination a bubble sort algorithm (which does not require a transitive compare function). Closes spring-projectsgh-27580
poutsma
added a commit
to poutsma/spring-framework
that referenced
this issue
Oct 20, 2021
This commit changes all code that uses now deprecated methods in MimeType and MediaType. See spring-projectsgh-27580
poutsma
added a commit
to poutsma/spring-framework
that referenced
this issue
Oct 20, 2021
This commit makes several changes to MimeType and MediaType related to the topic of specificity. This commit deprecates the MimeType and MediaType Comparators. Comparators require a transitive relationship, and the desired order for these types is not transitive (see spring-projects#27488). Instead, this commit introduces two new MimeType methods: isMoreSpecific and isLessSpecific, both of which return booleans. MediaType overrides these methods to include the quality factor (q) in the comparison. All MediaType sorting methods have been deprecated in favor of MimeTypeUtils::sortBySpecificity. This sorting method now uses MimeType::isLessSpecific in combination a bubble sort algorithm (which does not require a transitive compare function). Closes spring-projectsgh-27580
poutsma
added a commit
to poutsma/spring-framework
that referenced
this issue
Oct 20, 2021
This commit changes all code that uses now deprecated methods in MimeType and MediaType. See spring-projectsgh-27580
poutsma
added a commit
to poutsma/spring-framework
that referenced
this issue
Oct 20, 2021
This commit makes several changes to MimeType and MediaType related to the topic of specificity. This commit deprecates the MimeType and MediaType Comparators. Comparators require a transitive relationship, and the desired order for these types is not transitive (see spring-projects#27488). Instead, this commit introduces two new MimeType methods: isMoreSpecific and isLessSpecific, both of which return booleans. MediaType overrides these methods to include the quality factor (q) in the comparison. All MediaType sorting methods have been deprecated in favor of MimeTypeUtils::sortBySpecificity. This sorting method now uses MimeType::isLessSpecific in combination a bubble sort algorithm (which does not require a transitive compare function). Closes spring-projectsgh-27580
poutsma
added a commit
to poutsma/spring-framework
that referenced
this issue
Oct 20, 2021
This commit changes all code that uses now deprecated methods in MimeType and MediaType. See spring-projectsgh-27580
poutsma
added a commit
that referenced
this issue
Nov 23, 2021
This commit changes all code that uses now deprecated methods in MimeType and MediaType. See gh-27580
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
We should reconsider the way we order
MediaType
objects. Currently we useComparator
s to sort media types in order of preference, but those need to be transitive (see #27488). We should investigate other ordering mechanisms for 6.0, possibly dropping the comparators altogether in favor of a less restrictive, though possibly slower, ordering algorithm.The text was updated successfully, but these errors were encountered: