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

REGRESSION: Internal Error when listing contents of shortcut to directory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • client-libs



      Name: rmT116609 Date: 06/02/2004


      FULL PRODUCT VERSION :
      java version "1.5.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
      Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      Internal Error when listing contents of shortcut to directory

      This is a Regression from previous versions of java and looks like it is related to bugs: 5050925, 5049016, 4356160 (can't tell if it is a duplicate of one of them)

      Note check for isDirectory() is required due to another bug I submitted: 5009755

      It was also working in versions of Java between 1.4.2 and 1.5.0-beta2

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      create a shortcut to a directory,
      rename it to c:/test (c:/test.lnk)
      run code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      no error

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.InternalError: Unable to bind C:\temp\zz.lnk to parent

      at sun.awt.shell.Win32ShellFolder2.getIShellFolder(Win32ShellFolder2.java:322)

      at sun.awt.shell.Win32ShellFolder2.listFiles(Win32ShellFolder2.java:521)

      at sun.awt.shell.ShellFolder.listFiles(ShellFolder.java:100)

      at Test.main(Test.java:10)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.io.*;
      import javax.swing.*;
      import sun.awt.shell.*;

      public class Test {
        public static void main(String s[]) {
          try {
            File file = ShellFolder.getShellFolder(new File("c:/test.lnk"));
            if (file.isDirectory()) {
              file.listFiles();
            }
          }
          catch (Throwable ex) {
            ex.printStackTrace();
          }
        }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      test ShellFolder.isLink() to find out if it is a link
      if so get the contents of ShellFolder.getLinkLocation() instead

      Release Regression From : 1.4.2
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Incident Review ID: 276006)
      ======================================================================

            leifs Leif Samuelsson (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: