On Wed, 19 Nov 2025 13:09:52 GMT, Daniel Fuchs <[email protected]> wrote:

>> 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

I have updated the PR to apply this suggestion of using a 
`HttpClientImplAccess` to peek into the internal field. This does avoid all the 
`@modules` in the test definition. The test continues to pass with this change. 
I've triggered a CI run with these changes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28233#discussion_r2546184156

Reply via email to