6706251: api/java_net/NetworkInterface/index.html#misc: getDisplayName() returned non null but empty String
authorchegar
Tue, 13 Apr 2010 12:02:06 +0100
changeset 5293 be5f9ec7ca3b
parent 5292 9f51d9987500
child 5294 1baadfa687ac
6706251: api/java_net/NetworkInterface/index.html#misc: getDisplayName() returned non null but empty String Reviewed-by: alanb, michaelm, andrew
jdk/src/share/classes/java/net/NetworkInterface.java
--- a/jdk/src/share/classes/java/net/NetworkInterface.java	Mon Apr 12 15:53:20 2010 -0700
+++ b/jdk/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;
     }
 
     /**