UUID.randomUUID() makes an unnecessary call to the UUID constructor

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 5.0
    • Component/s: core-libs
    • x86
    • linux, windows_xp

      FULL PRODUCT VERSION :
      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      There is a minor performance bug in Sun's implementation of java.util.UUID.randomUUID(). Here are the last two lines of this method:

              UUID result = new UUID(randomBytes);
              return new UUID(randomBytes);

      The UUID constructed by the first line is never used. This line is unnecessary.


      REPRODUCIBILITY :
      This bug can be reproduced always.
      ###@###.### 10/14/04 22:47 GMT

            Assignee:
            Iris Clark
            Reporter:
            Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: