Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6706251

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

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b03
    • CPU:
      x86
    • OS:
      windows_2008

      Backports

        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");
            }
        }

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  michaelm Michael McMahon
                  Reporter:
                  abutaevorcl Alexander Butaev (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: