[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: 8320303: Allow PassFailJFrame to accept single window creator
From:       Sergey Bylokhov <serb () openjdk ! org>
Date:       2023-11-30 19:58:07
Message-ID: nkX1RUwaQUHDmwNxL-BCQjm7BYTV3C_8x54kHDkxR8U=.8ebe6971-cb16-4c7b-bba1-6d6aa1bbbbdd () github ! com
[Download RAW message or body]

On Fri, 17 Nov 2023 20:01:55 GMT, Alexey Ivanov <aivanov@openjdk.org> wrote:

> Enhance `PassFailJFrame` for single-window test UI which is the most common case so \
> that there's no need to return `List.of`. 
> With this change, the lambda or method reference passed to `Builder.testUI` will \
> return Window instead of `List<Window>` (or `List<? extends Window>`. 
> This change adds new functional interface `WindowCreator` which returns a single \
> Window; the existing interface is renamed to `WindowListCreator`. 
> It's backwards compatible change; the \
> [FileChooserSymLinkTest.java](https://github.com/openjdk/jdk/blob/7f47c51aced9c724db \
> c9b0d8cbd88c49435da460/test/jdk/javax/swing/JFileChooser/FileChooserSymLinkTest.java) \
> test which uses `Builder.testUI` works without change. 
> It was my main concern that it will be impossible to have two interfaces where one \
> creates a `Windows` and another — `List<Windows>`. The Java compiler \
> automatically selects the correct method based on the return type of the lambda \
> expression, so that both cases are supported. The requirement to return a `List` \
> where only one window is needed bothered me, and I finally solved it. 
> In addition to that, I added description to all the overloads of the \
> `Builder.testUI` method and updated the sample in the class documentation. 
> Since the `PassFailJFrame` class isn't supposed to be extended, I marked it `final` \
> to prevent anyone from doing it.

Marked as reviewed by serb (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/16717#pullrequestreview-1758335015


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic