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/conf/checkstyle/sun_checks.xml b/conf/checkstyle/sun_checks.xml
index 57908dd..e228d1f 100644
--- a/conf/checkstyle/sun_checks.xml
+++ b/conf/checkstyle/sun_checks.xml
@@ -81,7 +81,6 @@
         <property name="minimum" value="0"/>
         <property name="maximum" value="0"/>
         <property name="message" value="Line has trailing spaces."/>
-      <property name="severity" value="warning"/>
     </module>
 
     <!-- Checks for Headers                                -->
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 {
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallRuntime.java b/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallRuntime.java
index 114e718..f6d499b 100644
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallRuntime.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallRuntime.java
@@ -30,7 +30,7 @@
     IFloodlightProviderService provider;
     private final static Logger log = LoggerFactory.getLogger(PlanInstallRuntime.class);
 
-    public PlanInstallRuntime(//NetworkGraph graph, 
+    public PlanInstallRuntime(//NetworkGraph graph,
                               IFloodlightProviderService provider,
                               IFlowPusherService pusher) {
 //      this.graph = graph;
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/ILinkDiscoveryListener.java b/src/main/java/net/onrc/onos/core/linkdiscovery/ILinkDiscoveryListener.java
index 9b237c4..484616e 100644
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/ILinkDiscoveryListener.java
+++ b/src/main/java/net/onrc/onos/core/linkdiscovery/ILinkDiscoveryListener.java
@@ -1,5 +1,5 @@
 /**
- *    Copyright 2011, Big Switch Networks, Inc. 
+ *    Copyright 2011, Big Switch Networks, Inc.
  *    Originally created by David Erickson, Stanford University
  *
  *    Licensed under the Apache License, Version 2.0 (the "License"); you may
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyCluster.java b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyCluster.java
index c92e02e..e37252d 100644
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyCluster.java
+++ b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyCluster.java
@@ -12,7 +12,7 @@
  */
 public class EventHistoryTopologyCluster {
     // The following fields are not stored as String to save memory
-    // They should be converted to appropriate human-readable strings by 
+    // They should be converted to appropriate human-readable strings by
     // the front end (e.g. in cli in Python)
     public long dpid;
     public long clusterIdOld; // Switch with dpid moved from cluster x to y
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyLink.java b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyLink.java
index 9f9bed9..f172fdd 100644
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyLink.java
+++ b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyLink.java
@@ -12,7 +12,7 @@
  */
 public class EventHistoryTopologyLink {
     // The following fields are not stored as String to save memory
-    // They should be converted to appropriate human-readable strings by 
+    // They should be converted to appropriate human-readable strings by
     // the front end (e.g. in cli in Python)
     public long srcSwDpid;
     public long dstSwDpid;
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologySwitch.java b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologySwitch.java
index 4d77f76..7d0503f 100644
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologySwitch.java
+++ b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologySwitch.java
@@ -13,7 +13,7 @@
  */
 public class EventHistoryTopologySwitch {
     // The following fields are not stored as String to save memory
-    // They should be converted to appropriate human-readable strings by 
+    // They should be converted to appropriate human-readable strings by
     // the front end (e.g. in cli in Python)
     public long dpid;
     public int ipv4Addr;
diff --git a/src/main/java/net/onrc/onos/core/packet/BasePacket.java b/src/main/java/net/onrc/onos/core/packet/BasePacket.java
index a47fcfc..3dd6339 100644
--- a/src/main/java/net/onrc/onos/core/packet/BasePacket.java
+++ b/src/main/java/net/onrc/onos/core/packet/BasePacket.java
@@ -104,7 +104,7 @@
         } catch (Exception e) {
             throw new RuntimeException("Could not clone packet");
         }
-        // TODO: we are using serialize()/deserialize() to perform the 
+        // TODO: we are using serialize()/deserialize() to perform the
         // cloning. Not the most efficient way but simple. We can revisit
         // if we hit performance problems.
         byte[] data = this.serialize();