Add checkstyle rule UpperEll and fix all code accordingly. 35/2335/3
authorAlissa Bonas <abonas@redhat.com>
Sun, 3 Nov 2013 13:21:31 +0000 (15:21 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 5 Nov 2013 17:19:15 +0000 (17:19 +0000)
UpperEll rule ensures that numbers of type long
are defined with a capital "L" in the end instead of "l"
for a better readability - per java language specification
recommendation.

Change-Id: I068c32d4aaed0980bee1d93cfeec511e72bad2f1
Signed-off-by: Alissa Bonas <abonas@redhat.com>
opendaylight/commons/checkstyle/src/main/resources/controller/checkstyle.xml
opendaylight/protocol_plugins/openflow/src/test/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerServiceTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/flowprogrammer/FlowTest.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/match/MatchTest.java
opendaylight/samples/simpleforwarding/src/test/java/org/opendaylight/controller/samples/simpleforwarding/internal/HostSwitchTest.java

index 86c654cb586b380f30c99e2ed790660deddcbb2b..c810d6523a0832fcb15da4a369e6ec2463c49339 100644 (file)
@@ -17,6 +17,7 @@
        <module name="RedundantImport"/>\r
        <module name="UnusedImports"/>\r
        <module name="AvoidStarImport"/>\r
        <module name="RedundantImport"/>\r
        <module name="UnusedImports"/>\r
        <module name="AvoidStarImport"/>\r
+       <module name="UpperEll"/>\r
     </module>\r
 \r
 </module>\r
     </module>\r
 \r
 </module>\r
index aa1f6c0bd2dc4aad6c569a3b00dc683d8ac094fa..a751948de7d5a73d22696f66a0bcefb15ca82b53 100644 (file)
@@ -51,7 +51,7 @@ public class FlowProgrammerServiceTest {
 
     @Test
     public void testSALtoOFFlowConverter() throws UnknownHostException {
 
     @Test
     public void testSALtoOFFlowConverter() throws UnknownHostException {
-        Node node = NodeCreator.createOFNode(1000l);
+        Node node = NodeCreator.createOFNode(1000L);
         NodeConnector port = NodeConnectorCreator.createNodeConnector(
                 (short) 24, node);
         NodeConnector oport = NodeConnectorCreator.createNodeConnector(
         NodeConnector port = NodeConnectorCreator.createNodeConnector(
                 (short) 24, node);
         NodeConnector oport = NodeConnectorCreator.createNodeConnector(
@@ -180,7 +180,7 @@ public class FlowProgrammerServiceTest {
 
     @Test
     public void testVlanNoneIdFlowConversion() throws Exception {
 
     @Test
     public void testVlanNoneIdFlowConversion() throws Exception {
-        Node node = NodeCreator.createOFNode(1000l);
+        Node node = NodeCreator.createOFNode(1000L);
 
         /*
          * The value 0 is used to indicate that no VLAN ID is set
 
         /*
          * The value 0 is used to indicate that no VLAN ID is set
@@ -229,7 +229,7 @@ public class FlowProgrammerServiceTest {
 
     @Test
     public void testV6toSALFlowConversion() throws Exception {
 
     @Test
     public void testV6toSALFlowConversion() throws Exception {
-        Node node = NodeCreator.createOFNode(12l);
+        Node node = NodeCreator.createOFNode(12L);
         NodeConnector port = NodeConnectorCreator.createNodeConnector(
                 (short) 34, node);
         NodeConnector oport = NodeConnectorCreator.createNodeConnector(
         NodeConnector port = NodeConnectorCreator.createNodeConnector(
                 (short) 34, node);
         NodeConnector oport = NodeConnectorCreator.createNodeConnector(
@@ -365,7 +365,7 @@ public class FlowProgrammerServiceTest {
     public void testV6MatchToSALMatchToV6MatchConversion()
             throws UnknownHostException {
         NodeConnector port = NodeConnectorCreator.createNodeConnector(
     public void testV6MatchToSALMatchToV6MatchConversion()
             throws UnknownHostException {
         NodeConnector port = NodeConnectorCreator.createNodeConnector(
-                (short) 24, NodeCreator.createOFNode(6l));
+                (short) 24, NodeCreator.createOFNode(6L));
         byte srcMac[] = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
                 (byte) 0x9a, (byte) 0xbc };
         byte dstMac[] = { (byte) 0x1a, (byte) 0x2b, (byte) 0x3c, (byte) 0x4d,
         byte srcMac[] = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
                 (byte) 0x9a, (byte) 0xbc };
         byte dstMac[] = { (byte) 0x1a, (byte) 0x2b, (byte) 0x3c, (byte) 0x4d,
index 8f09de9aef52dc9d1f01c247d12419b500020c4a..e644b0d834c0ed8cf70b52d8746661b734145852 100644 (file)
@@ -39,7 +39,7 @@ public class FlowTest {
 
     @Test
     public void testFlowEquality() throws Exception {
 
     @Test
     public void testFlowEquality() throws Exception {
-        Node node = NodeCreator.createOFNode(1055l);
+        Node node = NodeCreator.createOFNode(1055L);
         Flow flow1 = getSampleFlowV6(node);
         Flow flow2 = getSampleFlowV6(node);
         Flow flow3 = getSampleFlow(node);
         Flow flow1 = getSampleFlowV6(node);
         Flow flow2 = getSampleFlowV6(node);
         Flow flow3 = getSampleFlow(node);
@@ -69,7 +69,7 @@ public class FlowTest {
 
     @Test
     public void testFlowCloning() throws UnknownHostException {
 
     @Test
     public void testFlowCloning() throws UnknownHostException {
-        Node node = NodeCreator.createOFNode(55l);
+        Node node = NodeCreator.createOFNode(55L);
         Flow flow1 = getSampleFlowV6(node);
         Flow flow2 = flow1.clone();
 
         Flow flow1 = getSampleFlowV6(node);
         Flow flow2 = flow1.clone();
 
@@ -81,7 +81,7 @@ public class FlowTest {
 
     @Test
     public void testFlowActions() throws UnknownHostException {
 
     @Test
     public void testFlowActions() throws UnknownHostException {
-        Node node = NodeCreator.createOFNode(55l);
+        Node node = NodeCreator.createOFNode(55L);
         Flow flow = getSampleFlowV6(node);
 
         List<Action> actions = flow.getActions();
         Flow flow = getSampleFlowV6(node);
 
         List<Action> actions = flow.getActions();
index 14eedea9f8fad5e457b14628455d80a2ba54f442..30d49cfd9dcc5b5abb90bafd659ac314e855f99a 100644 (file)
@@ -24,7 +24,7 @@ import org.opendaylight.controller.sal.utils.NodeCreator;
 public class MatchTest {
     @Test
     public void testMatchCreation() {
 public class MatchTest {
     @Test
     public void testMatchCreation() {
-        Node node = NodeCreator.createOFNode(7l);
+        Node node = NodeCreator.createOFNode(7L);
         NodeConnector port = NodeConnectorCreator.createOFNodeConnector((short) 6, node);
         MatchField field = new MatchField(MatchType.IN_PORT, port);
 
         NodeConnector port = NodeConnectorCreator.createOFNodeConnector((short) 6, node);
         MatchField field = new MatchField(MatchType.IN_PORT, port);
 
@@ -60,7 +60,7 @@ public class MatchTest {
     public void testMatchSetGet() {
         Match x = new Match();
         short val = 2346;
     public void testMatchSetGet() {
         Match x = new Match();
         short val = 2346;
-        NodeConnector inPort = NodeConnectorCreator.createOFNodeConnector(val, NodeCreator.createOFNode(1l));
+        NodeConnector inPort = NodeConnectorCreator.createOFNodeConnector(val, NodeCreator.createOFNode(1L));
         x.setField(MatchType.IN_PORT, inPort);
         Assert.assertTrue(((NodeConnector) x.getField(MatchType.IN_PORT).getValue()).equals(inPort));
         Assert.assertTrue((Short) ((NodeConnector) x.getField(MatchType.IN_PORT).getValue()).getID() == val);
         x.setField(MatchType.IN_PORT, inPort);
         Assert.assertTrue(((NodeConnector) x.getField(MatchType.IN_PORT).getValue()).equals(inPort));
         Assert.assertTrue((Short) ((NodeConnector) x.getField(MatchType.IN_PORT).getValue()).getID() == val);
@@ -175,7 +175,7 @@ public class MatchTest {
     @Test
     public void testMatchMask() {
         Match x = new Match();
     @Test
     public void testMatchMask() {
         Match x = new Match();
-        NodeConnector inPort = NodeConnectorCreator.createOFNodeConnector((short) 6, NodeCreator.createOFNode(3l));
+        NodeConnector inPort = NodeConnectorCreator.createOFNodeConnector((short) 6, NodeCreator.createOFNode(3L));
         x.setField(MatchType.IN_PORT, inPort);
         x.setField(MatchType.DL_VLAN, (short) 28, (short) 0xfff);
         Assert.assertFalse(x.getMatches() == 0);
         x.setField(MatchType.IN_PORT, inPort);
         x.setField(MatchType.DL_VLAN, (short) 28, (short) 0xfff);
         Assert.assertFalse(x.getMatches() == 0);
@@ -186,7 +186,7 @@ public class MatchTest {
     public void testMatchBitMask() {
         byte mac[] = { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 22, (byte) 12 };
         byte mask[] = { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0 };
     public void testMatchBitMask() {
         byte mac[] = { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 22, (byte) 12 };
         byte mask[] = { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0 };
-        NodeConnector inPort = NodeConnectorCreator.createOFNodeConnector((short) 4095, NodeCreator.createOFNode(7l));
+        NodeConnector inPort = NodeConnectorCreator.createOFNodeConnector((short) 4095, NodeCreator.createOFNode(7L));
 
         MatchField x = new MatchField(MatchType.IN_PORT, inPort);
         Assert.assertTrue((x.getMask()) == null);
 
         MatchField x = new MatchField(MatchType.IN_PORT, inPort);
         Assert.assertTrue((x.getMask()) == null);
@@ -202,7 +202,7 @@ public class MatchTest {
     @Test
     public void testNullMask() {
         byte mac[] = { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 22, (byte) 12 };
     @Test
     public void testNullMask() {
         byte mac[] = { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 22, (byte) 12 };
-        NodeConnector inPort = NodeConnectorCreator.createOFNodeConnector((short) 2000, NodeCreator.createOFNode(7l));
+        NodeConnector inPort = NodeConnectorCreator.createOFNodeConnector((short) 2000, NodeCreator.createOFNode(7L));
 
         MatchField x = new MatchField(MatchType.IN_PORT, inPort);
         Assert.assertTrue(x.getBitMask() == 0);
 
         MatchField x = new MatchField(MatchType.IN_PORT, inPort);
         Assert.assertTrue(x.getBitMask() == 0);
@@ -219,7 +219,7 @@ public class MatchTest {
 
     @Test
     public void testEquality() throws Exception {
 
     @Test
     public void testEquality() throws Exception {
-        Node node = NodeCreator.createOFNode(7l);
+        Node node = NodeCreator.createOFNode(7L);
         NodeConnector port = NodeConnectorCreator.createOFNodeConnector((short) 24, node);
         NodeConnector port2 = NodeConnectorCreator.createOFNodeConnector((short) 24, node);
         byte srcMac[] = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9a, (byte) 0xbc };
         NodeConnector port = NodeConnectorCreator.createOFNodeConnector((short) 24, node);
         NodeConnector port2 = NodeConnectorCreator.createOFNodeConnector((short) 24, node);
         byte srcMac[] = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9a, (byte) 0xbc };
@@ -389,7 +389,7 @@ public class MatchTest {
 
     @Test
     public void testCloning() throws Exception {
 
     @Test
     public void testCloning() throws Exception {
-        Node node = NodeCreator.createOFNode(7l);
+        Node node = NodeCreator.createOFNode(7L);
         NodeConnector port = NodeConnectorCreator.createOFNodeConnector((short) 24, node);
         byte srcMac[] = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9a, (byte) 0xbc };
         byte dstMac[] = { (byte) 0x1a, (byte) 0x2b, (byte) 0x3c, (byte) 0x4d, (byte) 0x5e, (byte) 0x6f };
         NodeConnector port = NodeConnectorCreator.createOFNodeConnector((short) 24, node);
         byte srcMac[] = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9a, (byte) 0xbc };
         byte dstMac[] = { (byte) 0x1a, (byte) 0x2b, (byte) 0x3c, (byte) 0x4d, (byte) 0x5e, (byte) 0x6f };
@@ -455,7 +455,7 @@ public class MatchTest {
 
     @Test
     public void testFlip() throws Exception {
 
     @Test
     public void testFlip() throws Exception {
-        Node node = NodeCreator.createOFNode(7l);
+        Node node = NodeCreator.createOFNode(7L);
         NodeConnector port = NodeConnectorCreator.createOFNodeConnector((short) 24, node);
         byte srcMac[] = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9a, (byte) 0xbc };
         byte dstMac[] = { (byte) 0x1a, (byte) 0x2b, (byte) 0x3c, (byte) 0x4d, (byte) 0x5e, (byte) 0x6f };
         NodeConnector port = NodeConnectorCreator.createOFNodeConnector((short) 24, node);
         byte srcMac[] = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9a, (byte) 0xbc };
         byte dstMac[] = { (byte) 0x1a, (byte) 0x2b, (byte) 0x3c, (byte) 0x4d, (byte) 0x5e, (byte) 0x6f };
index 7897c398909a48a02cd0221279cf51d054bbaa6c..6627029ef0ab658637c33d0d16ceb15d8cceb23d 100644 (file)
@@ -49,8 +49,8 @@ public class HostSwitchTest {
         } catch (ConstructionException e) {
             return;
         }
         } catch (ConstructionException e) {
             return;
         }
-        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1l));
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1l));
+        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1L));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1L));
         Assert.assertTrue(hsw1.equals(hsw2));
     }
 
         Assert.assertTrue(hsw1.equals(hsw2));
     }
 
@@ -81,8 +81,8 @@ public class HostSwitchTest {
             return;
         }
 
             return;
         }
 
-        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1l));
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1l));
+        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1L));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1L));
         Assert.assertTrue(!hsw1.equals(hsw2));
     }
 
         Assert.assertTrue(!hsw1.equals(hsw2));
     }
 
@@ -113,8 +113,8 @@ public class HostSwitchTest {
             return;
         }
 
             return;
         }
 
-        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1l));
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(2l));
+        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1L));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(2L));
         Assert.assertTrue(!hsw1.equals(hsw2));
     }
 
         Assert.assertTrue(!hsw1.equals(hsw2));
     }
 
@@ -145,8 +145,8 @@ public class HostSwitchTest {
             return;
         }
 
             return;
         }
 
-        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1l));
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(2l));
+        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1L));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(2L));
         Assert.assertTrue(!hsw1.equals(hsw2));
     }
 
         Assert.assertTrue(!hsw1.equals(hsw2));
     }
 
@@ -176,8 +176,8 @@ public class HostSwitchTest {
         } catch (ConstructionException e) {
             return;
         }
         } catch (ConstructionException e) {
             return;
         }
-        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1l));
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1l));
+        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1L));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1L));
         Assert.assertTrue(hsw1.hashCode() == hsw2.hashCode());
     }
 
         Assert.assertTrue(hsw1.hashCode() == hsw2.hashCode());
     }
 
@@ -208,8 +208,8 @@ public class HostSwitchTest {
             return;
         }
 
             return;
         }
 
-        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1l));
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1l));
+        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1L));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1L));
         Assert.assertTrue(hsw1.hashCode() == hsw2.hashCode());
     }
 
         Assert.assertTrue(hsw1.hashCode() == hsw2.hashCode());
     }
 
@@ -239,8 +239,8 @@ public class HostSwitchTest {
         } catch (ConstructionException e) {
             return;
         }
         } catch (ConstructionException e) {
             return;
         }
-        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1l));
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1l));
+        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1L));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1L));
         Assert.assertTrue(hsw1.hashCode() != hsw2.hashCode());
     }
 
         Assert.assertTrue(hsw1.hashCode() != hsw2.hashCode());
     }
 
@@ -271,8 +271,8 @@ public class HostSwitchTest {
             return;
         }
 
             return;
         }
 
-        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1l));
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(2l));
+        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1L));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(2L));
         Assert.assertTrue(hsw1.hashCode() != hsw2.hashCode());
     }
 
         Assert.assertTrue(hsw1.hashCode() != hsw2.hashCode());
     }
 
@@ -303,8 +303,8 @@ public class HostSwitchTest {
             return;
         }
 
             return;
         }
 
-        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1l));
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(2l));
+        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1L));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(2L));
         Assert.assertTrue(hsw1.hashCode() != hsw2.hashCode());
     }
 
         Assert.assertTrue(hsw1.hashCode() != hsw2.hashCode());
     }
 
@@ -335,8 +335,8 @@ public class HostSwitchTest {
             return;
         }
 
             return;
         }
 
-        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1l));
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1l));
+        HostNodePair hsw1 = new HostNodePair(h1, NodeCreator.createOFNode(1L));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1L));
         HashMap<HostNodePair, Long> hm = new HashMap<HostNodePair, Long>();
         hm.put(hsw1, new Long(10));
         Assert.assertTrue(hm.get(hsw2) != null);
         HashMap<HostNodePair, Long> hm = new HashMap<HostNodePair, Long>();
         hm.put(hsw1, new Long(10));
         Assert.assertTrue(hm.get(hsw2) != null);
@@ -370,8 +370,8 @@ public class HostSwitchTest {
             return;
         }
         HostNodePair hsw1 = new HostNodePair(h1, null);
             return;
         }
         HostNodePair hsw1 = new HostNodePair(h1, null);
-        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1l));
-        hsw1.setNode(NodeCreator.createOFNode(1l));
+        HostNodePair hsw2 = new HostNodePair(h2, NodeCreator.createOFNode(1L));
+        hsw1.setNode(NodeCreator.createOFNode(1L));
         HashMap<HostNodePair, Long> hm = new HashMap<HostNodePair, Long>();
         hm.put(hsw1, new Long(10));
         Assert.assertTrue(hm.get(hsw2) != null);
         HashMap<HostNodePair, Long> hm = new HashMap<HostNodePair, Long>();
         hm.put(hsw1, new Long(10));
         Assert.assertTrue(hm.get(hsw2) != null);