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

URLConnection isn't closed until Socket finalize when non-existing file is specified to URLImageIcon

XMLWordPrintable

    • 2d
    • b77
    • generic
    • generic

      When non-existing file are specified to javax.swing.URLImageIcon(URL) ,
      the conection is not closed untl Socket finalize() is executed.

      CONFIGURATION :
       JDK : 1.4.2_05(1.4.2_10)
       OS : Generic
       

      REPRODUCE:
        
      1) Compile the src code listed below.

      ===================================================
      import javax.swing.*;
      import java.net.*;
      class c
      {
        public static void main(String[] arg) throws Exception
        {
          URL u = new URL(arg[0]);
          new ImageIcon(u);
          while (true)
            Thread.sleep(10000);
        }
      }
      ========================================================

      2) Specify non-existing URL file

       ex.
         java c http://www.existingserver.co.jp/nonexist.gif

       when netstat is invoked, the status is
         Client side : ESTABLISHED -> CLOSE_WAIT
         Server side : ESTABLISHED -> FIN_WAIT_2

       This status is changed after the application exits.

            bae Andrew Brygin
            tbaba Tadayuki Baba (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: