Buggy code:
public class Snippet171 { static class MyType { String fileName ; long fileLength ; long lastModified ; } static class MyTransfer extends ByteArrayTransfer { private static final String MYTYPENAME = "MytypeTransfer" ; private static final int MYTYPEID = registerType ( Snippet171 . MyTransfer . MYTYPENAME ) ; private static Snippet171 . MyTransfer _instance = new Snippet171 . MyTransfer ( ) ; public static Transfer getInstance ( ) { } byte [ ] javaToByteArray ( Object object ) { } Object byteArrayToJava ( byte [ ] bytes ) { } public void javaToNative ( Object object , TransferData transferData ) { } public Object nativeToJava ( TransferData transferData ) { } protected String [ ] getTypeNames ( ) { } protected int [ ] getTypeIds ( ) { } boolean checkMyType ( Object object ) { } protected boolean validate ( Object object ) { } } static class MyType2 extends Snippet171 . MyType { String version ; } static class MyTransfer2 extends Snippet171 . MyTransfer { private static final String MYTYPE2NAME = "Mytype2Transfer" ; private static final int MYTYPE2ID = registerType ( Snippet171 . MyTransfer2 . MYTYPE2NAME ) ; private static Snippet171 . MyTransfer _instance = new Snippet171 . MyTransfer2 ( ) ; public static Transfer getInstance ( ) { } protected String [ ] getTypeNames ( ) { } protected int [ ] getTypeIds ( ) { } byte [ ] javaToByteArray ( Object object ) { } Object byteArrayToJava ( byte [ ] bytes ) { } public void javaToNative ( Object object , TransferData transferData ) { } boolean checkMyType2 ( Object object ) { } protected boolean validate ( Object object ) { } } public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setLayout ( new FillLayout ( ) ) ; final Label label1 = new Label ( shell , ( ( SWT . BORDER ) | ( SWT . WRAP ) ) ) ; label1 . setText ( "Drag<seq2seq4repair_space>Source<seq2seq4repair_space>for<seq2seq4repair_space>MyData<seq2seq4repair_space>and<seq2seq4repair_space>MyData2" ) ; final Label label2 = new Label ( shell , ( ( SWT . BORDER ) | ( SWT . WRAP ) ) ) ; label2 . setText ( "Drop<seq2seq4repair_space>Target<seq2seq4repair_space>for<seq2seq4repair_space>MyData" ) ; final Label label3 = new Label ( shell , ( ( SWT . BORDER ) | ( SWT . WRAP ) ) ) ; label3 . setText ( "Drop<seq2seq4repair_space>Target<seq2seq4repair_space>for<seq2seq4repair_space>MyData2" ) ; DragSource source = new DragSource ( label1 , DND . DROP_COPY ) ; source . setTransfer ( new Transfer [ ] { Snippet171 . MyTransfer . getInstance ( ) , Snippet171 . MyTransfer2 . getInstance ( ) } ) ; source . addDragListener ( new DragSourceAdapter ( ) { public void dragSetData ( DragSourceEvent event ) { Snippet171 . MyType2 myType = new Snippet171 . MyType2 ( ) ; <START_BUG> myType . fileName = "C:\\abc.txt" ; <END_BUG> myType . fileLength = 1000 ; myType . lastModified = 12312313 ; myType . version = "version<seq2seq4repair_space>2" ; event . data = myType ; } } ) ; DropTarget targetMyType = new DropTarget ( label2 , ( ( DND . DROP_COPY ) | ( DND . DROP_DEFAULT ) ) ) ; targetMyType . setTransfer ( new Transfer [ ] { Snippet171 . MyTransfer . getInstance ( ) } ) ; targetMyType . addDropListener ( new DropTargetAdapter ( ) { public void dragEnter ( DropTargetEvent event ) { if ( ( event . detail ) == ( DND . DROP_DEFAULT ) ) event . detail = DND . DROP_COPY ; } public void dragOperationChanged ( DropTargetEvent event ) { if ( ( event . detail ) == ( DND . DROP_DEFAULT ) ) event . detail = DND . DROP_COPY ; } public void drop ( DropTargetEvent event ) { if ( ( event . data ) != null ) { Snippet171 . MyType myType = ( ( Snippet171 . MyType ) ( event . data ) ) ; if ( myType != null ) { String string = "MyType:<seq2seq4repair_space>" + ( myType . fileName ) ; label2 . setText ( string ) ; } } } } ) ; DropTarget targetMyType2 = new DropTarget ( label3 , ( ( DND . DROP_COPY ) | ( DND . DROP_DEFAULT ) ) ) ; targetMyType2 . setTransfer ( new Transfer [ ] { Snippet171 . MyTransfer2 . getInstance ( ) } ) ; targetMyType2 . addDropListener ( new DropTargetAdapter ( ) { public void dragEnter ( DropTargetEvent event ) { if ( ( event . detail ) == ( DND . DROP_DEFAULT ) ) event . detail = DND . DROP_COPY ; } public void dragOperationChanged ( DropTargetEvent event ) { if ( ( event . detail ) == ( DND . DROP_DEFAULT ) ) event . detail = DND . DROP_COPY ; } public void drop ( DropTargetEvent event ) { if ( ( event . data ) != null ) { Snippet171 . MyType2 myType = ( ( Snippet171 . MyType2 ) ( event . data ) ) ; if ( myType != null ) { String string = ( ( "MyType2:<seq2seq4repair_space>" + ( myType . fileName ) ) + ":" ) + ( myType . version ) ; label3 . setText ( string ) ; } } } } ) ; shell . setSize ( 300 , 200 ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
myType . fileName = "abc.txt" ;