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/BgpRoute.java b/src/main/java/net/onrc/onos/apps/bgproute/BgpRoute.java
index 91ac959..a1258ff 100644
--- a/src/main/java/net/onrc/onos/apps/bgproute/BgpRoute.java
+++ b/src/main/java/net/onrc/onos/apps/bgproute/BgpRoute.java
@@ -92,7 +92,7 @@
private String configFilename = "config.json";
private static final short ARP_PRIORITY = 20;
-
+
// The fields below are unused after the move to FlowManager.
// Remove them if no longer needed.
/*
@@ -403,17 +403,17 @@
public void processRibAdd(RibUpdate update) {
synchronized (this) {
Prefix prefix = update.getPrefix();
-
+
log.debug("Processing prefix add {}", prefix);
-
+
RibEntry rib = ptree.put(prefix, update.getRibEntry());
-
+
if (rib != null && !rib.equals(update.getRibEntry())) {
// There was an existing nexthop for this prefix. This update supersedes that,
// so we need to remove the old flows for this prefix from the switches
_processDeletePrefix(prefix, rib);
}
-
+
if (update.getRibEntry().getNextHop().equals(
InetAddresses.forString("0.0.0.0"))) {
// Route originated by SDN domain
@@ -422,7 +422,7 @@
update.getRibEntry().getNextHop().getHostAddress());
return;
}
-
+
_processRibAdd(update);
}
}
@@ -588,7 +588,7 @@
public void processRibDelete(RibUpdate update) {
synchronized (this) {
Prefix prefix = update.getPrefix();
-
+
if (ptree.remove(prefix, update.getRibEntry())) {
/*
* Only delete flows if an entry was actually removed from the trie.
@@ -1163,7 +1163,7 @@
// TODO: Fix the code below after topoSwitchSerice was removed
/*
for (String dpid : switches) {
-
+
Iterator<ISwitchObject> activeSwitches = topoSwitchService.
getActiveSwitches().iterator();
while(activeSwitches.hasNext())
@@ -1177,7 +1177,6 @@
return;
}
}
-
}
switchesConnected = true;
*/
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) {
diff --git a/src/main/java/net/onrc/onos/apps/bgproute/Ptree.java b/src/main/java/net/onrc/onos/apps/bgproute/Ptree.java
index b34364b..f85c49c 100644
--- a/src/main/java/net/onrc/onos/apps/bgproute/Ptree.java
+++ b/src/main/java/net/onrc/onos/apps/bgproute/Ptree.java
@@ -7,7 +7,7 @@
* the Ptree as they contain data fundamental to the structure of the tree.
* You should put RIB entries in and get RIB entries out.
* Also we need to get rid of the referencing scheme to determine when to delete nodes.
- * Deletes should be explicit, and there's no need to keep track of references if
+ * Deletes should be explicit, and there's no need to keep track of references if
* we don't leak them out the the Ptree.
*/
public class Ptree {
diff --git a/src/main/java/net/onrc/onos/apps/bgproute/RestClient.java b/src/main/java/net/onrc/onos/apps/bgproute/RestClient.java
index 3164945..e0976cc 100644
--- a/src/main/java/net/onrc/onos/apps/bgproute/RestClient.java
+++ b/src/main/java/net/onrc/onos/apps/bgproute/RestClient.java
@@ -17,7 +17,7 @@
private RestClient() {
// Private constructor to prevent instantiation
}
-
+
public static String get(String str) {
StringBuilder response = new StringBuilder();
diff --git a/src/main/java/net/onrc/onos/apps/bgproute/RibUpdate.java b/src/main/java/net/onrc/onos/apps/bgproute/RibUpdate.java
index c9d48e7..58ebdf1 100644
--- a/src/main/java/net/onrc/onos/apps/bgproute/RibUpdate.java
+++ b/src/main/java/net/onrc/onos/apps/bgproute/RibUpdate.java
@@ -4,7 +4,7 @@
private final Operation operation;
private final Prefix prefix;
private final RibEntry ribEntry;
-
+
public enum Operation {
UPDATE,
DELETE
diff --git a/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java b/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
index 805e657..4691149 100644
--- a/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
+++ b/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
@@ -534,7 +534,7 @@
}
// BroadcastPacketOutNotification key =
-// new BroadcastPacketOutNotification(eth.serialize(),
+// new BroadcastPacketOutNotification(eth.serialize(),
// target, sw.getId(), pi.getInPort());
// broadcastPacketOutEventChannel.addTransientEntry(eth.getDestinationMAC().toLong(), key);
} else {