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

Remove unnecessary explicit initialization of volatile variables in java.desktop

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 18
    • Component/s: core-libs
    • Labels:
      None
    • Resolved In Build:
      b19

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: