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

Use unsigned random long in a temp directory name

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b144
    • Verification:
      Not verified

      Description

      When File.createTempFile() is called, a random long value is generated, which is then made positive with Math.abs() and then used as a part of the directory name.

      Instead, it would be better to use Long.toUnsignedString():
      1) no need to deal with the corner case Long.MIN_VALUE,
      2) increase the space of random values by the factor of 2.

        Attachments

          Activity

            People

            Assignee:
            igerasim Ivan Gerasimov
            Reporter:
            igerasim Ivan Gerasimov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: