JDK-8029979 : Allow multiple calls to DropTargetDropEvent.acceptDrop()
  • Type: Bug
  • Component: client-libs
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-12-11
  • Updated: 2014-07-29
  • Resolved: 2013-12-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
8u20Fixed 9 b06Fixed
Currently the DropTargetDropEvent.acceptDrop() method throws an exception if called multiple times while processing a single DnD event. Looking at its implementation it looks like there's no reason for this. The method only updates a few internal fields which are used when processing the dropComplete() operation. Therefore, before dropComplete() is invoked, the user code should be able to call the acceptDrop() method several times.

There's a JavaFX bug that depends on this possibility: https://javafx-jira.kenai.com/browse/RT-34283
[SQE] Regression test: test/java/awt/dnd/AcceptDropMultipleTimes/AcceptDropMultipleTimes.java [/SQE]

Sent for review: http://mail.openjdk.java.net/pipermail/awt-dev/2013-December/006637.html

A preliminary fix for this issue is at: http://cr.openjdk.java.net/~anthony/8-3-acceptDrop-8029979.0/ I enable calling SunDropTargetContextPeer.acceptDrop() as many times as needed, for as long as the DnD operation isn't complete yet. Running open and closed DnD regression tests revealed no new failures.

We will need this fix back-ported to 8u20.