RFR: 8288137: The set of available printers is not updated without application restart
Kevin Rushforth
kcr at openjdk.org
Fri Jul 8 20:07:13 UTC 2022
On Fri, 8 Jul 2022 17:31:11 GMT, Phil Race <prr at openjdk.org> wrote:
>> modules/javafx.graphics/src/main/java/com/sun/prism/j2d/PrismPrintPipeline.java line 138:
>>
>>> 136: }
>>> 137: }
>>> 138: lastTime = System.currentTimeMillis();
>>
>> Is `lastTime` intended to be the last time you updated the printers or the last time the `getAllPrinters` method was called? If the former, then you would want to set `lastTime` right after `updatePrinters`. If the latter, then it's fine where it is.
>
> The last time we updated.
> If the number of printers has changed I will always rebuild the printer list (set) but if they are the same
> what are the odds a printer was removed and another one added ?
> I figured if 2 minutes has passed since we last checked it is worth it, but I am not re-setting this every
> time we called getAllPrinters() else if you kept calling it every 30 seconds .. then we'd never get past that check.
In that case shouldn't the assignment of `lastTime` be moved up two lines, right below the call to `updatePrinters`? Or am I missing something?
-------------
PR: https://git.openjdk.org/jfx/pull/817
More information about the openjfx-dev
mailing list