On Mon, 16 Jan 2023 20:25:02 GMT, Andrey Turbanov <[email protected]> wrote:

> If CompareAndSwap is not used, then AtomicReference could be replaced with 
> volatile. It simplified code a bit.

src/java.desktop/share/classes/sun/swing/text/TextComponentPrintable.java line 
343:

> 341:                     public FontMetrics getFontMetrics(Font font) {
> 342:                         return (frc == null)
> 343:                             ? super.getFontMetrics(font)

Should the be set to local variable to avoid 2 volatile reads?

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

PR: https://git.openjdk.org/jdk/pull/12018

Reply via email to