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

Drag and Drop of TextField and JTextField throws "NullPointerException"

    Details

    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      When the TextField and JTextField is Dragged and Dropped, an "NullPointerException" is thrown. The bug happens on Merlin build 49, it did not happen on build 48. The bug is reproducible on all windows, Solaris and Linux platforms.

      How to produce the Bug:
      -----------------------
      Complie all the attached java files.
      Run SampleCode.java file.
      Try Drag and Drop of TextField.
      If you find the following Exception,the bug is reprodued.

      Exception:
      Exception : java.lang.NullPointerException
      java.lang.NullPointerException
              at sun.awt.datatransfer.DataTransferer$CharsetComparator.compareCharsets
      (DataTransferer.java:1635)
              at sun.awt.datatransfer.DataTransferer$DataFlavorComparator.compare(Data
      Transferer.java:1867)
              at java.awt.datatransfer.DataFlavor$TextFlavorComparator.compare(DataFla
      vor.java:568)
              at java.util.Collections.max(../../../src/share/classes/java/util/Collec
      tions.java:649)
              at java.awt.datatransfer.DataFlavor.selectBestTextFlavor(DataFlavor.java
      :526)
              at dndTextFieldTarget.drop(dndTextFieldTarget.java:136)
              at java.awt.dnd.DropTarget.drop(DropTarget.java:400)
              at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTarget
      ContextPeer.java:584)
              at sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextP
      eer.java:58)
              at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEven
      t(SunDropTargetContextPeer.java:838)
              at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(Su
      nDropTargetContextPeer.java:776)
              at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:32)
              at java.awt.Component.dispatchEventImpl(Component.java:3345)
              at java.awt.Component.dispatchEvent(Component.java:3327)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:437)
              at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:14
      0)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:126)

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:121)

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
      java.lang.NullPointerException
              at dndTextFieldTarget.drop(dndTextFieldTarget.java:157)
              at java.awt.dnd.DropTarget.drop(DropTarget.java:400)
              at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTarget
      ContextPeer.java:584)
              at sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextP
      eer.java:58)
              at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEven
      t(SunDropTargetContextPeer.java:838)
              at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(Su
      nDropTargetContextPeer.java:776)
              at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:32)
              at java.awt.Component.dispatchEventImpl(Component.java:3345)
              at java.awt.Component.dispatchEvent(Component.java:3327)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:437)
              at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:14
      0)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:126)

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:121)

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

      -----------------------------


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dmendenhsunw David Mendenhall (Inactive)
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: