Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272756

Remove unnecessary explicit initialization of volatile variables in java.desktop

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 18
    • None
    • core-libs
    • None
    • b19

      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 Doug Lea claims in http://cs.oswego.edu/pipermail/concurrency-interest/2015-December/014770.html

      "there is never any reason to explicitly initialize fields to 0/0.0/false/null"

      Explicit initialization of volatile variable to a value the same as the default implicit initialized value results in an unnecessary store and membar operation.

            stsypanov Sergey Tsypanov
            stsypanov Sergey Tsypanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: