Semantics of Desktop.browse
While testing an unexpected behavior (https://jdic.dev.java.net/issues/show_bug.cgi?id=130) in a development branch, a question of the behavior of Desktop.browse(url) arose. Does browse a URL mean: behavior A, use the desktop protocol associations to find the application to open the URL; or behavior B, use the default web browser to open the URL?
This code branch has added protocol associations. You can retrieve an association for "http" and execute the open action with the URL as the argument.
Behavior A could be implemented as getProtocolAssociation(url.getProtocol()).getAction("open").execute(url).
The original intent of browse(url) was behavior B. This could be implemented as getProtocolAssociation("http").getAction("open").execute(url).
For example, I have my desktop associations set up so that Mozilla is my web browser and Outlook is my mail client. Calling Desktop.browse("mailto:firstname.lastname@example.org") will: with behavior A, launch Outlook; with behavior B, launch the Mozilla mail client.
Which behavior are developers and end users expecting?