From ae59f5076a788506bddb7858e9ac255d3796d37c Mon Sep 17 00:00:00 2001 From: chegar Date: Tue, 13 Apr 2010 12:02:06 +0100 Subject: [PATCH] 6706251: api/java_net/NetworkInterface/index.html#misc: getDisplayName() returned non null but empty String Reviewed-by: alanb, michaelm, andrew --- src/share/classes/java/net/NetworkInterface.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/share/classes/java/net/NetworkInterface.java b/src/share/classes/java/net/NetworkInterface.java index 07941b062..eb3327139 100644 --- a/src/share/classes/java/net/NetworkInterface.java +++ b/src/share/classes/java/net/NetworkInterface.java @@ -221,11 +221,12 @@ public final class NetworkInterface { * A display name is a human readable String describing the network * device. * - * @return the display name of this network interface, - * or null if no display name is available. + * @return a non-empty string representing the display name of this network + * interface, or null if no display name is available. */ public String getDisplayName() { - return displayName; + /* strict TCK conformance */ + return "".equals(displayName) ? null : displayName; } /** -- GitLab