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

Unicode chars within files dropped into a DropTarget

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.4.1
    • core-libs

      Name: gm110360 Date: 10/31/2003


      FULL PRODUCT VERSION :
      java version "1.4.1_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
      Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

      FULL OS VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      http://developer.java.sun.com/developer/bugParade/bugs/4313838.html


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create files with unicode chars (eg cyrillic) and drop these in a DropTarget.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The file list contains "non existing" files because file names are messed up (every unicode char is replaced by ?).
      ACTUAL -
      The file list contains "non existing" files because file names are messed up (every unicode char is replaced by ?).

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      None. file.exists() and file.isFile() returns false. file does not exist.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      // ...

      public void drop(DropTargetDropEvent dropEvent) {
        try {
          Transferable transferable=dropEvent.getTransferable();
          if(transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
            dropEvent.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
            List fileList=(List)transferable.getTransferData(DataFlavor.javaFileListFlavor);
            dropEvent.getDropTargetContext().dropComplete(true);
            // ...
          }
        } catch (Exception e) {
          e.printStackTrace();
          dropEvent.rejectDrop();
        }
      }

      // ...
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      use file dialog and not DnD
      (Incident Review ID: 190870)
      ======================================================================

            sherman Xueming Shen
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: