On Thu, 5 Mar 2026 11:28:26 GMT, Alexey Ivanov <[email protected]> wrote:
>> Prasanta Sadhukhan has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Add null check
>
> test/jdk/java/awt/PrintJob/TestPrintNoException.java line 61:
>
>> 59: }
>> 60:
>> 61: private static Frame createUI() {
>
> This fits nicely into
> [`splitUI`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.Builder.html#splitUI(PassFailJFrame.PanelCreator))
> use case.
>
> See
> [`PrintLatinCJKTest.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java)
> for an example, specifically:
>
> https://github.com/openjdk/jdk/blob/dfea6eb9f84142aaa3e51181ea345e8575729ea2/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java#L117
>
> https://github.com/openjdk/jdk/blob/dfea6eb9f84142aaa3e51181ea345e8575729ea2/test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java#L68-L92
splitUI doesn't work here as it expects a JComponent and getPrintJob expects a
Frame
> test/jdk/java/awt/PrintJob/TestPrintNoException.java line 65:
>
>> 63: Button b = new Button("Print");
>> 64: b.addActionListener(new ActionListener() {
>> 65: public void actionPerformed(ActionEvent e) {
>
> @DamonGuy advocated using lambda expressions instead of anonymous class, and
> I agree that the code becomes less verbose.
>
>
> b.addActionListener((e) -> {
> });
Updated
> test/jdk/java/awt/PrintJob/TestPrintNoException.java line 75:
>
>> 73: PassFailJFrame.log(ex.toString());
>> 74: return;
>> 75: }
>
> An exception means the test fails, doesn't it?
updated
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29874#discussion_r2889675204
PR Review Comment: https://git.openjdk.org/jdk/pull/29874#discussion_r2889673132
PR Review Comment: https://git.openjdk.org/jdk/pull/29874#discussion_r2889676066