6706251: api/java_net/NetworkInterface/index.html#misc: getDisplayName() returned non null but empty String

Reviewed-by: alanb, michaelm, andrew
This commit is contained in:
Chris Hegarty 2010-04-13 12:02:06 +01:00
parent 3a0f478ce5
commit 87fe7a4376

View File

@ -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;
}
/**