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

regression: JFileChooser stalls accessing desktop shortcut

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:

      Description


      I've run into an awkward regression with Tiger Beta2
      around JFileChooser on Windows. It kicks in when you have
      windows shortcuts on your desktop that reference network
      filesystems that are currently unavailable.

      I initially hit this on my home system. I have a desktop
      shortcut to a network folder back at Sun. However that shortcut
      only works when I am using VPN.

      When I ran a small Java application that uses JFileChooser
      it stalled for 20-30 second during startup and then put up
      a dialog box saying:

          Problem with shortcut
          The Drive or network connection that the shortcut
          "kgh'(H).lnk' refers to is unavailable
          Make sure that the disk is properly inserted or the
          network resources is available, and then try again.

      I clicked OK, and then got another long stall and another
      similar dialog before my application was able to start.

      Here is a backtrace from NetBeans of the main thread when
      it was stalled:
          Win32ShellFolder2.getLinkLocation
          Win32ShellFolder2.getLinkLocation
          Win32ShellFolder2.isDirectory
          Win32ShellFolderManager2.get
          ShellFolder.get
          MetalFileChooserUI.updateUseShellFolder
          MetalFileChooserUI.installComponents
          BasicFileChooserUI.installUI
          MetalFileChooserUI.installUI
          JComponent.setUI
          JFileChooser.updateUI
          JFileChooser.setup
          JFileChooser.<init>
          JFileChooser.<init>
          GUI.<init>
          GUI.main

      It looks like this problem is caused because we are trying to
      access the shortcut.

      I was able to reproduce a similar problem at work by:
         * inserting a CDROM
         * creating a short on my desktop to a file on the CDROM
         * removing the CDROM
         * running the four line progtam below:
         
         public class GUI {
            public static void main(String arv[]) throws Exception {
               new javax.swing.JFileChooser();
            }
         }

      This problem was not present in 1.4.2.

      I think the issue of having a bad desktop shortcut to a CDROM
      will be fairly rare. However, I am concerned that it may be
      somewhat common for people to have desktop shortcuts to network
      fileystems that are sometimes unavailable. The effects of the
      bug are fairly unpleasant in that they stall the application for
      40-60 seconds and put up a couple of annoying dialogs.

      I wouldn't mind getting stalled if either I or my application
      was explicitly accessing the bad shortcut. But we weren't.
      It was simply its presence on the desktop that caused the stall.

      I suspect this bug is related to the fix for 4356160.
      I was one of the people requesting that fix, but
      unfortunately it may have caused this side-effect. :-(

      ###@###.### 2004-06-20

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shickeysunw Shannon Hickey (Inactive)
              Reporter:
              ghamiltosunw Graham Hamilton (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: