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

[macosx] MalformedURLException is thrown during reading data for application/x-java-url;class=java.net.URL flavor

    XMLWordPrintable

Details

    • b80
    • os_x

    Backports

      Description

        On Mac OS, the system clipboard containing item copied from Finder throws exception MalformedURLException exception for application/x-java-url;class=java.net.URL flavor.
        Test case:

        import java.awt.*;
        import java.awt.datatransfer.*;

        public class PlainText {
            public static void main(String [] args) {
                try {
                    Clipboard board = Toolkit.getDefaultToolkit().getSystemClipboard();
                    System.out.println(board.getData(new DataFlavor("application/x-java-url;class=java.net.URL")));
                }
                catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }

        Mac Os X pasteboard returns a property list that consists of one URL,
        but our code supposes to get pure URL.

        Attachments

          Issue Links

            Activity

              People

                mcherkas Mikhail Cherkasov (Inactive)
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: