-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
fix: compartor exception in post list #2854
Conversation
@guqing: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/kind bug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bugfix
/area core
What this PR does / why we need it:
修复文章列表查询时的类型转换错误
文章列表查询将 collectList 错写为 collectSortedList 导致此
Contributor cannot be cast to class java.lang.Comparable
,collectSortedList 会使用
Arrays.sort(a, (Comparator) c)
,这需要目标类实现 Comparable 才行,而此处并不需要自然排序。Which issue(s) this PR fixes:
Fixes #2830
Special notes for your reviewer:
此 bug 的复现方式为:
编辑一篇文章保存后,在使用另一个用户账户编辑此文章并发布就会出现,而使用此 PR 后问题消失,此问题只对 Contributor 这个类型有效它不是自定义模型类,而 Tag 和 Category 都是自定义模型 继承了 AbstractExtension 而它 实现了 Comparable 接口。
/cc @halo-dev/sig-halo
Does this PR introduce a user-facing change?