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

DataFlavor.isFlavorJavaFileListType() works wrong

    XMLWordPrintable

    Details

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

      Description



      Name: sdC67446 Date: 09/10/98


      The method DataFlavor.isFlavorJavaFileListType() returns false if
      instance's representationClass is subclass/subinterface of
      java.util.List. True should be returned.
      The method returns true if representationClass == java.util.List only.

      The doc says:
      --------------------------------------------------
      public boolean isFlavorJavaFileListType()

            Returns:
                  if flavor specified represents a List of File objects

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

      public class Test {

        public static void main(String[] args) {
             
          DataFlavor df = new DataFlavor("application", "x-java-file-list",
                                          null, java.util.List.class, "");
          System.out.println(df.isFlavorJavaFileListType());

          df = new DataFlavor("application", "x-java-file-list",
      null, java.util.ArrayList.class, "");
          System.out.println(df.isFlavorJavaFileListType());
        }
      }
      ---------Output from the test---------------------
      true
      false
      --------------------------------------------------

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

        Attachments

          Activity

            People

            Assignee:
            prssunw Prs Prs (Inactive)
            Reporter:
            sdmitriesunw Sergei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: