Cleaned-up CLI commands.
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/DevicePortsListCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/DevicePortsListCommand.java
index e62fe56..1382896 100644
--- a/cli/src/main/java/org/onlab/onos/cli/net/DevicePortsListCommand.java
+++ b/cli/src/main/java/org/onlab/onos/cli/net/DevicePortsListCommand.java
@@ -8,7 +8,6 @@
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Comparator;
import java.util.List;
import static org.onlab.onos.net.DeviceId.deviceId;
@@ -26,14 +25,6 @@
required = false, multiValued = false)
String uri = null;
- private static final Comparator<Port> PORT_COMPARATOR = new Comparator<Port>() {
- @Override
- public int compare(Port p1, Port p2) {
- long delta = p1.number().toLong() - p2.number().toLong();
- return delta == 0 ? 0 : (delta < 0 ? -1 : +1);
- }
- };
-
@Override
protected void execute() {
DeviceService service = get(DeviceService.class);
@@ -55,7 +46,7 @@
protected void printDevice(DeviceService service, Device device) {
super.printDevice(service, device);
List<Port> ports = new ArrayList<>(service.getPorts(device.id()));
- Collections.sort(ports, PORT_COMPARATOR);
+ Collections.sort(ports, Comparators.PORT_COMPARATOR);
for (Port port : ports) {
print(FMT, port.number(), port.isEnabled() ? "enabled" : "disabled");
}