Buggy code:
public class DropTarget extends Widget { Control control ; Listener controlListener ; Transfer [ ] transferAgents = new Transfer [ 0 ] ; DragAndDropEffect effect ; TransferData selectedDataType ; int selectedOperation ; int keyOperation = - 1 ; long dragOverStart ; Runnable dragOverHeartbeat ; DNDEvent dragOverEvent ; static DropTarget CurrentDropTarget = null ; static final String DROPTARGETID = "DropTarget" ; static final int DRAGOVER_HYSTERESIS = 50 ; static Callback DragTrackingHandler ; static Callback DragReceiveHandler ; public DropTarget ( Control control , int style ) { } static int checkStyle ( int style ) { } static int DragReceiveHandler ( int theWindow , int handlerRefCon , int theDrag ) { } static int DragTrackingHandler ( int message , int theWindow , int handlerRefCon , int theDrag ) { } static DropTarget FindDropTarget ( int theWindow , int theDrag ) { } public void addDropListener ( DropTargetListener listener ) { } protected void checkSubclass ( ) { } int dragReceiveHandler ( int theWindow , int handlerRefCon , int theDrag ) { updateDragOverHover ( 0 , null ) ; effect . showDropTargetEffect ( FEEDBACK_NONE , 0 , 0 ) ; if ( ( keyOperation ) == ( - 1 ) ) return OS . dragNotAcceptedErr ; DNDEvent event = new DNDEvent ( ) ; event . widget = this ; event . time = ( ( int ) ( System . currentTimeMillis ( ) ) ) ; event . detail = DND . DROP_NONE ; notifyListeners ( DragLeave , event ) ; event = new DNDEvent ( ) ; if ( ! ( setEventData ( theDrag , event ) ) ) { return OS . dragNotAcceptedErr ; } keyOperation = - 1 ; int allowedOperations = event . operations ; TransferData [ ] allowedDataTypes = new TransferData [ event . dataTypes . length ] ; System . arraycopy ( event . dataTypes , 0 , allowedDataTypes , 0 , event . dataTypes . length ) ; event . dataType = selectedDataType ; event . detail = selectedOperation ; selectedDataType = null ; selectedOperation = DND . DROP_NONE ; notifyListeners ( DropAccept , event ) ; if ( ( event . dataType ) != null ) { for ( int i = 0 ; i < ( allowedDataTypes . length ) ; i ++ ) { if ( ( allowedDataTypes [ i ] . type ) == ( event . dataType . type ) ) { selectedDataType = allowedDataTypes [ i ] ; break ; } } } if ( ( ( selectedDataType ) != null ) && ( ( ( event . detail ) & allowedOperations ) != 0 ) ) { selectedOperation = event . detail ; } if ( ( selectedOperation ) == ( DND . DROP_NONE ) ) { return OS . dragNotAcceptedErr ; } <START_BUG> byte [ ] [ ] data = data = new byte [ 0 ] [ ] ; <END_BUG> short [ ] numItems = new short [ 1 ] ; OS . CountDragItems ( theDrag , numItems ) ; for ( short i = 0 ; i < ( numItems [ 0 ] ) ; i ++ ) { int [ ] theItemRef = new int [ 1 ] ; OS . GetDragItemReferenceNumber ( theDrag , ( ( short ) ( i + 1 ) ) , theItemRef ) ; int [ ] size = new int [ 1 ] ; OS . GetFlavorDataSize ( theDrag , theItemRef [ 0 ] , selectedDataType . type , size ) ; if ( ( size [ 0 ] ) > 0 ) { byte [ ] buffer = new byte [ size [ 0 ] ] ; OS . GetFlavorData ( theDrag , theItemRef [ 0 ] , selectedDataType . type , buffer , size , 0 ) ; byte [ ] [ ] newData = new byte [ ( data . length ) + 1 ] [ ] ; System . arraycopy ( data , 0 , newData , 0 , data . length ) ; newData [ data . length ] = buffer ; data = newData ; } } Object object = null ; for ( int i = 0 ; i < ( transferAgents . length ) ; i ++ ) { Transfer transfer = transferAgents [ i ] ; if ( transfer . isSupportedType ( selectedDataType ) ) { selectedDataType . data = data ; object = transfer . nativeToJava ( selectedDataType ) ; break ; } } if ( object == null ) { selectedOperation = DND . DROP_NONE ; } event . dataType = selectedDataType ; event . detail = selectedOperation ; event . data = object ; notifyListeners ( Drop , event ) ; selectedOperation = DND . DROP_NONE ; if ( ( allowedOperations & ( event . detail ) ) == ( event . detail ) ) { selectedOperation = event . detail ; } int action = opToOsOp ( selectedOperation ) ; OS . SetDragDropAction ( theDrag , action ) ; return ( selectedOperation ) == ( DND . DROP_NONE ) ? OS . dragNotAcceptedErr : OS . noErr ; } int dragTrackingHandler ( int message , int theWindow , int handlerRefCon , int theDrag ) { } public Control getControl ( ) { } int getOperationFromKeyState ( int theDrag ) { } public Transfer [ ] getTransfer ( ) { } void onDispose ( ) { } int opToOsOp ( int operation ) { } int osOpToOp ( int osOperation ) { } public void removeDropListener ( DropTargetListener listener ) { } boolean setEventData ( int theDrag , DNDEvent event ) { } public void setTransfer ( Transfer [ ] transferAgents ) { } void updateDragOverHover ( long delay , DNDEvent event ) { } }

Fix:
byte [ ] [ ] data = new byte [ 0 ] [ ] ;