Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4141121

unclear spec for ctor java.awt.dnd.DragSourceContext

XMLWordPrintable

    • 1.2.2
    • sparc
    • solaris_2.5



      Name: sdC67446 Date: 05/22/98


      spec for constructor
      java.awt.dnd.DragSourceContext(java.awt.dnd.peer.DragSourceContextPeer dscp,
      DragGestureEvent trigger, Cursor dragCursor, Image dragImage, Point dragOrigin,
      Transferable t, DragSourceListener dsl) says nothing about behavior for
      null parameters.
      Currently ctor throws NullPointerException for parameters:
      dscp, trigger and t, and ignore null for other parameters.

      More convenient behavior here is to throw NullPointerException
      for all null parameters or else it should be figured in spec.

      Also ctor throws unexpected NullPointerException and IllegalArgumentException
      if trigger instance is incomplete:
      trigger.getComponent()==null,
      trigger.getDragSource()==null,
      trigger.getDragAction()==DnDConstants.ACTION_NONE,
      rigger.getSourceAsDragGestureRecognizer().getSourceActions()) == DnDConstants.ACTION_NONE.

      Here is what doc says:
      --------------------------------------------------
      public DragSourceContext(java.awt.dnd.peer.DragSourceContextPeer dscp,
                               DragGestureEvent trigger,
                               Cursor dragCursor,
                               Image dragImage,
                               Point offset,
                               Transferable t,
                               DragSourceListener dsl)

            construct a DragSourceContext (called from DragSource)
            Parameters:
                  dscp - The DragSourceContextPeer for this Drag
                  trigger - The triggering event
                  dragCursor - The initial Cursor
                  dragImage - The image to drag (or null)
                  offset - The offset of the image origin from
                           the hotspot at the instant of the
                           triggering event
                  t - The Transferable
                  dsl - The DragSourceListener

      --------------------------------------------------
      ======================================================================

            shommel Scott Hommel (Inactive)
            sdmitriesunw Sergei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: