Enable checkstyle trailing spaces rule
Enable the checkstyle rule that detects unneeded trailing spaces
and fix the violations of the rule.
Change-Id: I65567c87142c5a257f0230a55bc4376e770d416f
diff --git a/src/main/java/net/onrc/onos/apps/bgproute/FlowCache.java b/src/main/java/net/onrc/onos/apps/bgproute/FlowCache.java
index 5341e1d..305cc87 100644
--- a/src/main/java/net/onrc/onos/apps/bgproute/FlowCache.java
+++ b/src/main/java/net/onrc/onos/apps/bgproute/FlowCache.java
@@ -25,7 +25,7 @@
private final Map<Long, List<OFFlowMod>> flowCacheMap;
- private final Comparator<OFFlowMod> cookieComparator =
+ private final Comparator<OFFlowMod> cookieComparator =
new Comparator<OFFlowMod>() {
@Override
public int compare(OFFlowMod fm1, OFFlowMod fm2) {
@@ -58,9 +58,9 @@
public void write(long dpid, List<OFFlowMod> flowMods) {
synchronized (this) {
ensureCacheForSwitch(dpid);
-
+
List<OFFlowMod> clones = new ArrayList<OFFlowMod>(flowMods.size());
-
+
// Somehow the OFFlowMods we get passed in will change later on.
// No idea how this happens, but we can just clone to prevent problems
try {
@@ -70,19 +70,19 @@
} catch (CloneNotSupportedException e) {
log.debug("Clone exception", e);
}
-
+
flowCacheMap.get(dpid).addAll(clones);
-
+
IOFSwitch sw = floodlightProvider.getSwitches().get(dpid);
-
+
if (sw == null) {
log.debug("Switch not found when writing flow mods");
return;
}
-
+
List<OFMessage> msgList = new ArrayList<OFMessage>(clones.size());
msgList.addAll(clones);
-
+
try {
sw.write(msgList, null);
} catch (IOException e) {
@@ -102,28 +102,28 @@
public void delete(long dpid, List<OFFlowMod> flowMods) {
synchronized (this) {
ensureCacheForSwitch(dpid);
-
+
// Remove the flow mods from the cache first before we alter them
flowCacheMap.get(dpid).removeAll(flowMods);
-
+
// Alter the original flow mods to make them delete flow mods
for (OFFlowMod fm : flowMods) {
fm.setCommand(OFFlowMod.OFPFC_DELETE_STRICT)
.setOutPort(OFPort.OFPP_NONE)
.setLengthU(OFFlowMod.MINIMUM_LENGTH);
-
+
fm.getActions().clear();
}
-
+
IOFSwitch sw = floodlightProvider.getSwitches().get(dpid);
if (sw == null) {
log.debug("Switch not found when writing flow mods");
return;
}
-
+
List<OFMessage> msgList = new ArrayList<OFMessage>(flowMods.size());
msgList.addAll(flowMods);
-
+
try {
sw.write(msgList, null);
} catch (IOException e) {
@@ -135,18 +135,18 @@
public void switchConnected(IOFSwitch sw) {
synchronized (this) {
log.debug("Switch connected: {}", sw);
-
+
ensureCacheForSwitch(sw.getId());
-
+
List<OFFlowMod> flowMods = flowCacheMap.get(sw.getId());
-
+
Collections.sort(flowMods, cookieComparator);
-
+
sw.clearAllFlowMods();
-
+
List<OFMessage> messages = new ArrayList<OFMessage>(flowMods.size());
messages.addAll(flowMods);
-
+
try {
sw.write(messages, null);
} catch (IOException e) {