On Fri, 8 Jul 2022 17:31:11 GMT, Phil Race <p...@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