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

Cannot create DataFlavor for array class type, of another mime than serialized.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs
    • None
    • generic
    • generic

      There is no way how to create DataFlavor for array class type object, with another mime type than application/x-java-serialized-object.

      I guess I already filled a bug, about more convenient constructor allowing to specify representation class also for other mime types like: application/x-java-jvm-local-objectref.

      I used trick which works for non-array classes, i.e.:

      new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType + "; class=java.lang.Object", null);

      but the same tactic doesn't work for array type:
      new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType + "; class=[Ljava.lang.Object;", null)

      where the last semicolon (;) which is necessary to specify the class name for array types is always trimmed in mime type parsing, thus it leads to ClassNotFoundException when constructing such DataFlavor.

            agerasimsunw Alexander Gerasimov (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: