<i18n dev> RFR: 8272756: Remove unnecessary explicit initialization of volatile variables in java.desktop [v2]

Сергей Цыпанов github.com+10835776+stsypanov at openjdk.java.net
Tue Sep 21 11:37:42 UTC 2021

> This is a continuation of
> - https://bugs.openjdk.java.net/browse/JDK-6736490
> - https://bugs.openjdk.java.net/browse/JDK-8035284
> - https://bugs.openjdk.java.net/browse/JDK-8145680
> - https://bugs.openjdk.java.net/browse/JDK-8251548
> As mentioned in JDK-6736490:
> _An explicit initialization of a volatile class instance variable, such as private volatile Object = null; or private volatile int scale = 0; is unnecessary since the Java spec automatically initializes objects to null and primitive type short, int, long, float and double to 0 and boolean to false. Explicit initialization of volatile variable to a value the same as the default implicit initialized value results in an unnecessary store and membar operation._

Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision:

  8272756: Remove unnecessary explicit initialization of volatile fields in java.desktop


  - all: https://git.openjdk.java.net/jdk/pull/5197/files
  - new: https://git.openjdk.java.net/jdk/pull/5197/files/d06aff5b..a3558d0a

 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5197&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5197&range=00-01

  Stats: 4 lines in 3 files changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5197.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5197/head:pull/5197

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

More information about the i18n-dev mailing list