mirror of https://github.com/apache/cloudstack.git
String instantiation is not needed
Removed a String instntiation, test case added Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
This commit is contained in:
parent
ce8ada030d
commit
564013bec0
|
|
@ -257,7 +257,7 @@ public class NetUtils {
|
|||
return ipFromInetAddress(addr);
|
||||
}
|
||||
|
||||
return new String("127.0.0.1");
|
||||
return "127.0.0.1";
|
||||
}
|
||||
|
||||
public static String ipFromInetAddress(InetAddress addr) {
|
||||
|
|
|
|||
|
|
@ -168,4 +168,9 @@ public class NetUtilsTest extends TestCase {
|
|||
newMac = NetUtils.generateMacOnIncrease(mac, 16);
|
||||
assertTrue(newMac.equals("06:00:0f:00:45:67"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetLocalIPString() {
|
||||
assertNotNull(NetUtils.getLocalIPString());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue