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

java.awt.dnd.InvalidDnDOperationException: data translation failed on file drop

    XMLWordPrintable

Details

    • b122
    • linux
    • Verified

    Backports

      Description

        FULL PRODUCT VERSION :
        java version "1.8.0-ea"
        Java(TM) SE Runtime Environment (build 1.8.0-ea-b115)
        Java HotSpot(TM) Client VM (build 25.0-b57, mixed mode)


        ADDITIONAL OS VERSION INFORMATION :
        Linux Gondolin 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 17:26:33 UTC 2013 i686 i686 i686 GNU/Linux


        A DESCRIPTION OF THE PROBLEM :
        private void dropFile( DropTargetDropEvent event, Transferable transferable ){
        event.acceptDrop( DnDConstants.ACTION_COPY );
        @SuppressWarnings("unchecked")
        List<File> dropppedFiles = (List<File>) transferable.getTransferData( DataFlavor.javaFileListFlavor );
        // left out code
        }

        On getTransferData() following exception is thrown:
        Exception in thread "AWT-EventQueue-0" java.awt.dnd.InvalidDnDOperationException: data translation failed
        at sun.awt.dnd.SunDropTargetContextPeer.getTransferData(SunDropTargetContextPeer.java:271)
        at sun.awt.datatransfer.TransferableProxy.getTransferData(TransferableProxy.java:73)
        at java.awt.dnd.DropTargetContext$TransferableProxy.getTransferData(DropTargetContext.java:376)
        at view.dnd.SpotPanelDropTargetAdapter.dropFile(SpotPanelDropTargetAdapter.java:73)

        This happens with 1.8.0-b115 as in 1.7.0_u45 this works.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Execute code

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Further file list processing
        ACTUAL -
        Exception

        Exception in thread "AWT-EventQueue-0" java.awt.dnd.InvalidDnDOperationException: data translation failed
        at sun.awt.dnd.SunDropTargetContextPeer.getTransferData(SunDropTargetContextPeer.java:271)
        at sun.awt.datatransfer.TransferableProxy.getTransferData(TransferableProxy.java:73)
        at java.awt.dnd.DropTargetContext$TransferableProxy.getTransferData(DropTargetContext.java:376)
        at view.dnd.SpotPanelDropTargetAdapter.dropFile(SpotPanelDropTargetAdapter.java:73)


        REPRODUCIBILITY :
        This bug can be reproduced always.

        Attachments

          Issue Links

            Activity

              People

                pchelko Petr Pchelko (Inactive)
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: