7076523: TEST_BUG: test/java/net/NetworkInterface/NetParamsTest.java can fail with NPE
Reviewed-by: alanb
--- 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());