On Fri, 10 Apr 2026 06:07:44 GMT, Jaikiran Pai <[email protected]> wrote:

>> Alan Bateman has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Move test sources into text blocks
>
> src/java.base/share/classes/java/util/ServiceLoader.java line 624:
> 
>> 622:         try {
>> 623:             ctor = clazz.getConstructor();
>> 624:         } catch (NoSuchMethodException | LinkageError e) {
> 
> Hello Alan, unlike `Class.forName(...)` which specifies the `LinkageError` 
> from that method, the `Class.getConstructor()` doesn't currently specify this 
> error. Should that documentation be updated (as a separate work) to specify 
> this?

There is discussion about that in a few JBS issues, esp. in the JDK 9 time 
frame and in the context of code using reflective guards to deal with optional 
dependences. I don't think there was a conclusion to change 
Class.getConstructor docs to align with existing behavior.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/30405#discussion_r3062477884

Reply via email to