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

Michael McMahon Michael.McMahon at Sun.COM
Fri Mar 19 08:31:00 PDT 2010


Christopher Hegarty - Sun Microsystems Ireland wrote:
> On 19/03/2010 15:04, Michael McMahon wrote:
>> Christopher Hegarty - Sun Microsystems Ireland wrote:
>>> 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.
>>>
>> The javadoc specifies it should be null. So, I don't think we've much
>> choice
>
> Will I take this as a positive review ;-)
>
Yes. An empty string would have been better than null. But we couldn't
change the spec for 6, so it's better to make 7 the same as 6 now I 
would think.

- Michael
> -Chris.
>
>>
>> - Michael
>>
>>> -Chris.
>>>
>>>>
>>>> -Alan.
>>




More information about the net-dev mailing list