On Sun, 17 Apr 2022 22:01:38 GMT, Alexey Ivanov <[email protected]> wrote:
>> test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java line 131:
>>
>>> 129: PrinterJob pj = PrinterJob.getPrinterJob();
>>> 130: if (pj == null || pj.getPrintService() == null) {
>>> 131: System.out.println("Printer not configured or available."
>>
>> I realise the test was already doing the pj == null check but per. the spec,
>> this shouldn't happen
>> https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/print/PrinterJob.html#getPrinterJob()
>
> Right, and IDE generates a warning: _`pj == null` is always false_. I suggest
> removing this condition and thus resolving the warning.
Just a bit of optimisation: you can postpone creating the test frame. The frame
is not needed if the test passes because there's no print service.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8004