<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 16/06/2025 19:48, Philip Race wrote:<br>
<blockquote type="cite" cite="mid:c64ea4b0-ccda-49b9-acb1-66a925f9c997@oracle.com">
<br>
>A migration from AudioClip to SoundClip would require all
usages to change too.<br>
>I think for now that it should be okay to just the mapping
from MultimediaContentHandlers so that it returns null. <br>
<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: -webkit-standard; font-size: medium; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline !important; float: none;"><br>
For clarity, this handler/provider returning null does not mean
that null is what is returned to the application.<br>
I haven't completely traced it, but it looks like the java.net
implementation will fall back to returning the<br>
content as a stream of bytes.<br>
</span></blockquote>
<br>
Right, a ContentHandler can return null but the
URLConnection::getContent API always returns something when content
can be fetch from the URL. URLConnection.UnknownContentHandler is
the lender of last resort.<br>
<br>
<br>
<blockquote type="cite" cite="mid:c64ea4b0-ccda-49b9-acb1-66a925f9c997@oracle.com"> <br>
For the audio cases, if I return SoundClip it is possible for
application code to migrate,<br>
just as I did for the two regression tests. But if I return null,
they have a bigger migration issue.<br>
</blockquote>
<br>
I agree that returning a SoundClip gives a migration path, it's more
defensible than not mapping.<br>
<br>
<br>
<br>
<blockquote type="cite" cite="mid:c64ea4b0-ccda-49b9-acb1-66a925f9c997@oracle.com"> <br>
Perhaps even if these APIs still have a use for applications
which install their own handlers and<br>
so have knowledge about it.<br>
<br>
For applications that expect an ImageProducer, or an AudioClip,
they must have worked out<br>
what to expect by inspection - and this is going back to JDK 1.0 /
1.1 days<br>
<br>
The docs have always (since 1.0) said<br>
'<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: -webkit-standard; font-size: medium; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline !important; float: none;">The<span class="Apple-converted-space"> </span></span><code style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">instanceOf</code><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: -webkit-standard; font-size: medium; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline !important; float: none;"><span class="Apple-converted-space"> </span>operation should be used
to determine the specific kind of object returned.'<br>
<br>
Perhaps we can consider deprecating [*] (and later removing) the
</span>MultimediaContentHandlers ?<br>
After all if you have a jlinked image w/o the desktop module,
you'll not be able to us them anyway.<br>
</blockquote>
<br>
<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: -webkit-standard; font-size: medium; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline !important; float: none;"></span>In
the jlink case, you'd have to include java.desktop if the
application, or a library, has a static depending on
java.awt.image.* types. So yes, you would get different behavior
depending on whether the java.desktop module is in the run-time
image but only if the application isn't using instanceof.<br>
<br>
No objection if we try to work towards dropping these mappings, just
not clear how much testing there is with EA builds to shake out any
common usages that we can't think of.<br>
<br>
-Alan<br>
</body>
</html>