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

Clarify the read-once behaviour of System.getenv

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 6, 7, 8, 9, 10
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:
      None

      Description

      The system environment variables are read and cached lazily, on first invocation of getenv. This can lead to some confusion [1], as one could have a reasonable expectation that getenv would read the "live" environment variables on every invocation ( thus seeing any updates or modifications to them ). The specification should document, or even mandate, this behaviour.

      [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-May/047588.html

        Attachments

          Activity

            People

            Assignee:
            chegar Chris Hegarty
            Reporter:
            chegar Chris Hegarty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: