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

Christopher Hegarty - Sun Microsystems Ireland Christopher.Hegarty at Sun.COM
Fri Mar 19 07:51:10 PDT 2010


On 19/03/2010 14:42, Alan Bateman wrote:
> Christopher Hegarty - Sun Microsystems Ireland wrote:
>> Hi Michael,
>>
>> This is a forward port of a fix that you did in JDK6u11 to JDK7. The
>> source changes are trivial and the very same as what went in 6.
>>
>> The change is for strict conformance of getDisplayName, should return
>> null instead of an empty string.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~chegar/6706251/webrev.00/webrev/
>>
>> -Chris.
> Is this really a bug? The spec doesn't prohibit the display name from
> being the empty string. If the empty string is not allowed then the
> javadoc should probably be clarified.

I vaguely remember the history of this issue (Michael will know better), 
  but the expectation from the API is that while empty string is not 
disallowed if the display name cannot be retrieved then null should be 
returned.

I think such a clarification is unnecessary in the API, it is such a 
corner case, and may be confusing.

-Chris.

>
> -Alan.



More information about the net-dev mailing list