Move unchecked warnings 60/74160/5
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 17 Jul 2018 22:16:44 +0000 (00:16 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 18 Jul 2018 00:08:10 +0000 (02:08 +0200)
Tagging specific statements is better here, as there are only two. It makes
the method better protected and the code is more readable
('here I need to do a cast, which is deemed unsafe').

Change-Id: I7cb8fcfbe1080e6e869fff1de4ba227f84a78eeb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/SouthboundUtilTest.java

index 44a35ec89c34dc5437acf9d88f72b36e5757c03c..85751cdacf26cc0111ee87715c8ce7473f8f9b30 100644 (file)
@@ -107,7 +107,6 @@ public class SouthboundUtilTest {
         assertEquals("Incorrect Optional object received", node, SouthboundUtil.readNode(transaction, connectionIid));
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testGetLocalControllerHostIpAddress() throws Exception {
 
@@ -116,12 +115,14 @@ public class SouthboundUtilTest {
         when(NetworkInterface.getNetworkInterfaces()).thenReturn(null);
         assertNull(SouthboundUtil.getLocalControllerHostIpAddress());
 
+        @SuppressWarnings("unchecked")
         Enumeration<NetworkInterface> ifaces = mock(Enumeration.class);
         when(NetworkInterface.getNetworkInterfaces()).thenReturn(ifaces);
         when(ifaces.hasMoreElements()).thenReturn(true).thenReturn(false);
         NetworkInterface iface = PowerMockito.mock(NetworkInterface.class);
         when(ifaces.nextElement()).thenReturn(iface);
 
+        @SuppressWarnings("unchecked")
         Enumeration<InetAddress> inetAddrs = mock(Enumeration.class);
         when(iface.getInetAddresses()).thenReturn(inetAddrs);
         when(inetAddrs.hasMoreElements()).thenReturn(true).thenReturn(false);