提交 268ea2f0 编写于 作者: G Gao Hongtao 提交者: wu-sheng

Fix #1127 Comparison method violates its general contract (#1129)

上级 a12bae59
...@@ -78,7 +78,7 @@ public class ApplicationMetricEsUIDAO extends EsDAO implements IApplicationMetri ...@@ -78,7 +78,7 @@ public class ApplicationMetricEsUIDAO extends EsDAO implements IApplicationMetri
applicationThroughputList.add(applicationThroughput); applicationThroughputList.add(applicationThroughput);
}); });
applicationThroughputList.sort((first, second) -> first.getCpm() > second.getCpm() ? -1 : 1); applicationThroughputList.sort((first, second) -> Integer.compare(second.getCpm(), first.getCpm()));
if (applicationThroughputList.size() <= topN) { if (applicationThroughputList.size() <= topN) {
return applicationThroughputList; return applicationThroughputList;
......
...@@ -84,7 +84,7 @@ public class InstanceMetricEsUIDAO extends EsDAO implements IInstanceMetricUIDAO ...@@ -84,7 +84,7 @@ public class InstanceMetricEsUIDAO extends EsDAO implements IInstanceMetricUIDAO
appServerInfoList.add(appServerInfo); appServerInfoList.add(appServerInfo);
}); });
appServerInfoList.sort((first, second) -> first.getCpm() > second.getCpm() ? -1 : 1); appServerInfoList.sort((first, second) -> Integer.compare(second.getCpm(), first.getCpm()));
if (appServerInfoList.size() <= topN) { if (appServerInfoList.size() <= topN) {
return appServerInfoList; return appServerInfoList;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册