7076523: TEST_BUG: test/java/net/NetworkInterface/NetParamsTest.java can fail with NPE
authorchegar
Wed, 10 Aug 2011 12:30:29 +0100
changeset 10322 82436f404b9d
parent 10151 7a81b6428d3b
child 10323 48d695d1e966
7076523: TEST_BUG: test/java/net/NetworkInterface/NetParamsTest.java can fail with NPE Reviewed-by: alanb
jdk/test/java/net/NetworkInterface/NetParamsTest.java
--- a/jdk/test/java/net/NetworkInterface/NetParamsTest.java	Tue Aug 09 16:59:44 2011 +0100
+++ b/jdk/test/java/net/NetworkInterface/NetParamsTest.java	Wed Aug 10 12:30:29 2011 +0100
@@ -45,7 +45,9 @@
         System.out.println("\tPoint to Point: " + netif.isPointToPoint());
         System.out.println("\tVirtual: " + netif.isVirtual());
         if (netif.isVirtual()) {
-            System.out.println("\tParent Interface: " + netif.getParent().getName());
+            NetworkInterface parent = netif.getParent();
+            String parentName = parent == null ? "null" : parent.getName();
+            System.out.println("\tParent Interface: " + parentName);
         }
         System.out.println("\tMulticast: " + netif.supportsMulticast());