From b77a9c5a8e9308de80b9f25682557cc2ecc4a2ba Mon Sep 17 00:00:00 2001 From: Christian Dupuis Date: Thu, 22 May 2014 13:16:59 +0200 Subject: [PATCH] Remove List.sort usage for Collections.sort --- .../boot/actuate/health/OrderedHealthAggregator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/OrderedHealthAggregator.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/OrderedHealthAggregator.java index 68adf7f1a4..db37ecebf9 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/OrderedHealthAggregator.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/OrderedHealthAggregator.java @@ -18,6 +18,7 @@ package org.springframework.boot.actuate.health; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; @@ -61,13 +62,13 @@ public class OrderedHealthAggregator implements HealthAggregator { return Status.UNKOWN; } - status.sort(new Comparator() { + Collections.sort(status, new Comparator() { @Override public int compare(Status s1, Status s2) { return Integer.valueOf( OrderedHealthAggregator.this.statusOrder.indexOf(s1.getCode())).compareTo( - Integer.valueOf(OrderedHealthAggregator.this.statusOrder.indexOf(s2.getCode()))); + Integer.valueOf(OrderedHealthAggregator.this.statusOrder.indexOf(s2.getCode()))); } });