Code Review 6706251: api/java_net/NetworkInterface/index.html#misc: getDisplayName() returned non null but empty String
Andrew John Hughes
ahughes at redhat.com
Fri Mar 19 10:47:10 PDT 2010
On 19 March 2010 15:31, Michael McMahon <Michael.McMahon at sun.com> wrote:
> 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.
>
We also need this change for OpenJDK6 by the sound of it.
> - Michael
>>
>> -Chris.
>>
>>>
>>> - Michael
>>>
>>>> -Chris.
>>>>
>>>>>
>>>>> -Alan.
>>>
>
>
--
Andrew :-)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
More information about the net-dev
mailing list