<div dir="ltr"><div>Please forgive me if this is the wrong medium to report this.</div><div><br></div><div>I've found an issue with the change in the ServiceLoader. Specifically, the getConstructor()[1] method. Previously, the method caught Throwable and then fail which would throw a java.util.ServiceConfigurationError exception. With the changes, only a catches a NoSuchMethodException and throws a ServiceConfigurationError then. Is this change in behavior expected?</div><div><br></div><div>For some background on how I found this. I had a legitimate classpath issue missing a CDI dependency. However, the constructor was throwing a NoClassDefFoundException because of the missing required class. In versions less than Java 24 this was okay because Throwable was caught. In Java 24 and 25 early access, this is an issue because the NoClassDefFoundException is thrown instead of it being wrapped in a ServiceConfigurationError.</div><div><br></div><div>[1]: <a href="https://github.com/openjdk/jdk/commit/abacece8265996aaec888c8f109f2e476ec7a8e3#diff-32ee5f2b2ad157956f95f404ef7001d8a1ca597ff07f4eb88181309a606af199L647-L668">https://github.com/openjdk/jdk/commit/abacece8265996aaec888c8f109f2e476ec7a8e3#diff-32ee5f2b2ad157956f95f404ef7001d8a1ca597ff07f4eb88181309a606af199L647-L668</a></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px;padding:0px;font-size:14px"><span style="font-weight:bold"><br></span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px;padding:0px;font-size:14px"><span style="font-weight:bold">James R.</span><span style="font-weight:bold"> </span><span style="font-weight:bold">Perkins</span><br></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px"><span style="text-transform:uppercase;color:rgb(170,170,170);margin:0px"></span></p><p style="margin:0px"><font color="#000000" face="RedHatText, sans-serif"><span style="font-size:12px">Principal</span></font><span style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px"> Software Engineer</span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px 0px 8px;font-size:12px"><a href="https://www.redhat.com/" style="color:rgb(0,136,206);margin:0px" target="_blank">Red Hat<span></span></a></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-bottom:8px"></div><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;height:50px;display:flex;margin-top:8px"><a href="https://www.redhat.com/" target="_blank"><img src="https://static.redhat.com/libs/redhat/brand-assets/2/corp/logo--500.png" height="25px" width="auto"></a></div></div></div></div><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Nov 13, 2024 at 11:44 PM Alan Bateman <<a href="mailto:alanb@openjdk.org">alanb@openjdk.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 13 Nov 2024 10:32:34 GMT, Alan Bateman <<a href="mailto:alanb@openjdk.org" target="_blank">alanb@openjdk.org</a>> wrote:<br>
<br>
> Remove code required for the now defunct SecurityManager execution mode from java.lang.Class, friends, and reflection APIs. Careful review is required so I've set Reviewer to 2. I've tried to keep the changes as easy to review as possible and not go over board with cleanup.<br>
> <br>
> sun.reflect.misc.ReflectUtil are been hollowed out. A future pass will remove empty methods and qualified exports once the changes in "far away" code and modules is done.<br>
> <br>
> In Lookup's class description, the removal of the sentence "avoid package access checks for classes accessible to the lookup class"  and the link to the removed "Security manager interactions" section is in discussion/non-normative text, just missed in the JEP 486 update that remove the linked section.<br>
> <br>
> runtime/cds/appcds/StaticArchiveWithLambda.java is updated as creating the archive no longer skips a generated class.<br>
> <br>
> Testing: tier1-5<br>
<br>
This pull request has now been integrated.<br>
<br>
Changeset: abacece8<br>
Author:    Alan Bateman <<a href="mailto:alanb@openjdk.org" target="_blank">alanb@openjdk.org</a>><br>
URL:       <a href="https://git.openjdk.org/jdk/commit/abacece8265996aaec888c8f109f2e476ec7a8e3" rel="noreferrer" target="_blank">https://git.openjdk.org/jdk/commit/abacece8265996aaec888c8f109f2e476ec7a8e3</a><br>
Stats:     1254 lines in 26 files changed: 6 ins; 1094 del; 154 mod<br>
<br>
8344011: Remove usage of security manager from Class and reflective APIs<br>
<br>
Reviewed-by: liach, yzheng, rriggs<br>
<br>
-------------<br>
<br>
PR: <a href="https://git.openjdk.org/jdk/pull/22063" rel="noreferrer" target="_blank">https://git.openjdk.org/jdk/pull/22063</a><br>
<br>
</blockquote></div>