On Tue, 23 Mar 2021 13:45:33 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

> When `getAllPrinterNames()` returns null, the list of `printServices` is 
> assigned a new empty array without invalidating old services which were in 
> the array before.
> 
> The old print services should be invalidated.

src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java line 
120:

> 118:             // don't get the default.
> 119:             invalidateServices();
> 120:             printServices = new PrintService[0];

I am not sure this call to invalidateServices() is needed as we are creating a 
new `printServices` object of 0 length so making the old printServices invalid 
is redundant as it is same global variable.

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

PR: https://git.openjdk.java.net/jdk/pull/3151

Reply via email to