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

DataFlavor.clone() throws NullPointerException

    Details

    • Subcomponent:
    • Resolved In Build:
      1.2.2
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      Name: sdC67446 Date: 10/15/98


      The method DataFlavor.clone() throws NullPointerException
      if class instance was created with constructor DataFlavor().

      The doc says:
      --------------------------------------------------
      public Object clone()
                            throws CloneNotSupportedException

            Returns:
                  a clone of this DataFlavor
            Overrides:
                  clone in class Object

      The test demonstrating the bug:
      -----------------Test.java------------------------
      import java.awt.datatransfer.*;

      public class Test {
        public static void main(String[] args) {
          try {
              DataFlavor df1 = new DataFlavor();
              Object df2 = df1.clone();
          } catch (CloneNotSupportedException e) {
              System.out.println("unexpected exception: "+e);
          }
        }
      }
      ---------Output from the test---------------------
      Exception in thread "main" java.lang.NullPointerException
              at java.awt.datatransfer.DataFlavor.clone(Compiled Code)
              at Test.main(Compiled Code)
      --------------------------------------------------
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              xdengsunw Xianfa Deng (Inactive)
              Reporter:
              sdmitriesunw Sergei Dmitriev (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: