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

java.awt.dnd.DragSource.createDragSourceContext: null reaction needed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • docs
    • sparc
    • solaris_7



      Name: sdR10048 Date: 07/23/2001


      Javadoc for
      protected DragSourceContext createDragSourceContext(
                                      DragSourceContextPeer,
                                      DragGestureEvent,
                                      Cursor,
                                      Image,
                                      Point,
                                      Transferable,
                                      DragSourceListener)

      method does not describe expected reaction when null is passed in.
      As "Requirements for Writing Java API Specifications" say:
       (http://java.sun.com/j2se/javadoc/writingapispecs/index.html#method)

      Method Specification
          This section applies to Java methods and constructors. Each method and
          constructor specification must include:
          .....
      4.Null Argument Values - For each reference type argument, specify the behavior
        when null is passed in.See two examples. NOTE: If possible, document the general
        null argument behavior at the package or class level, such as causing a
        java.lang.NullPointerException to be thrown. Deviations from this behavior can
        then be documented at the method level.


      JavaTM 2 Platform Std. Ed. v1.4.0 reads about DragSource.createDragSourceContext() method:
      ...
      protected DragSourceContext createDragSourceContext(java.awt.dnd.peer.DragSourceContextPeer
         dscp, DragGestureEvent dgl, Cursor dragCursor, Image dragImage, Point imageOffset,
         Transferable t, DragSourceListener dsl)

      Create the DragSourceContext to handle this drag. To incorporate a new DragSourceContext
      subclass, subclass DragSource and override this method.

      Parameters:
          dscp - The DragSourceContextPeer for this drag
          trigger - The DragGestureEvent that triggered the drag
          dragCursor - The initial Cursor to display
          dragImage - The Image to drag or null
          imageOffset - The offset of the Image origin from the hotspot of the cursor at the instant of the trigger
          transferable - The subject data of the drag
          dsl - The DragSourceListener

      Returns:
         the DragSourceContext
      ...

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

            shommel Scott Hommel (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: