Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4123385
Votes 0
Synopsis spec for ctor java.awt.dnd.DragSourceDragEvent unclear
Category java:drag&drop
Reported Against 1.2 , tiger-beta
Release Fixed 1.5(tiger)
State 10-Fix Delivered, Verified, bug
Priority: 4-Low
Related Bugs 4219341 , 4219342 , 4908728 , 4911647 , 4924527
Submit Date 27-MAR-1998
Description


The specification for ctor
java.awt.dnd.DragSourceDragEvent(DragSourceContext, int dropActions,
int actions, int modifiers) does not specify behavior for argument 
'dropActions' and 'actions' when they are invalid. Currently ctor ingnores
invalid values. More acceptable behavior for all invalid actions here
is to throw IllegalArgumentException unless otherwise specified.
The same obscurity exists in ctors
DragSourceDropEvent(DragSourceContext, int action),
TargetDragEvent(DropTargetContext, Point, int dropAction, int srcAction),
DropTargetDropEvent(DropTargetContext, Point, int dropAction, int srcActions)
as well.

Here is what doc says:
--------------------------------------------------
ublic DragSourceDragEvent(DragSourceContext dsc,
                           int dropAction,
                           int actions,
                           int modifiers)

      construct a DragSourceEvent
--------------------------------------------------
======================================================================
Work Around
N/A
Evaluation


this (jck14a) test has the same problem:
api/java_awt/dnd/DragSourceDropEvent/index.html#Ctor2[DragSourceDropEvent0011]


======================================================================

Commit to fix in Hopper (JCK-exclude list).  
 xxxxx@xxxxx  2001-12-02 

Evaluation by the responsible engineer:  

> the bug 4123385 is committed to hopper. To fix it we need to
> 1) modify the behavior, so that IllegalArgumentException is thrown
> when invalid arguments are passed and 2) update the javadoc to specify
> this exception.

Since this is a request for an API change, I don't believe it can be fixed 
in Hopper.  We will submit a CCC request for the change the submitter has 
requested in Tiger.  

 xxxxx@xxxxx  2002-03-04





The following CCC request was approved:

 4123385: spec for ctor java.awt.dnd.DragSourceDragEvent unclear
 Release: Tiger
 Type: bug-fix
 Manager: jeff.dinkins
 Engineer:  xxxxx@xxxxx 
 
 Problem
 
 The following constructors (in java.awt.dnd package) throw
 IllegalArgumentException if the argument dsc is null, but
 it is not specified:
 DragSourceEvent(DragSourceContext dsc)
 DragSourceEvent(DragSourceContext dsc, int x, int y)
 DragSourceDragEvent(DragSourceContext dsc, int dropAction,
                     int actions, int modifiers)
 DragSourceDragEvent(DragSourceContext dsc, int dropAction,
                     int actions, int modifiers, int x, int y)
 DragSourceDropEvent(DragSourceContext dsc)
 DragSourceDropEvent(DragSourceContext dsc, int action,
                     boolean success)
 DragSourceDropEvent(DragSourceContext dsc, int action,
                     boolean success, int x, int y)
 
 The constructors
 DragSourceDragEvent(DragSourceContext dsc, int dropAction,
                     int actions, int modifiers) and
 DragSourceDragEvent(DragSourceContext dsc, int dropAction,
                     int actions, int modifiers, int x, int y)
 do not throw any exceptions if their arguments dropAction,
 actions or modifiers are invalid, but it is not specified.
 
 The ctors
 DragSourceDropEvent(DragSourceContext dsc, int action,
                                       boolean success) and
 DragSourceDropEvent(DragSourceContext dsc, int action,
                         boolean success, int x, int y)
 do not throw any exeptions if their argument action is
 invalid, but it is not specified.
 
 There are 3 JCK bugs on these issues:
 4123385 [spec for ctor java.awt.dnd.DragSourceDragEvent unclear]
 4219341 [incomplete doc for java.awt.dnd.DragSourceDragEvent]
 4219342 [incomplete doc for java.awt.dnd.DragSourceDropEvent]
 
 Since behavior changes are objectionable, the current behavior
 should be specified for JCK testing.
 
 
 Requestors
 Java Drag and Drop team
 JCK team
 
 
 Solution
 
 Specify the current behavior with respect to invalid arguments
 passed to the constructors in question.
 
 
 Interface summary
 
 exported  external  method  java.awt.dnd.DragSourceEvent(DragSourceContext dsc, int x, int y)
                                          DragSourceEvent(DragSourceContext dsc, int x, int y)
                                          DragSourceDragEvent(DragSourceContext dsc, int dropAction,
                                                              int actions, int modifiers)
                                          DragSourceDragEvent(DragSourceContext dsc, int dropAction,
                                                              int actions, int modifiers, int x, int y)
                                          DragSourceDropEvent(DragSourceContext dsc)
                                          DragSourceDropEvent(DragSourceContext dsc, int action,
                                                              boolean success)
                                          DragSourceDropEvent(DragSourceContext dsc, int action,
                                                              boolean success, int x, int y)
 
                         
 Specification
 
 java.awt.dnd:
 
     /**
      * Construct a <code>DragSourceEvent</code>
      * given a specified <code>DragSourceContext</code>.
      * The coordinates for this <code>DragSourceEvent</code>
      * are not specified, so <code>getLocation</code> will return
      * <code>null</code> for this event.
      *
      * @param dsc the <code>DragSourceContext</code>
 +    *
 +    * @throws <code>IllegalArgumentException</code> if <code>dsc</code> is <code>null</code>.
 +    *
      * @see #getLocation
      */
 
     public DragSourceEvent(DragSourceContext dsc)
 
 
     
     /**
      * Construct a <code>DragSourceEvent</code> given a specified
      * <code>DragSourceContext</code>, and coordinates of the cursor
      * location.
      *
      * @param dsc the <code>DragSourceContext</code>
      * @param x   the horizontal coordinate for the cursor location
      * @param y   the vertical coordinate for the cursor location
 +    *
 +    * @throws <code>IllegalArgumentException</code> if <code>dsc</code> is <code>null</code>.
 +    *
      * @since 1.4
      */
     public DragSourceEvent(DragSourceContext dsc, int x, int y)
 
 
 
     /**
      * Constructs a <code>DragSourceDragEvent</code>.
      * This class is typically
      * instantiated by the <code>DragSourceContextPeer</code>
      * rather than directly
      * by client code.
      * The coordinates for this <code>DragSourceDragEvent</code>
      * are not specified, so <code>getLocation</code> will return
      * <code>null</code> for this event.
 +    * <p>
 +    * The arguments <code>dropAction</code> and <code>action</code> should
 +    * be one of <code>DnDConstants</code> that represents a single action.
 +    * The argument <code>modifiers</code> should be either a bitwise mask
 +    * of old <code>java.awt.event.InputEvent.*_MASK</code> constants or a
 +    * bitwise mask of extended <code>java.awt.event.InputEvent.*_DOWN_MASK</code>
 +    * constants.
 +    * This constructor does not throw any exception for invalid <code>dropAction</code>,
 +    * <code>action</code> and <code>modifiers</code>.
      *
      * @param dsc the <code>DragSourceContext</code> that is to manage
      *            notifications for this event.
      * @param dropAction the user drop action.
      * @param action the target drop action.
      * @param modifiers the modifier keys down during event (shift, ctrl,
      *        alt, meta)
      *        Either extended _DOWN_MASK or old _MASK modifiers
      *        should be used, but both models should not be mixed
      *        in one event. Use of the extended modifiers is
      *        preferred.
 +    *
 +    * @throws <code>IllegalArgumentException</code> if <code>dsc</code> is <code>null</code>.
 +    *
      * @see java.awt.event.InputEvent
      * @see DragSourceEvent#getLocation
      */
 
     public DragSourceDragEvent(DragSourceContext dsc, int dropAction,
                                int action, int modifiers)
     
 
 
     /**
      * Constructs a <code>DragSourceDragEvent</code> given the specified
      * <code>DragSourceContext</code>, user drop action, target drop action,
      * modifiers and coordinates.
 +    * <p>
 +    * The arguments <code>dropAction</code> and <code>action</code> should
 +    * be one of <code>DnDConstants</code> that represents a single action.
 +    * The argument <code>modifiers</code> should be either a bitwise mask
 +    * of old <code>java.awt.event.InputEvent.*_MASK</code> constants or a
 +    * bitwise mask of extended <code>java.awt.event.InputEvent.*_DOWN_MASK</code>
 +    * constants.
 +    * This constructor does not throw any exception for invalid <code>dropAction</code>,
 +    * <code>action</code> and <code>modifiers</code>.
      *
      * @param dsc the <code>DragSourceContext</code> associated with this
      *        event.
      * @param dropAction the user drop action.
      * @param action the target drop action.
      * @param modifiers the modifier keys down during event (shift, ctrl,
      *        alt, meta)
      *        Either extended _DOWN_MASK or old _MASK modifiers
      *        should be used, but both models should not be mixed
      *        in one event. Use of the extended modifiers is
      *        preferred.
      * @param x   the horizontal coordinate for the cursor location
      * @param y   the vertical coordinate for the cursor location
 +    *
 +    * @throws <code>IllegalArgumentException</code> if <code>dsc</code> is <code>null</code>.
 +    *
      * @see java.awt.event.InputEvent
      * @since 1.4
      */
     public DragSourceDragEvent(DragSourceContext dsc, int dropAction,
                                int action, int modifiers, int x, int y)
 
 
                                
     /**
      * Construct a <code>DragSourceDropEvent</code>
      * for a drag that does not result in a drop.
      * The coordinates for this <code>DragSourceDropEvent</code>
      * are not specified, so <code>getLocation</code> will return
      * <code>null</code> for this event.
      *
      * @param dsc the <code>DragSourceContext</code>
 +    *
 +    * @throws <code>IllegalArgumentException</code> if <code>dsc</code> is <code>null</code>.
 +    *
      * @see DragSourceEvent#getLocation
      */
 
     public DragSourceDropEvent(DragSourceContext dsc)
 
 
     
     /**
      * Construct a <code>DragSourceDropEvent</code> for a drop,
      * given the
      * <code>DragSourceContext</code>, the drop action,
      * and a <code>boolean</code> indicating if the drop was successful.
      * The coordinates for this <code>DragSourceDropEvent</code>
      * are not specified, so <code>getLocation</code> will return
      * <code>null</code> for this event.
 +    * <p>
 +    * The argument <code>action</code> should be one of <code>DnDConstants</code>
 +    * that represents a single action.
 +    * This constructor does not throw any exception for invalid <code>action</code>.
      *
      * @param dsc the <code>DragSourceContext</code>
      * associated with this <code>DragSourceDropEvent</code>
      * @param action the drop action
      * @param success a boolean indicating if the drop was successful
 +    *
 +    * @throws <code>IllegalArgumentException</code> if <code>dsc</code> is <code>null</code>.
 +    *
      * @see DragSourceEvent#getLocation
      */
 
     public DragSourceDropEvent(DragSourceContext dsc, int action, boolean success)
 
 
     
     /**
      * Construct a <code>DragSourceDropEvent</code> for a drop, given the
      * <code>DragSourceContext</code>, the drop action, a <code>boolean</code>
      * indicating if the drop was successful, and coordinates.
 +    * <p>
 +    * The argument <code>action</code> should be one of <code>DnDConstants</code>
 +    * that represents a single action.
 +    * This constructor does not throw any exception for invalid <code>action</code>.
      *
      * @param dsc the <code>DragSourceContext</code>
      * associated with this <code>DragSourceDropEvent</code>
      * @param action the drop action
      * @param success a boolean indicating if the drop was successful
      * @param x   the horizontal coordinate for the cursor location
      * @param y   the vertical coordinate for the cursor location
 +    *
 +    * @throws <code>IllegalArgumentException</code> if <code>dsc</code> is <code>null</code>.
 +    *
      * @since 1.4
      */
     public DragSourceDropEvent(DragSourceContext dsc, int action,
                                boolean success, int x, int y)
                                
 
                                
 Compatibility risk: minimal


 xxxxx@xxxxx   2003-07-25


======================================================================
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang