RFR: 8366359: Test should throw SkippedException when there is no lpstat [v4]

Alexey Ivanov aivanov at openjdk.org
Fri Aug 29 12:54:42 UTC 2025


On Fri, 29 Aug 2025 10:29:58 GMT, SendaoYan <syan at openjdk.org> wrote:

>> Hi all,
>> 
>> I think test javax/print/PrintServiceLookup/CountPrintServices.java should throw jtreg.SkippedException when there is no lpstat, rather that report test failure.
>> 
>> Only javax/print/PrintServiceLookup/CountPrintServices.java invokes lpstat explicitly.
>> 
>> Change has been verified locally, test-fix only, no risk.
>
> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   1. add import java.io.IOException; 2. Re-throw the IOException if do not throw SkippeException

Looks good.

I'd appreciate if you do another clean-up.

test/jdk/javax/print/PrintServiceLookup/CountPrintServices.java line 50:

> 48:     }
> 49:     String[] lpcmd = { "lpstat", "-a" };
> 50:     Process proc = null;

Suggestion:

    Process proc;

The assignment is now redundant. The variable is always initialised inside the `try` block, otherwise an exception is thrown.

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

Marked as reviewed by aivanov (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26988#pullrequestreview-3168630181
PR Review Comment: https://git.openjdk.org/jdk/pull/26988#discussion_r2310086228


More information about the client-libs-dev mailing list