JDK-6691328 : DragSourceContext returns unexpected cursor
  • Type: Bug
  • Status: Closed
  • Resolution: Fixed
  • Component: client-libs
  • Sub-Component: java.awt
  • Priority: P3
  • Affected Version: OpenJDK6,7
  • OS: generic
  • CPU: generic
  • Submit Date: 2008-04-21
  • Updated Date: 2012-03-22
  • Resolved Date: 2011-05-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 Availabitlity Release.

To download the current JDK release, click here.
JDK 7
7 b29Fixed
Related Reports
Relates :  
Relates :  
Description
Test case
api/java_awt/dnd/DragSourceContext/index.html#other[DragSourceContext0012]

Fails on:
*openJDK 6*: b08 (/java/re/openjdk/6/promoted/ea/b08/openjdk/binaries/linux-ubuntu)
*JCK*: 6b b21 JCK-runtime
*platform*:  ubuntu 8.10 (Hardy Heron), Windows
Passes on: *JDK6uX*

For java.awt.dnd.DragSourceContext if current cursor is null, after updateCurrentCursor() operation, method getCursor() returns unexpected result - instead of DragSource.DefaultCopyDrop it returns DragSource.DefaultCopyNoDrop.

Please see attached independent test source.
It fails with the message:
bad cursor: sun.awt.windows.WCustomCursor[CopyNoDrop32x32], expected: sun.awt.windows.WCustomCursor[CopyDrop32x32] 
or
bad cursor: sun.awt.X11.XCustomCursor[CopyNoDrop32x32], expected: sun.awt.X11.XCustomCursor[CopyDrop32x32]

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/awt_data/7/6691328/
2008-05-28

EVALUATION This is a regression of the fix for 6535356. The fix incorrectly modifies the updateCurrentCursor method of the java.awt.dnd.DragSourceContext class, by mistake the target actions is set to DnDConstants.ACTION_NONE; the udiffs are: // do defaults processing Cursor c = null; + targetAct = DnDConstants.ACTION_NONE; switch (status) { - default: - targetAct = DnDConstants.ACTION_NONE; case ENTER: case OVER: case CHANGED: int ra = sourceAct & targetAct;
2008-05-27