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

DnD of long file paths does not work on Windows

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Latest Windows 11

      A DESCRIPTION OF THE PROBLEM :
      Drag-n-Drop of files from Windows Explorer does not work if the file path at hand is a long file path.

      e.g.
      D:\Test\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.txt


      A drag-n-drop operation will fail with this exception:
      java.awt.dnd.InvalidDnDOperationException: java.io.IOException: no native data was transferred

      A paste-from-clipboard operation will fail with this exception:
      java.awt.dnd.InvalidDnDOperationException: java.io.IOException: Exception fetching data:


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a file with a long file path:

      e.g.
      D:\Test\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.txt


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Drag-n-Drop should work for files with a long file path just like with any other file.
      ACTUAL -
      Drag-n-Drop does not work.

      ---------- BEGIN SOURCE ----------
      Any Java Swing application that accepts file list flavour drag-n-drop content can be used to reproduce the issue.

      PS: Writing a test application would take an hour but can do if necessary. I'm just assuming the JDK already has manual test cases for that.
      ---------- END SOURCE ----------

            honkar Harshitha Onkar
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: