United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6706251 : api/java_net/NetworkInterface/index.html#misc: getDisplayName() returned non null but empty String

Details
Type:
Bug
Submit Date:
2008-05-22
Status:
Resolved
Updated Date:
2012-03-22
Project Name:
JDK
Resolved Date:
2008-11-07
Component:
core-libs
OS:
windows_2008
Sub-Component:
java.net
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:
6u11 (b03)

Related Reports
Backport:
Backport:

Sub Tasks

Description
JCK            : JCK-runtime-6a b14
J2SE           : FAIL - jdk6u10 build 23, 24
Platform[s]    : FAIL - Windows (2008) x86
switch/Mode    : FAIL - any

Test api/java_net/NetworkInterface/index.html#misc NetworkInterface2006 fails on stt-54.russia
with folowing  output:
"getDisplayName() returned non null but empty String."

Test passes on stt-53.russia.


You can use this code for reproduce:

import java.io.*;
import java.net.*;
import java.util.*;

public class abtest1 {

    public static void main(String argv[]) {
        Enumeration nis = null;

        try {
            nis = NetworkInterface.getNetworkInterfaces();
        } catch (SocketException se) {
            System.out.println("Unexpected " + se);
            se.printStackTrace();
            System.out.println("public String getDisplayName() Test Failed");
        }

        if(nis == null) {
            System.out.println("No network interfaces could be found on this machine");
            System.out.println("public String getDisplayName() Test Failed");
        }

        NetworkInterface ni = null;

        for(; nis.hasMoreElements(); ) {
            ni = (NetworkInterface)nis.nextElement();
            String name = ni.getDisplayName();
            System.out.println("getDisplayName():        " +  name );

            System.out.println("Name:                    " +  ni.getName());
            Enumeration<InetAddress> inetAddresses=ni.getInetAddresses();
            for (InetAddress inetAddress : Collections.list(inetAddresses))
            {
                System.out.println("InetAddress:               " + inetAddress);
            }

            if( name != null && name.equals("") )
            {
                System.out.println("getDisplayName() returned non null but empty String");
                System.out.println("public String getDisplayName() Test Failed");
            }

            System.out.println("");
        }

        System.out.println("OKAY");
    }
}

                                    

Comments
EVALUATION

Fixed
                                     
2008-11-03



Hardware and Software, Engineered to Work Together