6706251: api/java_net/NetworkInterface/index.html#misc: getDisplayName() returned non null but empty String
Reviewed-by: alanb, michaelm, andrew
--- 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;
}
/**