Testing classes in com.sun hierarchy, IllegalAccessError in graphics but not base?

Kevin Rushforth kevin.rushforth at oracle.com
Mon Apr 24 12:47:42 UTC 2023


> However, my test is located in "com.sun.javafx.scene.layout", 

Don't you mean "test.com...."?

I guess you are asking how to export com.sun.javafx.scene.layout to the 
unnamed module, right? The list of exports is in:

modules/javafx.graphics/src/test/addExports

-- Kevin


On 4/23/2023 9:19 AM, John Hendrikx wrote:
> Hi list,
>
> I stumbled upon an odd issue; when I look at the Gradle output when 
> running tests for graphics, it has many lines like this:
>
>    --add-exports 
> javafx.graphics/com.sun.javafx.scene.layout.region=ALL-UNNAMED
>
> Basically one for every package in the com.sun hierarchy, or so I 
> thought...
>
> However, my test is located in "com.sun.javafx.scene.layout", and for 
> some reason it is not adding this line to the test build command.  
> This is resulting in an IllegalAccessError during building:
>
>  java.lang.IllegalAccessError: class 
> test.com.sun.javafx.scene.layout.SpaceDistributorTest (in unnamed 
> module @0x20d28811) cannot access class 
> com.sun.javafx.scene.layout.SpaceDistributor (in module 
> javafx.graphics) because module javafx.graphics does not export 
> com.sun.javafx.scene.layout to unnamed module @0x20d28811
>
> I've been digging through build.gradle for the past hour, and can't 
> really find what is controlling this.  There is another test in this 
> package (RegionTest) but for some reason everything in it is commented 
> out except "@Test public void dummy() {}".
>
> --John
>



More information about the openjfx-dev mailing list