IT博客汇
首页
精华
技术
设计
资讯
扯淡
权利声明
登录
注册
Java项目运行一段时间后报错 Comparison method violates its general contract
Wizzer
发表于
2024-07-09 02:23:53
love
0
错误代码: children.sort((o1, o2) -> (int) (o2.getLong("createdAt", 0) - o1.getLong("createdAt", 0))); 修复后: children.sort((o1, o2) -> Long.compare(o2.getLong("createdAt", 0), o1.getLong("createdAt", 0)));
Continue Reading