RFR: 8340899: Remove wildcard bound in PositionWindows.positionTestWindows

Alexey Ivanov aivanov at openjdk.org
Wed Sep 25 11:53:35 UTC 2024


On Wed, 25 Sep 2024 11:31:38 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> Removes the wildcard bound from `PassFailJFrame.PositionWindows.positionTestWindows` so that implementing the interface is simpler as one don't have to remember to declare the `testWindows` parameter as `List<? extends Window>` — just use `List<Window>`.
> 
> It is a backwards compatible change, all the tests which use `List<? extends Window>` continue to compile successfully.

You can test this change with tests from #21180 `DefaultFrameIconTest.java` and/or `MenuCrash.java`.

The tests declare the first parameter to `positionTestWindows` as `List<? extends Window> testWindows`. If it were declared as `List<Window> testWindows`, the test would not compile with the current version of `PassFailJFrame`.

Removing the wildcard lower bound from `PassFailJFrame.PositionWindows.positionTestWindows` makes it possible to use the `List<Window>` type in tests.

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

PR Comment: https://git.openjdk.org/jdk/pull/21181#issuecomment-2373864729


More information about the client-libs-dev mailing list