On Wed, 19 Nov 2025 09:59:36 GMT, Jaikiran Pai <[email protected]> wrote:
>> test/jdk/java/net/httpclient/http2/BurstyRequestsTest.java line 195:
>>
>>> 193: // using reflection, return the
>>> jdk.internal.net.http.HttpClientImpl instance held
>>> 194: // by the given client
>>> 195: private static Object reflectHttpClientImplInstance(final
>>> HttpClient client) throws Exception {
>>
>> Instead, you can use `Http3ConnectionAccess::impl` too.
>
> Hello Volkan, I wasn't aware of this test class and it looks like it has been
> minimally used. The `impl()` method on that test class is a package private
> method which then means that I will have to include a `package` statement to
> this new test itself. Or change the `impl()` method to `public`. For now I
> decided to not fiddle with it. If you would like me to pursue it further in
> this PR, let me know and I can do that.
The idea is to use the `access` library to inject classes in (internal)
packages when you need access to package protected APIs. That would not work
for anything private - unless the injected class uses Lookup.privateLookupIn()
to access the target class private APIs. The advantage is that it avoids to
redefine the `@modules` - you don't need the additional `+open` when the
accessor class (a public class) is already injected in the package
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28233#discussion_r2541952047