Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void doEviction(List<EntryCache> caches, long sizeToFree) {
checkArgument(sizeToFree > 0);
checkArgument(!caches.isEmpty());

Collections.sort(caches, reverseOrder());
caches.sort(reverseOrder());

long totalSize = 0;
for (EntryCache cache : caches) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.net.MalformedURLException;
import java.net.URI;
import java.util.Collections;
import java.util.List;
import java.util.Set;

Expand Down Expand Up @@ -207,7 +206,7 @@ protected List<String> getListOfNamespaces(String property) throws Exception {
}
}

Collections.sort(namespaces);
namespaces.sort(null);
return namespaces;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public List<String> getNamespacesForCluster(@PathParam("property") String proper
throw new RestException(e);
}

Collections.sort(namespaces);
namespaces.sort(null);
return namespaces;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public List<String> getList(@PathParam("property") String property, @PathParam("
throw new RestException(e);
}

Collections.sort(destinations);
destinations.sort(null);
return destinations;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public List<String> getProperties() {

try {
List<String> properties = globalZk().getChildren(path("policies"), false);
Collections.sort(properties);
properties.sort(null);
return properties;
} catch (Exception e) {
log.error("[{}] Failed to get properties list", clientAppId(), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ public List<String> getListOfDestinations(String property, String cluster, Strin
// NoNode means there are no persistent topics for this namespace
}

Collections.sort(destinations);
destinations.sort(null);
return destinations;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public PersistentDispatcherSingleActiveConsumer(ManagedCursor cursor, SubType su
private void pickAndScheduleActiveConsumer() {
checkArgument(!consumers.isEmpty());

Collections.sort(consumers, (c1, c2) -> c1.consumerName().compareTo(c2.consumerName()));
consumers.sort((c1, c2) -> c1.consumerName().compareTo(c2.consumerName()));

int index = partitionIndex % consumers.size();
Consumer prevConsumer = activeConsumer.getAndSet(consumers.get(index));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ public void testCreateNamespaces() throws Exception {
public void testGetNamespaces() throws Exception {
List<String> expectedList = Lists.newArrayList(this.testLocalNamespaces.get(0).toString(),
this.testLocalNamespaces.get(1).toString());
Collections.sort(expectedList);
expectedList.sort(null);
assertEquals(namespaces.getNamespacesForCluster(this.testProperty, this.testLocalCluster), expectedList);
expectedList = Lists.newArrayList(this.testLocalNamespaces.get(0).toString(),
this.testLocalNamespaces.get(1).toString(), this.testLocalNamespaces.get(2).toString(),
this.testGlobalNamespaces.get(0).toString());
Collections.sort(expectedList);
expectedList.sort(null);
assertEquals(namespaces.getPropertyNamespaces(this.testProperty), expectedList);

try {
Expand Down Expand Up @@ -620,7 +620,7 @@ public void testDeleteNamespaces() throws Exception {
namespaces.deleteNamespace(testNs.getProperty(), testNs.getCluster(), testNs.getLocalName(), false);
List<String> nsList = Lists.newArrayList(this.testLocalNamespaces.get(1).toString(),
this.testLocalNamespaces.get(2).toString());
Collections.sort(nsList);
nsList.sort(null);
assertEquals(namespaces.getPropertyNamespaces(this.testProperty), nsList);

testNs = this.testLocalNamespaces.get(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,21 +253,21 @@ public void testIteration() {
map.put(2, "two");

List<Long> keys = map.keys();
Collections.sort(keys);
keys.sort(null);
assertEquals(keys, Lists.newArrayList(0l, 1l, 2l));

List<String> values = map.values();
Collections.sort(values);
values.sort(null);
assertEquals(values, Lists.newArrayList("one", "two", "zero"));

map.put(1, "uno");

keys = map.keys();
Collections.sort(keys);
keys.sort(null);
assertEquals(keys, Lists.newArrayList(0l, 1l, 2l));

values = map.values();
Collections.sort(values);
values.sort(null);
assertEquals(values, Lists.newArrayList("two", "uno", "zero"));

map.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,21 +239,21 @@ public void testIteration() {
map.put(2l, "two");

List<Long> keys = map.keys();
Collections.sort(keys);
keys.sort(null);
assertEquals(keys, Lists.newArrayList(0l, 1l, 2l));

List<String> values = map.values();
Collections.sort(values);
values.sort(null);
assertEquals(values, Lists.newArrayList("one", "two", "zero"));

map.put(1l, "uno");

keys = map.keys();
Collections.sort(keys);
keys.sort(null);
assertEquals(keys, Lists.newArrayList(0l, 1l, 2l));

values = map.values();
Collections.sort(values);
values.sort(null);
assertEquals(values, Lists.newArrayList("two", "uno", "zero"));

map.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public void testIteration() {
set.add(2l);

List<Long> values = set.values();
Collections.sort(values);
values.sort(null);
assertEquals(values, Lists.newArrayList(0l, 1l, 2l));

set.clear();
Expand All @@ -244,14 +244,14 @@ public void testRemoval() {
set.add(7);

List<Integer> values = set.values();
Collections.sort(values);
values.sort(null);
assertEquals(values, Lists.newArrayList(0, 1, 3, 6, 7));

int numOfItemsDeleted = set.removeIf(i -> i < 5);
assertEquals(numOfItemsDeleted, 3);
assertEquals(set.size(), values.size() - numOfItemsDeleted);
values = set.values();
Collections.sort(values);
values.sort(null);
assertEquals(values, Lists.newArrayList(6, 7));
}

Expand Down