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

fp.bugs 4040 InetAddress.getByName(String) changed in 1.0.1

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description

      From: ###@###.### (Stephen Pietrowicz)
      This does not look like form output to me.


      Hi,

      I decided to send this via e-mail, because I don't think it warrants being
      waved around in public the way some people seem to be fond of doing...

      We ran across a problem with the JDK 1.0.1 patch you just released. The
      behavior for InetAddress.getByName(Sting name) has changed. If you pass an
      argument which is the host's internet address (in String form), an
      acception is sometimes thrown.

      If getByName() is called with the hostname, and then getByName is
      called with that hostname's internet address, it works. If getByName()
      is called with the internet address (without previously calling it with
      the hostname), it will fail, but only if the internet address is *not* the
      address of the host the test is running on. Here's an example that I hope
      makes this explanation clearer:

      If the sequence:
      InetAddress.getByName("lightyear.ncsa.uiuc.edu");
      InetAddress.getByName("141.142.150.19");

      is called, it works as expected.

      If the call:

      InetAddress.getByName("141.142.2.2");

      is called, an acception is thrown.

      If the Internet address string used is the internet address for
      the machine that the test runs on, it also works.

      If I run the call:

      InetAddress.getByName("141.142.103.26");

      on the machine "havefun" (and "havefun" has the internet address
      of 141.142.103.26) it works.

      This occurs on the SparcStations here.

      If this explanation isn't clear enough, please send me e-mail.

      Steve

      PS. Here's some java that shows the problem:
      ----

      import java.net.*;
       
      public class test {
      test () {}
      public static void main(String argv[]) {
      try {
      System.out.println(InetAddress.getByName("lightyear.ncsa.uiuc.edu"));
      } catch (Exception e) {
      System.out.println("barf 1");
      }

      try {
      System.out.println(InetAddress.getByName("141.142.150.19"));
      } catch (Exception e) {
      System.out.println("barf 2");
      }

      try {
      System.out.println(InetAddress.getByName("141.142.2.2"));
      } catch (Exception e) {
      System.out.println("barf 3");
      }
      }
      }


        Attachments

          Activity

            People

            Assignee:
            mmuellersunw Marianne Mueller (Inactive)
            Reporter:
            bhagen Benjamin Hagen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: