RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v7]

Oliver Kopp duke at openjdk.org
Thu Apr 25 12:58:49 UTC 2024


On Fri, 19 Apr 2024 17:33:39 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> I am new to testing in the JFX project. It seems that `test.` is required as package prefix. Thus, I did not use the approach of package-private methods and classes, but needed to make the class and the tested method public.
>> 
>> However, now I get the (expected) error that the module `javafx.graphics` does not export `com.sun.glass.ui.win` to unnamed module @0x1e6454ec.
>> 
>> 
>> class test.com.sun.glass.ui.win.WinTextRangeProviderTest (in unnamed module @0x1e6454ec) cannot access class com.sun.glass.ui.win.WinTextRangeProvider (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.ui.win to unnamed module @0x1e6454ec
>> java.lang.IllegalAccessError: class test.com.sun.glass.ui.win.WinTextRangeProviderTest (in unnamed module @0x1e6454ec) cannot access class com.sun.glass.ui.win.WinTextRangeProvider (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.ui.win to unnamed module @0x1e6454ec
>> 	at test.com.sun.glass.ui.win.WinTextRangeProviderTest.getValidStringIndex
>
>> module `javafx.graphics` does not export `com.sun.glass.ui.win` to unnamed module @0x1e6454ec.
> 
> I think you need to add
> 
> --add-exports javafx.graphics/com.sun.glass.ui.win=ALL-UNNAMED
> 
> to graphics/src/test/addExports
> (see line 7)
> 
> @kevinrushforth I wonder if there was a way to auto-generate addExports somehow, at least the part needed for the tests.

I put the `TextAreaTest.java`  into `tests\system\src\test\java\test\com\sun\glass\ui\win`. Cannot get it into run in Eclipse. Can you help me @andy-goryachev-oracle (refs https://github.com/openjdk/jfx/pull/1442#discussion_r1578005144). Background: To work on the issue mentioned by Ambarish, I need to do code and fix. Cleanroom development takes too much time for me here.

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

PR Comment: https://git.openjdk.org/jfx/pull/1442#issuecomment-2077116786


More information about the openjfx-dev mailing list