|
@@ -25,6 +25,7 @@ package com.dmdirc.updater.manager;
|
25
|
25
|
import com.dmdirc.updater.UpdateComponent;
|
26
|
26
|
import com.dmdirc.updater.checking.CheckResultConsolidator;
|
27
|
27
|
|
|
28
|
+import java.util.Comparator;
|
28
|
29
|
import java.util.Map;
|
29
|
30
|
import java.util.concurrent.ConcurrentSkipListMap;
|
30
|
31
|
import java.util.concurrent.Executor;
|
|
@@ -41,7 +42,7 @@ public class CachingUpdateManagerImpl extends UpdateManagerImpl implements Cachi
|
41
|
42
|
|
42
|
43
|
/** Map of component to their most recent status. */
|
43
|
44
|
private final Map<UpdateComponent, UpdateStatus> cachedStatuses
|
44
|
|
- = new ConcurrentSkipListMap<UpdateComponent, UpdateStatus>();
|
|
45
|
+ = new ConcurrentSkipListMap<UpdateComponent, UpdateStatus>(new UpdateComponentComparator());
|
45
|
46
|
|
46
|
47
|
/** Our current status. */
|
47
|
48
|
@Getter
|
|
@@ -139,4 +140,17 @@ public class CachingUpdateManagerImpl extends UpdateManagerImpl implements Cachi
|
139
|
140
|
|
140
|
141
|
}
|
141
|
142
|
|
|
143
|
+ /**
|
|
144
|
+ * Comparator which compares components based on their name.
|
|
145
|
+ */
|
|
146
|
+ private static class UpdateComponentComparator implements Comparator<UpdateComponent> {
|
|
147
|
+
|
|
148
|
+ /** {@inheritDoc} */
|
|
149
|
+ @Override
|
|
150
|
+ public int compare(final UpdateComponent o1, final UpdateComponent o2) {
|
|
151
|
+ return o1.getName().compareTo(o2.getName());
|
|
152
|
+ }
|
|
153
|
+
|
|
154
|
+ }
|
|
155
|
+
|
142
|
156
|
}
|