changeset 2303:1672f0212f02

6706251: api/java_net/NetworkInterface/index.html#misc: getDisplayName() returned non null but empty String Reviewed-by: alanb, michaelm, andrew
author chegar
date Tue, 13 Apr 2010 12:02:06 +0100
parents a45217204978
children ed61accf772e
files src/share/classes/java/net/NetworkInterface.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/net/NetworkInterface.java	Mon Apr 12 15:53:20 2010 -0700
+++ b/src/share/classes/java/net/NetworkInterface.java	Tue Apr 13 12:02:06 2010 +0100
@@ -221,11 +221,12 @@
      * 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;
     }
 
     /**