EVALUATION
Additional API documentation about getModifiers or getModifiersEx in
java.awt.dnd.DragSourceDragEvent
###@###.### 2003-09-21
I ran my suggested fix by Alexander and he spoke to the submitter about it. He feels that to fix this properly requires both a software and a doc change. So, I am reclassifying this bug and assigning to him.
###@###.### 2003-10-29
Name: agR10216 Date: 11/26/2003
The folllowing CCC request was approved on 11/25/2003.
There was an additional discussion on compatibility risks,
refer to the section Comments.
4924527: java.awt.dnd.DragSourceDragEvent.getModifiers[Ex] and invalid modifiers
Release: tiger-beta
Type: bug-fix
Manager: jeff.dinkins
Engineer: ###@###.###
Problem
The constructors
java.awt.dnd.DragSourceDragEvent(DragSourceContext dsc, int dropAction,
int actions, int modifiers) and
java.awt.dnd.DragSourceDragEvent(DragSourceContext dsc, int dropAction,
int actions, int modifiers, int x, int y)
do not throw any exceptions if their argument modifiers is invalid.
This behavior, as well as the notion of 'invalid mofifiers' is specified.
The methods DragSourceDragEvent.getGestureModifiers() and
DragSourceDragEvent.getGestureModifiersEx() return the modifiers
passed to a constructor of this class and converted to old or
extended ones correspondingly.
For proper revision of JCK tests it's required to specify the behavior
of the methods getGestureModifiers() and getGestureModifiersEx() with
respect to invalid modifiers passed to a constructor of the class.
This is a red JCK bug.
There is a bug in determining which modifiers are invalid and in
converting them, so in addition to clarifying the spec we need to
update the implementation.
Requestors
Java Drag and Drop team
JCK team
Solution
Specify that getGestureModifiers() and getGestureModifiersEx() return
invalid modifiers unchanged and update the implementation of the class
DragSourceDragEvent accordingly.
Updating the implementation has minimal impact on compatibility since it
deals only with invalid modifiers. The fix includes adding of a private
field to the class; according to the serialization spec this is a compatible
change.
Interface summary
exported external method java.awt.dnd.DragSourceDragEvent.getGestureModifiers()
exported external method java.awt.dnd.DragSourceDragEvent.getGestureModifiersEx()
// If a private field that appears in the serialized form of the class must be taken into account, then:
exported external field java.awt.dnd.DragSourceDragEvent.invalidModifiers
Specification
java.awt.dnd.DragSourceDragEvent:
The following private field appear in the serialized form of the class:
+ /**
+ * Indicates whether the <code>gestureModifiers</code> are invalid.
+ *
+ * @serial
+ */
+ private boolean invalidModifiers;
/**
* This method returns an <code>int</code> representing
* the current state of the input device modifiers
* associated with the user's gesture. Typically these
* would be mouse buttons or keyboard modifiers.
* <P>
+ * If the <code>modifiers</code> passed to the constructor
+ * are invalid, this method returns them unchanged.
+ *
* @return the current state of the input device modifiers
*/
public int getGestureModifiers()
/**
* This method returns an <code>int</code> representing
* the current state of the input device extended modifiers
* associated with the user's gesture.
* See {@link InputEvent#getModifiersEx}
* <P>
+ * If the <code>modifiers</code> passed to the constructor
+ * are invalid, this method returns them unchanged.
+ *
* @return the current state of the input device extended modifiers
* @since 1.4
*/
public int getGestureModifiersEx()
Compatibility risk: minimal
###@###.### 2003-11-26
======================================================================
|