On Wed, 10 Sep 2025 11:26:28 GMT, Ambarish Rapte <ara...@openjdk.org> wrote:

> When using `-PTEST_SDK_PATH=<path>` and `-PTEST_ONLY=true`, the test 
> `HeaderButtonOverlayTest` fails to compile with error: _package 
> com.sun.glass.events is not visible_
> 
> The test compiles and executes fine with normal command: `gradle 
> :graphics:test`.
> In this case the JavaFX is built locally and the 
> `com.sun.glass.events.MouseEvent` class file becomes reachable through 
> classpath. A bug is filed to investigate this separately : 
> [JDK-8367327](https://bugs.openjdk.org/browse/JDK-8367327)
> 
> Fix is quick, to update the `modules/javafx.graphics/src/test/addExports`.

Good catch. This is an obviously correct fix.

As noted, the reason this wasn't caught earlier is that due to 
[JDK-8367327](https://bugs.openjdk.org/browse/JDK-8367327), tests accessing 
internal packages will compile even without the package being exported in the 
`addExports` files. It won't be available at runtime, but since 
`HeaderButtonOverlayTest` only uses static constants that are resolved at 
compile-time, it didn't actually try to load a class from that package at 
runtime.

Given that this is a trivially correct test-only fix, a single reviewer is 
sufficient and there is no need to wait for 24 hours.

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

Marked as reviewed by kcr (Lead).

PR Review: https://git.openjdk.org/jfx/pull/1891#pullrequestreview-3205835871

Reply via email to