-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.2.1
-
x86
-
windows_nt
Name: mm8553 Date: 05/17/99
1.DragGestureEvent.startDrag() with parameter Transferable=null
crashes VM.
If I have a Transferable object which is a null reference
then the VM of this code snippet crashes!!! This occurs
only if I drag and drop between different VMs, i.e. in the
same VM it throws a NullPointerException.
2. Code:
class DGListener implements DragGestureListener {
private int acceptableActions = DnDConstants.ACTION_MOVE;
public void dragGestureRecognized(DragGestureEvent e) {
System.out.println(e.getDragAction());
if((e.getDragAction() & acceptableActions) == 0) {
return;
}
Transferable transferable = new StringTransferable( null );
try {
e.startDrag(DragSource.DefaultCopyNoDrop,transferable,...);
}
catch( InvalidDnDOperationException idoe ) {
System.err.println( idoe );
}
}
}
3. When I drag and drop between the same VM:
java.lang.NullPointerException
at edit.DTListener.drop(DTListener.java:147)
at java.awt.dnd.DropTarget.drop(DropTarget.java:343)
at sun.awt.windows.WDropTargetContextPeer.processDropMessage(WDropTarget
ContextPeer.java:941)
at sun.awt.windows.WDropTargetContextPeer.run(WDropTargetContextPeer.jav
a:472)
at javax.swing.SystemEventQueueUtilities.processRunnableEvent(SystemEven
tQueueUtilities.java:354)
at javax.swing.SystemEventQueueUtilities.access$0(SystemEventQueueUtilit
ies.java:350)
at javax.swing.SystemEventQueueUtilities$RunnableTarget.processEvent(Sys
temEventQueueUtilities.java:391)
at java.awt.Component.dispatchEventImpl(Component.java:2376)
at java.awt.Component.dispatchEvent(Component.java:2289)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:258)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:68)
When I drag and drop between different VMs this is the error
message of the DropTarget VM (not the DragSource VM which
crashes!):
Couldn't get transfer data: class java.io.IOException:no native data was transfe
rred caught while getting Data
java.io.IOException: class java.io.IOException:no native data was transferred ca
ught while getting Data
at java.awt.dnd.DropTargetContext$TransferableProxy.getTransferData(Drop
TargetContext.java:270)
at edit.DropLabel$DTListener.drop(DropLabel.java:200)
at java.awt.dnd.DropTarget.drop(DropTarget.java:343)
at sun.awt.windows.WDropTargetContextPeer.processDropMessage(WDropTarget
ContextPeer.java:941)
at sun.awt.windows.WDropTargetContextPeer.run(WDropTargetContextPeer.jav
a:472)
at javax.swing.SystemEventQueueUtilities.processRunnableEvent(SystemEven
tQueueUtilities.java:354)
at javax.swing.SystemEventQueueUtilities.access$0(SystemEventQueueUtilit
ies.java:350)
at javax.swing.SystemEventQueueUtilities$RunnableTarget.processEvent(Sys
temEventQueueUtilities.java:391)
at java.awt.Component.dispatchEventImpl(Component.java:2376)
at java.awt.Component.dispatchEvent(Component.java:2289)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:258)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:68)
4. Dr. Watson from WinNT appears with a Segmentation Fault (0xc0000005); address (0x080370c0)
5. java version "1.2.1"
HotSpot VM (1.0fcs, mixed mode, build E)
6. I have a PentiumII-400 with WinNT Service Pack 4 and 128MB
(Review ID: 58066)
======================================================================
- duplicates
-
JDK-4250859 On NT, setting the clipboard to StringSelection(null) causes NPE
-
- Resolved
-