Code cleaning
Change-Id: I9c32de6a3c36820fe54651cd5d9ccabc394fd0cb
diff --git a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphImpl.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphImpl.java
index 0b836c3..b821050 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/NetworkGraphImpl.java
@@ -704,13 +704,13 @@
// Attached Ports' Parent Switch must exist
Switch sw = getSwitch(swp.dpid);
if ( sw == null ) {
- log.warn("Switch {} for the attachment point did not exist. skipping mutation", sw);
+ log.warn("Switch for the attachment point {} did not exist. skipping mutation", swp);
continue;
}
// Attached Ports must exist
Port port = sw.getPort(swp.number);
if ( port == null ) {
- log.warn("Port {} for the attachment point did not exist. skipping mutation", port);
+ log.warn("Port for the attachment point {} did not exist. skipping mutation", swp);
continue;
}
// Attached Ports must not have Link
@@ -770,13 +770,13 @@
// Attached Ports' Parent Switch must exist
Switch sw = getSwitch(swp.dpid);
if ( sw == null ) {
- log.warn("Switch {} for the attachment point did not exist. skipping attachment point mutation", sw);
+ log.warn("Switch for the attachment point {} did not exist. skipping attachment point mutation", swp);
continue;
}
// Attached Ports must exist
Port port = sw.getPort(swp.number);
if ( port == null ) {
- log.warn("Port {} for the attachment point did not exist. skipping attachment point mutation", port);
+ log.warn("Port for the attachment point {} did not exist. skipping attachment point mutation", swp);
continue;
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/SwitchImpl.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/SwitchImpl.java
index 874bf37..97e9004 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/SwitchImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/SwitchImpl.java
@@ -76,13 +76,13 @@
// TODO Should switch also store a list of attached devices to avoid
// calculating this every time?
List<Device> devices = new ArrayList<Device>();
-
+
for (Port port : ports.values()) {
for (Device device : port.getDevices()) {
devices.add(device);
}
}
-
+
return devices;
}
@@ -101,11 +101,12 @@
return port;
}
+ // XXX Do we still need this method?
public void store() {
RCSwitch rcSwitch = new RCSwitch(dpid);
for (Port port : ports.values()) {
- RCPort rcPort = new RCPort(dpid, (long)port.getNumber());
+ RCPort rcPort = new RCPort(dpid, port.getNumber());
rcSwitch.addPortId(rcPort.getId());
}